Open Fabien2S opened 1 year ago
Possible duplicate of #58322
Duplicate of https://github.com/godotengine/godot/issues/58322.
I have downloaded both beta12 and the project I originally uploaded and the lights are all still casting shadows even tho none of them are lighting up the cube.
I checked with beta11 (in which the PR #70638 got merged), same result.
Am I missing something? #58322 seems to be fixed.
This behaviour is the same in Godot 3.x and is even highlighted in the documentation:
Cull Mask: Objects that are in the selected layers below will be affected by this light. Note that objects disabled via this cull mask will still cast shadows. If you don't want disabled objects to cast shadows, adjust the cast_shadow property on the GeometryInstance to the desired value.
I'm not saying that the way it works now is the way that it should work, but its clearly currently working as intended, so this is not a bug per se.
This issue is different from bug #58322 which was about shadows not removed on an per-camera cull basis. Or more precisely: VisualInstances (VI) which were culled from a scene due to non-matching camera cull_mask and VI layers still left shadows in the scene. This issue, on the other hand, is about shadows of non-interacting lights and VI (due to non-matching light_cull_mask and VI layer). So no additional camera involved here. I know the docs announce this behavior but I still would call it a bug as it doesn't make sense, neither on a physical nor on an "intuitive" basis. Just as in #58322. To be honest, probably the docs were rather written around this behavior than the original implementation conformed to the docs.
This behaviour is the same in Godot 3.x and is even highlighted in the documentation:
Cull Mask: Objects that are in the selected layers below will be affected by this light. Note that objects disabled via this cull mask will still cast shadows. If you don't want disabled objects to cast shadows, adjust the cast_shadow property on the GeometryInstance to the desired value.
The documented solution doesn't work if you want an object to cast shadows for some light sources but not others.
The documented solution doesn't work if you want an object to cast shadows for some light sources but not others.
This is being tracked in https://github.com/godotengine/godot-proposals/issues/3606, which has a pull request implementing it: https://github.com/godotengine/godot/pull/85338
Godot version
v4.0.beta10.mono.official [d0398f62f]
System information
Windows 11
Issue description
The
Cull Mask
option in theLight
node does not affect/filter shadows.In the following screenshot, you can see that the
Box
(on visual layer 2) does not receives light (cull mask excluding layer 2), but still cast shadows.Steps to reproduce
VisualInstance3D.layers
sets to 2VisualInstance3D.layers
sets to 1Light.light_cull_mask
Minimal reproduction project
SampleProject.zip