xray-16 icon indicating copy to clipboard operation
xray-16 copied to clipboard

[CS] - rain texture shades specular incoming light only in a fixed direction

Open BielBdeLuna opened this issue 3 years ago • 4 comments

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

  1. wait for rain at night
  2. turn on the flashlight
  3. look at models that you can circle around an that are wet
  4. 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 wrong direction 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 right direction 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 proof 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.

BielBdeLuna avatar Apr 02 '22 01:04 BielBdeLuna

Is this really specific to Clear Sky only? OpenGL uses same shaders for both... Only if it's the engine problem...

Xottab-DUTY avatar Apr 02 '22 01:04 Xottab-DUTY

@vTurbine

Xottab-DUTY avatar Apr 02 '22 01:04 Xottab-DUTY

it also happens in CS:

the same spot, wrong in one direction: black in this direction https://ibb.co/35bxgM6

correct in the other direction: correct in this direction https://ibb.co/4py5d7X

BielBdeLuna avatar Apr 03 '22 02:04 BielBdeLuna

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)

vTurbine avatar Apr 07 '22 10:04 vTurbine

This was fixed #1065.

Xottab-DUTY avatar Sep 07 '23 18:09 Xottab-DUTY