summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlawnjelly <lawnjelly@gmail.com>2020-05-30 09:05:33 +0100
committerRĂ©mi Verschelde <rverschelde@gmail.com>2020-06-02 10:37:01 +0200
commit61b3eb3b28671a397ed873d47db925f662382e74 (patch)
treed4350344673dbc59c1fe7043c058c49b6830dfb3
parent07025e607dda2ab3b35bee65614347dc39f6f236 (diff)
Light2D shadow mask construction fix
When using the default setting (layer 1 set only) nothing is stored in the tscn file for a Light2D, hence it relies on the value in the constructor. The problem is the constructed value is 1 in Light2D, and -1 in RasterizerCanvas::Light. -1 results in all bits being set so all occluders are shown, rather than just those in layer 1. This PR changes Rasterizer::Canvas constructor to set to 1. An alternative is to have -1 as the value for layer 1 throughout. (cherry picked from commit bf54fa5a62a980f5c4339137f9e2c6147642962c)
-rw-r--r--servers/rendering/rasterizer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/rendering/rasterizer.h b/servers/rendering/rasterizer.h
index e0d4432fd5..026725bf01 100644
--- a/servers/rendering/rasterizer.h
+++ b/servers/rendering/rasterizer.h
@@ -814,7 +814,7 @@ public:
item_mask = 1;
scale = 1.0;
energy = 1.0;
- item_shadow_mask = -1;
+ item_shadow_mask = 1;
mode = RS::CANVAS_LIGHT_MODE_ADD;
// texture_cache = nullptr;
next_ptr = nullptr;