Light leak / shadow bug
tracked
Cain Maven
- Create a simple cube (mesh or prim) and scale it to 0.3, 4.0, 4.0.
- Create another cube, scale it to 4.0, 4.0, 0.3 and place it on top of the first one.
- Set the sun azimuth so that it shines onto the wide side of the first cube.
Move away from the objects and observe that the shadow changes; there is now a fully lit band of light directly underneath the second object.
This seems NOT to be not related to:
⢠Materials/PBR -- adding a PBR material does not change this behavior.
⢠Geometry -- the objects are watertight.
⢠LOD -- a mesh cube with all LODs using the full geometry behaves the same.
⢠Physics Shape Type -- Convex Hull and Prim behave the same.
I have found only two factors that affect this:
- Top object thickness -- the effect kicks in farther away with thicker objects.
- The Draw Distance -- the effect kicks in farther away with lower distances.
Interestingly, moving the top object up so that there is a gap between the two object changes the behavior and reduces the effect; see the attached image.
PS: I realize that this may not technically be a "light leak" -- but I couldn't think of a better term.
PS 2: I have tried to think of ways of designing around the issue, but I don't think there are any realistic options. Most non-trivial structures will encounter this issue in some form or other.
Log In
gweha Resident
It even creates this on non-split edges. I hope there is some solution after 1 year of this post.
Atlas Linden
gweha Resident: Which viewer are you observing the issue on? Does it occur on the latest LL viewer or Firestorm Beta?
Can you provide a SLURL for where we can see this?
Cain Maven
Atlas Linden The issue is still alive on the latest LL viewer (7.1.14.15192634334 on Windows 11) as well as the latest FS beta. I'll IM you a SLURL where you can see it.
gweha Resident
Atlas Linden as Cain wrote below, both cases. Only way I got rid of it was adjusting RenderShadowBias to zero
Atlas Linden
marked this post as
tracked
Atlas Linden
Thanks for the report, Cain!
This issue is now tracked. Stay tuned to future updates for a fix.
Everian Hexem
This looks to me like an issue with shadow bias and offset...
Looking through the debug settings, we
do
have settings for these buried deep inside the viewerRenderDeferredSpotShadowBias
RenderDeferredSpotShadowOffset
RenderShadowBias
RenderShadowBiasError
RenderShadowBias
RenderShadowOffsetError may help too, it also looks related.
In the debug menu. Not sure these still work under pbr but worth a look
Cain Maven
Everian Hexem Interesting... I've only done limited testing, but so far setting RenderShadowBias to zero (default is -0.002) solves the issue. This works for both BP and PBR, as far as I can tell.
Everian Hexem
Looks like RenderShadowBias is the one that makes a difference here. You can turn shadow bias down to remove this effect, just know that it can also cause incorrect self-shadowing on objects. It's one of those compromise things. A value of .001 seems to get it a little closer to accurate, but any higher than that and things start to get weird.
RenderShadowBiasError also has an impact. I found a value of -0.003 also helped to reduce this without things getting strange
Cain Maven
Everian Hexem This makes sense -- as you zoom out, the relative distances shrink, you increase the chance of roundoff error and so the banding kicks in.
RenderShadowBiasError is also interesting, as it apparently scales the bias based on altitude; the flicking you see between close surfaces at altitude being another round-off error issue.
Perhaps what we need is a scaling factor that is based on distance rather than altitude. That might allow the bias to work its magic up close but prevent the error as you move away from the object.
Update: The issue is indeed worse at altitude; I just tested at 3000m. However, setting _both_ values to zero solved it.
Everian Hexem
Cain Maven I did a little more testing and did find that at fully 0 shadows were doing odd things at base elevation, especially on alpha hair (many overlapping surfaces). I ended up with a RenderShadowBias of -0.0005 and a RenderShadowBiasError of -0.003
Cain Maven
Everian Hexem While you and I may be ok with tweaking debug settings, most users are not, nor should they be :)
This needs some attention.
Everian Hexem
Cain Maven I'm not saying that it doesn't. But this information should assist with a possible fix. Testing and finding the source saves time and clarifies the issue. What we've found is not that the issue is a mystery light leakage through the object, but that the shadow bias settings are overly aggressive and could use an adjustment.
Cain Maven
Everian Hexem Yes, agreed. I wasnât implying that youâre not working towards a fix. Weâre on the same page here :)