rend3
rend3 copied to clipboard
Strange lighting issues with directional light + overlapping geometry
There seems to be a square "plane" following the cameras position, that when it hits overlapping geometry causes the lighting to turn black. When you zoom out far enough, the lighting goes to normal. Note that the geometry underneath has no lighting issues.
You're seeing shadows! The directional light shadow map is only so big (it's configurable in the light descriptor) so what you're seeing is there being no shadows if you're too far away from the shadow map (centered at the camera) and shadows being introduced as you get closer.
@cwfitzgerald that makes sense, but the shadows are still appearing in the wrong spots it seems. It looks like the shadow map is backwards for some reason on those overlapping portions, IE shadow is being applied on the geometry on top and not the geometry on bottom if you look at the video.
There is no geometry occluding from above for there to be shadows on the mesh on the top side.
As a note, I am using a right-handed coordinate system with z-up. In case that might be messing with the math somewhere.
@marstaik do you have a reproduction case I can play with? It's hard to debug these things outside of renderdoc