[CS] - rain texture shades specular incoming light only in a fixed direction
Describe the bug in rainy circumstances all specular highlights seem to have a fixed direction instead of confronting the camera direction according to the surface normal.
To Reproduce
- wait for rain at night
- turn on the flashlight
- look at models that you can circle around an that are wet
- circle around models, the error should become obvious
Expected behavior specular highlights should relate to the normal direction of the surface and the normal-map, not a fixed direction!
Screenshots
the flashlight is on, the floor and the cement tube light in a strange way looking roughly from west to east
https://ibb.co/T1hDBWZ
looking from east to west (take a look to the compass in the minimap) the floor lights correctly, as well as the cement tube
https://ibb.co/9cPxWPW
and here is proff: since the interior of the cement tube is not wet the specular-diffuse light works correctly, take a look at the shadows inside the tube, it proves a light is being shone upon that, but judging for the exterior (that is wet) and the floor (wet too) it seems the light comes from underneath
https://ibb.co/p1QthcG
something is amiss here
BugTrap error report none.
Desktop (please complete the following information):
- OS: [Ubuntu 21.10]
- OpenXRay build version [f77babc825694e552b825fcba510ae814c143d07]
Additional context no special operation here.
Is this really specific to Clear Sky only? OpenGL uses same shaders for both... Only if it's the engine problem...
@vTurbine
it also happens in CS:
the same spot, wrong in one direction:
https://ibb.co/35bxgM6
correct in the other direction:
https://ibb.co/4py5d7X
Brief investigation shows that there is some mess with shadowmap projection in gloss modification pass (takes place in rain_patch_normal.ps). Can be wrong m_shadow or m_sunmask matrices calculations.
Proof pic:
(top - G-buffer gloss after modification, bottom - modified albedo)
This was fixed #1065.