-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweak shadow bias defaults for DirectionalLight3D and OmniLight3D #55757
Tweak shadow bias defaults for DirectionalLight3D and OmniLight3D #55757
Conversation
5512d49
to
154fe42
Compare
Do note that when using blending, higher Normal Bias will result in a more clearly visible Blend-fade effect when transitioning between splits. Not that it's a big deal with 2, just something to keep in mind. The Black Area is the Shadow in Both splits, The gray Area is where the Shadow in the split that's fading. as the normal bias decreases, the gray area decreases too because the 2nd split is mapped more closely to the expected result. |
154fe42
to
2937481
Compare
Redone to only increase Normal Bias. Standard shadow bias is no longer changed by this PR. Note that this PR will make the difference between directional shadow splits more noticeable until #60178 is merged. |
8502e3a
to
1695cca
Compare
Bias needs to be different per light type, so please make sure to test this well. |
1695cca
to
ef33a29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran your test project again to test these settings on Beta 7. I found that the SpotLight looked fine as it was. The Omnilight indeed benefited from decreasing shadow_bias, but it did not benefit from increasing the normal_bias. DirectionalLight3D did benefit from increasing normal_bias to 2 and it is fine with its current shadow bias of 1.0.
All in, what appeared to be the ideal settings are:
- SpotLight3D: leave as is
- Omnilight3D: decrease shadow bias to 0.1
- DirectionalLight3D: increase normal_bias to 2
- Increase DirectionalLight3D normal bias to 2.0 to reduce shadow acne at grazing angles. - Decrease OmniLight3D bias to 0.1 to reduce shadow peter-panning.
ef33a29
to
e560971
Compare
@clayjohn I've pushed an update according to your suggestions. One (unrelated) issue I noticed is that at very low Blur values, spot light shadows exhibit severe acne with the default bias settings:
This only occurs with spot light shadows, not omni or directional light shadows. This may be a result of #68339. Also, omni and spot lights still exhibit some peter-panning, but we need to keep the bias relatively high as it's currently not scaled when the shadow map resolution is decreased due to the shadow being moved to a smaller quadrant in the atlas. (This is worth a separate issue with a dedicated MRP, which I can create if needed.) Edit: Issue opened: #69866 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. Although I am confused why the docs indicate the Light3D normal bias is 2.0 (which should only be the case for DirectionalLight3D). You would think it would be reversed and the Light3D normal bias would be 1.0 and only DirectionalLight3D would override it to change it to 2.0
I guess this is an issue that can be investigated in the docs binding later.
We can probably work it around with some |
Thanks! |
Follow-up to #51335.
Light3D now uses a normal bias of 2 (instead of 1) to better combat shadow acne, without introducing more peter-panning.
The new values behave fairly well at increased blur values (between 1 and 2.5), but extreme blur values still don't look good out of the box. We can further improve reduce acne/peter-panning at high blur values by multiplying the shadow bias by the blur value (when it's above 1), but I think this is better to do in a separate PR.
Edit: Done in #55758 🙂
This closes #54523.
Testing project: test_shadows.zip
Preview
Click to view at full size.
Note: Debanding is enabled to ensure that color banding doesn't get confused for shadow acne. Lights also have their Specular property set to 0.0.
DirectionalLight3D
OmniLight3D