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

CanvasItem light_mask property is being ignored when self-shadowing is disabled via masks #91541

Open
Macksaur opened this issue May 3, 2024 · 0 comments

Comments

@Macksaur
Copy link
Contributor

Macksaur commented May 3, 2024

Tested versions

  • Reproducible in v4.3.dev [f91db3d]
  • Not Reproducible in v3.5.1.stable.official [6fed1ff]

System information

Windows 10 - Godot v4.3.dev [f91db3d] - Vulkan (Forward+)

Issue description

I've set up a scene with a PointLight, a ColorRect and a LightOccluder2D.

I've placed a ColorRect on separate layers from the LightOccluder2D. I expect that this would behave the same as in 3.x with the shadow appearing behind the object but the rect is instead being shadowed by the occluder despite all attempts at masking.

I've used rectangles to keep things simple but the idea here is that shadow is from the body of a character and the rect is the rendered 2D sprite. It is important that when this is replaced with art assets that the shadow doesn't have gaps or self-shadows the final art. So I've made the occluder smaller than the rect to make the problems immediately obvious.

image

The same scene in Godot v3.5.1.stable.official [6fed1ff] looks like the following and is the desired behaviour:
image

Steps to reproduce

I've quickly set up the scene like the following.

Everything is on layer 1 except the ColorRect, which is the only node on layer 2. The PointLight is configured to affect all layers. Its shadows however are only on layer 1.

image
image

image
image

and the point light is configured like so:
image

I expect that with this arrangement of masks that shadows should appear behind the rect and not ontop of it as they are now on separate layers each individually affected by a different combination. The rect should only be affected by the light (layer 2) and the background should be affected by the light and the shadow (layer 1).

Minimal reproduction project (MRP)

Here are the two MRP scenes, just drop them in a blank project of either 3.x or 4.x:
mrp scenes.zip

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

2 participants