GarageGames / Torque3D

MIT Licensed Open Source version of Torque 3D from GarageGames
http://torque3d.org
MIT License
3.35k stars 1.2k forks source link

Point Light shadow artifacting/light leak #2303

Open Bloodknight opened 5 years ago

Bloodknight commented 5 years ago

stockdevhead_debug_2019-01-27_11-21-38

Bloodknight commented 5 years ago

stockdevhead_debug_2019-01-27_12-58-59

Lynouna commented 5 years ago

If I remember correctly, it's actually the seam where the two halves of the shadow map are stitched together. There's an old forum post about it: https://forums.torque3d.org/viewtopic.php?t=966. You can rotate the point light to change the location of the seam so that it isn't visible, with careful placement of the light. I've found that increasing the shadow map resolution and rotating the light so that the seam is on the horizontal can produce decent results as long as the light doesn't have a large range value. Unfortunately, it will cause some warping and there's not much else as far as I know that can be done aside from implementing a different shadow mapping technique.

Azaezel commented 5 years ago

yeah, it's pretty much the nature of dual parabaloid to, well, cast a pair of parabaloids. always gonna be a degree of that occuring, though we do seem to have found a bit of mitigation via flipping https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/shaders/common/lighting/advanced/pointLightP.hlsl#L87-L91 on over to https://github.com/Azaezel/Torque3D/blob/PBR_ProbeArrayWIP/Templates/Full/game/shaders/common/lighting/advanced/pointLightP.hlsl#L89-L91 as a compensator