RagnarokResearchLab / RagLite

Standalone client/server application for locally simulating a persistent world
Mozilla Public License 2.0
11 stars 1 forks source link

Investigate potential inaccuracies in the surface normal generation for sloped terrain geometry #372

Open rdw-software opened 7 months ago

rdw-software commented 7 months ago

One of the issues I've found while investigating #345 and #352 is that the surface normals are clearly wrong (at least for slopes). It's unclear whether this is a big problem; it might explain why diffuse colors aren't rendered correctly, but it may also be a red herring. In order to investigate the impact of this, a flat terrain map should be created, by simply setting all heights to zerot:

I'm fairly certain that they took some shortcuts here to generate less accurate normals faster, which explains the delta.

rdw-software commented 6 months ago

This doesn't meaningfully change the output of the lighting model; Flattening the terrain doesn't resolve any of the remaining rendering issues, which makes me think that this is more or less completely irrelevant (within the acceptable margin of error).

rdw-software commented 6 months ago

Looks like switching the output format from sRGB to RGBA fixed all remaining issues - at least as far as I can tell.

rdw-software commented 6 months ago

Hmm... I think this was actually unrelated to the sRGB output; there are some inaccuracies on sloped terrain still. IIRC replacing the diffuse textures with a white (blank) image and disabling all other rendering features resulted in visible differences for the interpolated colors from the directional light source. I also feel like there are visible differences on xmas_fild01 (blue-ish tint).

No big deal, but I'll reopen this nonetheless. First, should try to reproduce the original issue in a flattened pay_dun00 though.