Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light3D's cull does not affect shadows #70556

Open
Fabien2S opened this issue Dec 25, 2022 · 7 comments
Open

Light3D's cull does not affect shadows #70556

Fabien2S opened this issue Dec 25, 2022 · 7 comments

Comments

@Fabien2S
Copy link

Godot version

v4.0.beta10.mono.official [d0398f6]

System information

Windows 11

Issue description

The Cull Mask option in the Light 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.
image

Steps to reproduce

  1. Add a Plane to the scene with VisualInstance3D.layers sets to 2
  2. Add a Box to the scene with VisualInstance3D.layers sets to 1
  3. Add any type of 3D Light to the scene and uncheck layer 2 from Light.light_cull_mask
  4. Remark the lighting does not affect the Box, but still project its shadow

Minimal reproduction project

SampleProject.zip

@timothyqiu
Copy link
Member

Possible duplicate of #58322

@Calinou
Copy link
Member

Calinou commented Dec 26, 2022

Duplicate of #58322.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2022
@Fabien2S
Copy link
Author

Fabien2S commented Jan 17, 2023

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.

@akien-mga akien-mga reopened this Jan 17, 2023
@akien-mga akien-mga added this to the 4.0 milestone Jan 17, 2023
@clayjohn clayjohn added discussion and removed bug labels Jan 18, 2023
@clayjohn clayjohn modified the milestones: 4.0, 4.x Jan 18, 2023
@clayjohn
Copy link
Member

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.

@markusneg
Copy link
Contributor

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.

@lupuchard
Copy link

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.

@Calinou
Copy link
Member

Calinou commented May 7, 2024

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 godotengine/godot-proposals#3606, which has a pull request implementing it: #85338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants