godotengine / godotengine/godot-docs
LightOccluder2D always occlude Sprite
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
**Godot Version 4.1.0**
**Issue Description:**
In an object with both a Sprite2D and a LightOccluder2D, the sprite itself is always occluded. The documentation states that this should be changeable based on its order in the scene hierarchy, yet I attempted every possible combination and always got the same, occluded result. (https://docs.godotengine.org/en/stable/tutorials/2d/2d_lights_and_shadows.html#occluder-draw-order).
I furthermore attempted to get the desired effect by fiddling around with the layer masks (occluder_light_mask, light_mask, range_item_cull_mask, shadow_item_cull_mask) yet I had no success with that either.

A related problem (which might be intended behaviour or actually just a symptom of this) is that shadows seem to be drawn at the highest z-level, as if the player (who casts a shadow) is behind an object, the shadow is still cast on top of that object, which is undesired.

Here, the shadow should be behind the large brazier, not in front of it. (Sorry if this is completely unrelated, I don't have a deep understanding of the subject matter)
The only way I got it to work is by setting `cull_mode = CounterClockWise` on the OccluderPolygon2D, yet this only work for convex shapes, which is also suboptimal.

Relevant Documentation: https://docs.godotengine.org/en/stable/tutorials/2d/2d_lights_and_shadows.html
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.