In the thread about the PS2 post processing the topic shifted towards the PS2 reflections and I said It would be a good idea to make a new thread for this, this is it.
I posted some stuff I found it here: http://gtaforums.com...d/?p=1066309640
but I'm giving my current knowledge here as well:
The PS2 reflections consist of three passes, the diffuse pass, the environment pass and the specular pass (this one's missing on the PC which has specular lighting instead).
What we have is Dexx's plugin (with source) which does a pretty good job generally but is not accurate enough: http://www.gtagarage...ow.php?id=17540
The problems are these:
- The environment map no longer moves with the vehicle
- The maps are "too bright"
- The texture coordinate generation for the specular pass is incorrect (uses D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR, the PS2 does something different).
The first bug can probably be fixed by someone acquainted with the executable.
The other two problems can only be fixed until we know what the PS2 does, this is what I found out:
(Note: all I'm writing now I found out by looking into the calls and state of pcsx2 frames captured with PIX)
The same geometry is rendered three times (once for each pass) on the PS2 and blended together. In practice, the blend is just dst = dst + src for both reflection passes.
The texture is modulated with the vertex colors. These are 1.7 fixed point numbers (so 0.0-1.0 is 0-128) before being sent to pcsx2's vertex shader (which just converts them to floats) and are multiplied again by 1.9921875 (= 255/128) to convert them to the normal 0-255 range. So if you're debugging with PIX, remember to multiply the color values of the mesh by ~2.
The vertex colors of both passes differ from one another and are dependent on time and weather. This means they are very likely to come from the timecyc.
The environment map is rendered with the somehow transformed second UV set (how is the transformation done?, I'd very much like to know) just as on PC without the mod.
The specular map is rendered with generated texture coordinates. How these are calculated I don't know yet, one would have to look at the VU1 program that processes vehicles for that probably (this will get ugly).
So we'll have to find out what the colors for the reflection passes are, i.e. where they come from.
And secondly we need to find out the correct tex coord generation.
It would be very cool if someone knowledgeable could make a hook that renders the vehicles with a shader so one can experiment more easily (and we'll need a shader in the end anyway since I don't think we can generate texture coordinates otherwise). I'll ask Dexx about this, I think he already did something like that.
That's all for now, I really hope we can do this
EDIT: See here for the first release: