- Home /
What causes the concentric rings with volumetric lights in HDRP?
I am trying to get light shafts in Unity 2019.3 and HDRP 8.0.1. I modeled this simple demo scene. The light is a directional light and I have a sky and fog volume and auto-exposure. I have baked lights disabled and there is no skybox.
As can be seen, I have these weird concentric rings that are caused by the volumetrics. They disappear when I disable volumetrics either in the directional light or in the volume.
What might be causing this? How can I get rid of this?
Answer by Namey5 · Mar 25, 2020 at 03:14 AM
This is essentially inverse shadow-acne. Shadowmapping isn't a perfect model of the surfaces of objects due to rasterisation, so you end up with low-resolution lines on objects because they are casting shadows onto themselves. To fix this, we apply shadow biasing to push the shadows slightly further away from the objects, however if you do that with volumetric lighting, you'll end up with lighting leaking through walls (as you see here). I'm not familiar with how volumetric lighting is implemented in HDRP, but at a glance it would appear they use a froxel volume to store lighting data. Whilst this is a good fit, in order for it to be at all performant the volume has to be fairly low resolution. As a result, you end up with a similar problem at shadow discontinuities, as the low resolution volume has a hard time factoring in very thin surfaces. On top of that, shadow biasing may also be at play here, meaning two sources of light leaking end up being combined. There is only really one fix for this (although it works for both) - make your walls thicker. Most of these techniques work on the assumption that the majority of objects are fully 3D closed meshes, and so you will get visual errors if you only have one side as the object becomes infinitely thin. In theory, you could increase the resolution of your shadowmaps and lighting volume, but it would be much slower and the error would still be there, albeit at a smaller scale.
This worked like a charm. Actually upon reading your answer I realized that I had tweaked normal and slope-scale depth bias in the shadow settings due to light leaking. Reverting this and increasing the wall thickness from 0.1m to 0.4 meter solved the issue as you said. Thanks a lot!