julianxhokaxhiu / FFNx

Next generation modding platform for Final Fantasy VII and Final Fantasy VIII ( with native Steam 2013 release support! )
GNU General Public License v3.0
366 stars 49 forks source link

[ FF7 ] World model vertex colors appear to be inverted #610

Open HeyItsLollie opened 1 year ago

HeyItsLollie commented 1 year ago

Vertex colors for World models appear to be inverted, compared to PS1. This issue was stumbled upon while taking screenshots for #609.

These screenshots were taken at Kalm, immediately outside Midgar. Open these images in separate tabs and flip between them, the issue will be immediately apparent.

PlayStation: Field_PS1

Steam. Note that in this example image, I have edited pixel.hlsl at Line 28 to multiply texture color brightness by 2, to make the vertex coloring issue easier to spot in comparisons. Field_Steam-Hack

And for posterity, here is Steam as it appears normally, without any modifications: Field_Steam-Stock

julianxhokaxhiu commented 1 year ago

Hi, thanks for the report. Did you manage to reproduce the issue on the latest Canary? If yes, can you please send your FFNx.toml file?

HeyItsLollie commented 1 year ago

Yep, this is present on FFNx-v1.16.0.61. Here's the FFNx.toml file! (zipped so Github will accept it): FFNx.zip

CosmosXIII commented 1 year ago

Thanks for the report. Clearly light direction is inverted. Problem is the terrain in world map mode works differently than other 3d models. The terrain geometry is pre-transformed on the CPU making it difficult to fix in a similar way as I did for other models. Of course, we could fix the CPU implementation of the lighting calculations that the game is doing to invert light directions but my focus right now is moving as much lighting calculations to the GPU (shader) rather than keeping it on the CPU. In this sense, can't share the details right now but we have something related to the worldmap coming in a few months that may circumvent this problem.