summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-06-19 20:02:26 +0200
committerGitHub <noreply@github.com>2020-06-19 20:02:26 +0200
commitcb9d02a8d1b5bb71abcec6be0e75002c5ea656c4 (patch)
treeeb1e4062b39ec6c26d16c05076f74ebd6203425f
parentc857d77d84774b38b962a8642822a9e3c6522063 (diff)
parent971a0deeb6261ff2a66451b943746333e816a16d (diff)
Merge pull request #38932 from Calinou/increase-light3d-shadow-bias
Increase the default DirectionalLight3D and OmniLight3D shadow biases
-rw-r--r--scene/3d/light_3d.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp
index ef24676d69..9270b548b7 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 {