TR1X
TR1X copied to clipboard
Feature Request: Reflections (Save Crystals and Midas Gold Lara)
Now the majority of the game has been decompiled, I think it would be a good idea to port the reflection feature from TR2Main over if possible.
Specifically for the Save Crystals and Midas Gold Lara, that will make them a million times better.
I believe this can be done with shaders, specifically with a technique called screen space reflections.
In case you didn't know, CroftEngine has added support for reflections a few months back. I have no clue about graphics programming, so I don't understand what exactly was done, but it looks like it's using a (relatively simple) shader and a new reflective mesh attribute.
It looks really phenomenal, so I'd love to see something similar come to Tomb1Main.
Croftengine is a totally different engine though.
TR1M (at least so far) has been about mimicking vanilla behaviour, or making it accessible on modern hardware.
I think Arsunt has pretty good knowledge about how the "fake" reflections were done for TR1 and 2.
Fair enough. Adding reflections exactly like the PS version did surely sounds like a sensible goal for a project trying to stay true to the original.
I'm not sure if most people actually care about how exact the effect is replicated, though. It stands to consider, that the reflection effect in TR1 was done in a way so the PS1 could handle it easily. These days, even not-so-modern hardware should be able to do a similar effect right out of the box.
Given that the original effect actually reflects everything on screen (including the reflective object itself), I don't think anyone would really complain if the effect wouldn't be 100% accurate - as long as it's there, and as long as it's optional.
Some PS1 reference clips because why not.
Crystal
https://user-images.githubusercontent.com/4934209/214978475-903c7727-4ed8-42a4-a8c5-b5c73e3565d2.mp4
https://user-images.githubusercontent.com/4934209/214978488-ab9f421e-c952-4ff8-9e9d-6266c6c6aab6.mp4
https://user-images.githubusercontent.com/4934209/214978499-f5b77d57-b79f-4157-8f86-396513207f7d.mp4
Midas
https://user-images.githubusercontent.com/4934209/214978527-295cf478-6f3f-4567-9d0d-dd5001f300e1.mp4
Arsunt's explanation of TR UV reflection mapping:
Preparing the article about all of it. Here is a "teaser" for you. It's about how TR reflection UV mapping works. The square central area of the last rendered frame is taken as texture. Only the centred incircle area is used for reflection, everything beyond is never reflected. Let's suppose for now that radius of the circle is 1 and coordinates of its center is (0; 0).
For each vertex of the mesh, a view rotated normal vector is taken (vertex itself coordinate does not matter). Normal vector coordinates in the XY plane will indicate the desired point of the texture. Since the length of the normal vector is always equal to 1, and the Z coordinate is discarded, it is guaranteed to stay inside the circle.
So now the XY coordinates inside this "circle area" are in range -1..1, but for UV we want 0..1. This part is fairly simple:
U = (X+1)/2; V = (Y+1)/2;
Source: https://discord.com/channels/218414493355606016/394838132643725314/704968088042340384
Any update with this feature. I would love to see this implemented for parity with the PS1 version.
I just found Arsunt had posted about the effect in great detail here: https://www.tombraiderforums.com/showthread.php?t=226585