diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-06-14 16:56:47 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-06-14 17:06:36 -0300 |
commit | 462d8ceb46e2ac8a6a503e58bec4c8af942a8bd9 (patch) | |
tree | c85e93d55fdb8c78ab1665f5d1f556bf3371b6d3 /scene | |
parent | 0a87979d2e414a18b6cca726fd82857162a92fea (diff) |
Fixed several bugs with directional light, and changed defaults to be more sensible.
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/light.cpp | 11 | ||||
-rw-r--r-- | scene/3d/light.h | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index b4a4cf70bb..9c87acec6e 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -234,7 +234,7 @@ void Light::_bind_methods() { BIND_CONSTANT(PARAM_SHADOW_SPLIT_3_OFFSET); BIND_CONSTANT(PARAM_SHADOW_NORMAL_BIAS); BIND_CONSTANT(PARAM_SHADOW_BIAS); - BIND_CONSTANT(PARAM_SHADOW_BIAS_SPLIT_SCALE); + BIND_CONSTANT(PARAM_MAX); } @@ -262,8 +262,7 @@ Light::Light(VisualServer::LightType p_type) { set_param(PARAM_SHADOW_SPLIT_2_OFFSET, 0.2); set_param(PARAM_SHADOW_SPLIT_3_OFFSET, 0.5); set_param(PARAM_SHADOW_NORMAL_BIAS, 0.0); - set_param(PARAM_SHADOW_BIAS, 0.); - set_param(PARAM_SHADOW_BIAS_SPLIT_SCALE, 0.1); + set_param(PARAM_SHADOW_BIAS, 0.15); } Light::Light() { @@ -318,7 +317,6 @@ void DirectionalLight::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_split_3", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_param", "get_param", PARAM_SHADOW_SPLIT_3_OFFSET); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "directional_shadow_blend_splits"), "set_blend_splits", "is_blend_splits_enabled"); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_normal_bias", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_SHADOW_NORMAL_BIAS); - ADD_PROPERTYI(PropertyInfo(Variant::REAL, "directional_shadow_bias_split_scale", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS_SPLIT_SCALE); BIND_CONSTANT(SHADOW_ORTHOGONAL); BIND_CONSTANT(SHADOW_PARALLEL_2_SPLITS); @@ -328,8 +326,11 @@ void DirectionalLight::_bind_methods() { DirectionalLight::DirectionalLight() : Light(VisualServer::LIGHT_DIRECTIONAL) { - set_param(PARAM_SHADOW_NORMAL_BIAS, 0.1); + set_param(PARAM_SHADOW_NORMAL_BIAS, 0.2); + set_param(PARAM_SHADOW_BIAS, 1.0); + set_param(PARAM_SHADOW_MAX_DISTANCE, 200); set_shadow_mode(SHADOW_PARALLEL_4_SPLITS); + blend_splits = false; } diff --git a/scene/3d/light.h b/scene/3d/light.h index c02f9d12d3..22ff5c0763 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -60,7 +60,6 @@ public: PARAM_SHADOW_SPLIT_3_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET, PARAM_SHADOW_NORMAL_BIAS = VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS, PARAM_SHADOW_BIAS = VS::LIGHT_PARAM_SHADOW_BIAS, - PARAM_SHADOW_BIAS_SPLIT_SCALE = VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE, PARAM_MAX = VS::LIGHT_PARAM_MAX }; |