diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-05-21 20:16:23 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-05-23 14:22:22 +0200 |
commit | 971a0deeb6261ff2a66451b943746333e816a16d (patch) | |
tree | 0baf1fef4984441489564b5d7457aeed68348b3b /scene | |
parent | 9239412027b6c25009efab69dc39650e0d76c56d (diff) |
Increase the default DirectionalLight3D and OmniLight3D shadow biases
This should decrease the amount of visible shadow acne by default.
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/light_3d.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index 814e911372..e722612384 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -424,9 +424,11 @@ DirectionalLight3D::DirectionalLight3D() : Light3D(RenderingServer::LIGHT_DIRECTIONAL) { set_param(PARAM_SHADOW_MAX_DISTANCE, 100); 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_shadow_mode(SHADOW_PARALLEL_4_SPLITS); set_shadow_depth_range(SHADOW_DEPTH_RANGE_STABLE); - blend_splits = false; } @@ -468,6 +470,9 @@ void OmniLight3D::_bind_methods() { OmniLight3D::OmniLight3D() : Light3D(RenderingServer::LIGHT_OMNI) { set_shadow_mode(SHADOW_CUBE); + // Increase the default shadow biases to better suit most scenes. + set_param(PARAM_SHADOW_BIAS, 0.1); + set_param(PARAM_SHADOW_NORMAL_BIAS, 2.0); } String SpotLight3D::get_configuration_warning() const { |