Automatically increase Light3D shadow bias when shadow blur is above 1.0#55758
Automatically increase Light3D shadow bias when shadow blur is above 1.0#55758Calinou wants to merge 1 commit into
Conversation
|
Would be nice if this was somehow displayed in the inspector. Right now user input is just ignored if it is below the min value. |
|
Does this change affect the total shadow blur (so after Quality blur multiplier is applied) or only the setting blur? It should affect the total because higher quality softness tend to create more shadow acne because of their internal higher blur multipliers. |
This acts as a multiplier, so I don't see how the value can be ignored (regardless of the blur setting you're using). The multiplier itself is an implementation detail (like the shadow Z near/far ranges), so I didn't mention it in the class reference.
Right now, this PR doesn't take the shadow quality blur factor into account. This should be feasible, but I think the base automatic adjustment will work well enough. I fear that further increasing the shadow bias factor automatically will result in too much peter-panning at high shadow quality settings. |
This makes it possible to adjust shadow blur without having to tweak
bias to avoid shadow acne. The formula automatically increases
shadow bias, normal bias and transmittance bias when shadow blur
is above 1.0:
shadow_blur_bias_factor = max(1, 0.5 + shadow_blur * 0.5);
At the highest shadow blur value allowed in the inspector (8),
the shadow bias and normal bias will each be multiplied by 5.5.
Automatic adjustment is not performed for PCSS-style shadow blur
(light size > 0) yet.
134f02e to
d7942ba
Compare
|
Superseded by #68339, which is a more robust solution to the original problem. |
This makes it possible to adjust shadow blur without having to tweak bias to avoid shadow acne. The formula automatically increases shadow bias, normal bias and transmittance bias when shadow blur is above 1.0:
At the highest shadow blur value allowed in the inspector (8), the shadow bias and normal bias will each be multiplied by 5.5.
Automatic adjustment is not performed for PCSS-style shadow blur (light size > 0) yet.
This partially addresses #53534.
TODO
Preview
Note: The bias values used in the demo below are from #55757.
DirectionalLight3D
Visible lines between PSSM shadow splits will be attenuated if #48776 is merged.
Before
shadow_blur_directional_old2.mp4
After
shadow_blur_directional_new.mp4
OmniLight3D
Before
shadow_blur_omni_old2.mp4
After
shadow_blur_omni_new.mp4
SpotLight3D
Before
shadow_blur_spot_old2.mp4
After
shadow_blur_spot_new.mp4