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

Vulkan Mobile: SpotLight and OmniLight cull masks don't cull moving meshes #82263

Open
Tracked by #55871
LazyAlarm opened this issue Sep 24, 2023 · 0 comments · May be fixed by #86105
Open
Tracked by #55871

Vulkan Mobile: SpotLight and OmniLight cull masks don't cull moving meshes #82263

LazyAlarm opened this issue Sep 24, 2023 · 0 comments · May be fixed by #86105

Comments

@LazyAlarm
Copy link

Godot version

v4.1.1.stable.official[bd6af8e]

System information

Windows 10 - Godot 4.1.1 Stable - Mobile

Issue description

Both Omni lights and spotlights will light up a mesh that has been transformed, despite there being no overlapping layers. This does not appear to be a problem with the Forward+ Renderer nor with directional lights on the mobile renderer.

In this example I have two lights, one is set to affect all layers, the light is periodically toggled on and off,
another light is on all of the time, but it's cull mask is only set to affect layer 2, which neither of the Mesh Instances are on.
The expected behaviour is that when the first light is toggled, the cubes will no longer be visible,

Expected Behaviour

as works on the Forward+ renderer. However when using the mobile renderer, Meshes will reappear again if they are moved (via script) and will not disappear even if their movement is stopped.

Mobile Behaviour

I first noticed this behaviour when I was attempting to do an effect where all but one object would fade to black because it was the only mesh on a specific layer (which the spotlight cull was also set to) however other objects still appeared despite not being on that layer because they had been or were being moved.

Steps to reproduce

Start a project with the mobile renderer

Create a 3D scene with a mesh that can be moved.
image
image
image

Create a spot light or omni light near the mesh so that it is noticeably lit.
image

Set the Cull Mask of the light to only affect layers that do not overlap with the cube's VisualInstance3D layers
image

The cube will correctly not be lit by the spotlight upon first playing, but once the cube has been moved, it will suddenly be lit up.
GIF 2023-09-24 1-28-41 PM

Minimal reproduction project

Light Cull Mask Mini Project.zip

@Calinou Calinou changed the title Spotlight and OmniLight Cull Masks Don't Cull Moving Meshes in Mobile Renderer Vulkan Mobile: SpotLight and OmniLight cull masks don't cull moving meshes Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants