diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-13 16:45:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-13 16:45:49 +0200 |
commit | e499758a77dfb94d5f8c13e9e74f6352f5c0e472 (patch) | |
tree | 672d91588870022fe39eb25cba84fd5b3d746696 /scene/3d | |
parent | 07c355c209c898f0696983f16cb2076366e0b283 (diff) | |
parent | 55d357b1ebcff4560386e72500707304b6bef50b (diff) |
Merge pull request #51025 from reduz/fix-directional-shadow-bias
Fix directional shadow bias
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/light_3d.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index 328cb8b22b..508f8a70df 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -212,6 +212,10 @@ void Light3D::_validate_property(PropertyInfo &property) const { property.usage = PROPERTY_USAGE_NONE; } + if (get_light_type() == RS::LIGHT_SPOT && property.name == "shadow_normal_bias") { + property.usage = PROPERTY_USAGE_NONE; + } + if (get_light_type() == RS::LIGHT_DIRECTIONAL && property.name == "light_projector") { property.usage = PROPERTY_USAGE_NONE; } @@ -340,7 +344,7 @@ Light3D::Light3D(RenderingServer::LightType p_type) { set_param(PARAM_SHADOW_FADE_START, 0.8); set_param(PARAM_SHADOW_PANCAKE_SIZE, 20.0); set_param(PARAM_SHADOW_BLUR, 1.0); - set_param(PARAM_SHADOW_BIAS, 0.02); + set_param(PARAM_SHADOW_BIAS, 0.03); set_param(PARAM_SHADOW_NORMAL_BIAS, 1.0); set_param(PARAM_TRANSMITTANCE_BIAS, 0.05); set_param(PARAM_SHADOW_VOLUMETRIC_FOG_FADE, 0.1); @@ -422,7 +426,8 @@ DirectionalLight3D::DirectionalLight3D() : set_param(PARAM_SHADOW_FADE_START, 0.8); // Increase the default shadow bias to better suit most scenes. // Leave normal bias untouched as it doesn't benefit DirectionalLight3D as much as OmniLight3D. - set_param(PARAM_SHADOW_BIAS, 0.05); + set_param(PARAM_SHADOW_BIAS, 0.1); + set_param(PARAM_SHADOW_NORMAL_BIAS, 1.0); set_shadow_mode(SHADOW_PARALLEL_4_SPLITS); blend_splits = false; } |