![]() |
![]() |
#1 |
Historian
Join Date: Jan 2010
Location: Russia
Posts: 370
|
![]()
Hi people! It seems that there is one topic that I have been asked to talk about for a long time - the graphic effect of reflection in the classic Tomb Raider games on PS1. As always all pictures are clickable.
All you may need to know is a very basic understanding of:
Tomb Raider I In TR1, this effect could be seen on save crystals — they had a mirror-like surface with a blue hue. Also, the reflection was used when Lara died in the hand of Midas — she turned into a golden statue. ![]() ![]() Save crystal is a single 3D mesh, but Lara had several meshes, such as a foot, hand, head or torso. The meshes that were supposed to become reflective were set in the program code very simply — when a certain mesh was rendered, it was marked with a reflection flag and a tint colour was set for it. Colour for golden Lara was #A09860, and colour for a save crystal was #4040FF. All such cases were hardcoded. If mesh was marked as reflective it used special environment map texture tinted with given colour instead of it's own textures. In simple words this reflection texture was a screenshot that has been cropped in such a way that a central square part left with a side equal to the height of the screen. However, to be compatible with reflections, there is an additional requirement for the mesh; a set of vertex normals has to be specified for it. Vertex normals are used for proper lighting calculation, but in the case of reflections they get a double function. Bad news is that some meshes don't have them because of simplified lighting, normally it's static meshes or room geometry. Good news is that vertex normals have already been calculated by the level editor and they are definitely presented for save crystal and all Lara's meshes. Tomb Raider II In TR2, tinted reflection was left only for Golden Lara in PS1 Dozy mode (flying cheat mode that could be enabled via patching script file). The original gold colour #A09860 is inherited from TR1. The problem is Midas room walls are orange tinted and bright, and reflection looks nice. But for most TR2 rooms it's not. So to compensate all of this and to make gold more sweet in any room I used a different tint colour for TR2Main — #FFC040. ![]() ![]() The format of PS1 level file has been changed for TR2. Each mesh, in addition to the usual set of textured polygons, could be given an additional set of reflective polygons, so there were objects with meshes that reflect partially. The reflection effect were not hardcoded anymore, except golden Lara in Dozy mode. Alas such reflective polygons data was not supported by PC level file format. All common reflection effects had no tint, and the original mesh texture was not completely replaced with the reflection texture as it was in TR1, but the reflection texture was overlaid on top of the normal texture with 50% opacity. If you played PS1 version you remember this effect on traps: rolling wheel blades, wall mounted blades, deadly statues with swords. ![]() ![]() ![]() But you probably missed a reflective effect on Boathouse Key (Venice) and Library Key (Bartoli's Hideout), as well as a mask of flamethrower guy. ![]() ![]() ![]() There was even one small reflective polygon under windshield of the fast snowmobile. It was certainly leftover bug, so I did not port it to TR2Main. But instead I decided to add one more reflective thing into TR2Main that was absent in PS1 version — windshield of the armed snowmobile. Just compare screenshots, I bet Core Design intended to make this reflective in 1997, but they did not because of possible performance issues. ![]() ![]() But how it works? Vertex normals have already been calculated by the level editor and they are presented for all meshes that supposed to be reflective. The screenshot can be taken in one of few ways.
You may notice that only incircle part of square texture is used, corners are unused. To confirm this, we can run a funny experiment. Instead of an environment map texture let's take this texture with a rainbow radial gradient and some hatch outside the circle. Also we change it's opacity to 100%. ![]() ![]() ![]() We can see a rainbow, but no sign of a hatched part. Also by colour you can find vertex normal. Thanks for reading! Hope you enjoyed this article. If you still have questions on this and other topics, feel free to ask. I will be happy to answer.
__________________
To seek. To learn. To do. (C) Quest for Glory Last edited by Arsunt; 09-09-21 at 16:22. |
![]() |
![]() |
![]() |
#2 |
Professor
Join Date: Dec 2008
Posts: 3,393
|
![]()
thank you so much for this. youre doing such an astounding job on these old games
![]() ![]() ![]() ![]() ![]() ![]()
__________________
Hi, I'm Marissa. I'm super excited to take trf's look to the next level. |
![]() |
![]() |
![]() |
#3 |
Administrator
Join Date: Jun 2000
Posts: 60,389
|
![]()
Thank you very much for posting your work Arsunt.
|
![]() |
![]() |
![]() |
#4 |
Golden
Join Date: May 2005
Location: Austria
Posts: 6,648
|
![]()
Thanks for the detailed descriptipn of the process, and thanks for pringing TR2 back to life!
__________________
~ Die Welt? Ein Tor. Zu tausend Wüsten, stumm und kalt. ~ |
![]() |
![]() |
![]() |
#5 |
Archaeologist
Join Date: Jun 2013
Location: not far enough
Posts: 1,607
|
![]()
Thanks for the explanation, neat!
![]() |
![]() |
![]() |
![]() |
#6 |
Student
Join Date: Jul 2015
Location: Aachen, Germany
Posts: 117
|
![]()
@Arsunt thank you very very much for your research and your explanation. It made the implementation of this effect in EdisonEngine basically a O(1) operation
![]() |
![]() |
![]() |
![]() |
#7 | |
Golden
Join Date: May 2005
Location: Austria
Posts: 6,648
|
![]() Quote:
![]()
__________________
~ Die Welt? Ein Tor. Zu tausend Wüsten, stumm und kalt. ~ |
|
![]() |
![]() |
![]() |
Thread Tools | |
|
|