You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a LightOccluder2D or using the occlusion layer in a TileSet, the shadows will always be on top of whatever it's occluding. This has been known since Godot 3.x but what has changed in Godot 4.x is that you can no longer move the occluder behind its parent using "Show behind parent" nor is it affected by z-index, y-sorting, place in the node tree or any other setting i can find.
The first image here shows this trick being used in Godot 3.5.2 and on the right is the same project converted to Godot 4.0.3, where the "show behind parent" setting no longer affects the occluder and it always shows on top.
On this note I have not found any way to cast a shadow without also occluding the object casting the shadow in Godot 4.x short of using multiple duplicate lights and it feels like this is a big shortcoming of the new TileMap system (walls cannot cast shadows unless they are also casting shadows on themselves). I've exhausted the google search for this and come up empty handed and this bug is certainly not helping.
Steps to reproduce
Set a LightOccluder2D as a child of a Sprite2D.
Set the LightOccluder2D Light Mask to layer 1 and the Sprite2D Light Mask to layer 2
Set a Light2D with a mask of 1 and 2, enable Shadows and set the shadow mask to 1
Clicking on 'Show Behind Parent' on the LightOccluder2D would at this point hide it behind the sprite in Godot 3.5.2 but the setting does nothing in Godot 4.0.3
Included is the Godot 4.0.3 project from the image with all of these things set, including the occluder set to show behind parent.
Godot version
4.0.3
System information
Windows 10
Issue description
When using a LightOccluder2D or using the occlusion layer in a TileSet, the shadows will always be on top of whatever it's occluding. This has been known since Godot 3.x but what has changed in Godot 4.x is that you can no longer move the occluder behind its parent using "Show behind parent" nor is it affected by z-index, y-sorting, place in the node tree or any other setting i can find.
The first image here shows this trick being used in Godot 3.5.2 and on the right is the same project converted to Godot 4.0.3, where the "show behind parent" setting no longer affects the occluder and it always shows on top.
On this note I have not found any way to cast a shadow without also occluding the object casting the shadow in Godot 4.x short of using multiple duplicate lights and it feels like this is a big shortcoming of the new TileMap system (walls cannot cast shadows unless they are also casting shadows on themselves). I've exhausted the google search for this and come up empty handed and this bug is certainly not helping.
Steps to reproduce
Included is the Godot 4.0.3 project from the image with all of these things set, including the occluder set to show behind parent.
Minimal reproduction project
LightTest.zip
The text was updated successfully, but these errors were encountered: