Godot Version
4.3
Question
I created an occlusion Layer for my TilemapLayer-Node.
The shadow works fine, but the barrel is no longer illuminated.
I read about a 2 Poinlight2D solution (one with shadow and one without),
but that sounds more like a work around.
There should be a cull-mode but i didn’t find that.
So… whats the solution?
This is a bug which is being worked on for a long time (it always gets postponed). The 2 pointlight-solution is the best we have for now i believe.
Here is the GitHub-Issue: CanvasItem light_mask is ignored by LightOccluder2D occluder_light_mask · Issue #64939 · godotengine/godot · GitHub
1 Like
Apparently last week someone managed to create a pr-request:
godotengine:master
← clayjohn:Light2D-shadow-mask
opened 05:24AM - 05 Nov 24 UTC
Fixes: https://github.com/godotengine/godot/issues/64939
Fixing this required… a small amount of refactoring to move some of the per-instance flags into a new per-batch flag. This was needed to free up the required 16 bits for the shadow mask. We do the actual masking on the CPU and then just store a binary value for whether that lights shadow impacts that CanvasItem. This saves instructions in the shader.
1 Like
After experimenting a bit, I believe the 2-light method provides the best results.
I think I’ll proceed with that.