summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorLetheed <letheed@users.noreply.github.com>2017-08-24 23:35:19 +0200
committerGitHub <noreply@github.com>2017-08-24 23:35:19 +0200
commit61d3fb36e8d3e573cf7e6a726229b28a0fca5130 (patch)
tree1203f52e10fea62db3bf4bc8a205507a9218738c /scene
parentf61e8695c9952928d19e6896bc412b638927b25c (diff)
Allow to disable shadow gradients in Light2D
Currently the shadow gradient can't be disabled and always has a minimum value of 1. I'm not sure why though, the default value seems to be 0 and the rasterizer checks for 0 [here](https://github.com/godotengine/godot/blob/8fc6bb8f771c520c15320c3b4be561abc648d65d/drivers/gles3/rasterizer_canvas_gles3.cpp#L1284) before enabling it. Feels like a bug to me, but if there's a reason for that let me know. As a side effect, this edit effectively changes the default value from 1 to 0 for new projects.
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/light_2d.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index 219574cbfd..a3c3d92404 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -434,7 +434,7 @@ void Light2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_enabled"), "set_shadow_enabled", "is_shadow_enabled");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "shadow_color"), "set_shadow_color", "get_shadow_color");
ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_buffer_size", PROPERTY_HINT_RANGE, "32,16384,1"), "set_shadow_buffer_size", "get_shadow_buffer_size");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_gradient_length", PROPERTY_HINT_RANGE, "1,4096,0.1"), "set_shadow_gradient_length", "get_shadow_gradient_length");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_gradient_length", PROPERTY_HINT_RANGE, "0,4096,0.1"), "set_shadow_gradient_length", "get_shadow_gradient_length");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_filter", PROPERTY_HINT_ENUM, "None,PCF3,PCF5,PCF9,PCF13"), "set_shadow_filter", "get_shadow_filter");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "shadow_filter_smooth", PROPERTY_HINT_RANGE, "0,64,0.1"), "set_shadow_smooth", "get_shadow_smooth");
ADD_PROPERTY(PropertyInfo(Variant::INT, "shadow_item_cull_mask", PROPERTY_HINT_LAYERS_2D_RENDER), "set_item_shadow_cull_mask", "get_item_shadow_cull_mask");