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: Lights with energy 0 are not culled from rendering #56633

Open
Calinou opened this issue Jan 8, 2022 · 0 comments
Open

Vulkan: Lights with energy 0 are not culled from rendering #56633

Calinou opened this issue Jan 8, 2022 · 0 comments

Comments

@Calinou
Copy link
Member

Calinou commented Jan 8, 2022

master version of #56632. I'm opening a separate issue as this needs to be implemented separately from 3.x.

Godot version

4.0.dev (8f6cba3)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

Issue description

Lights with energy set to 0 are not culled from rendering. This means performance won't improve when you set a light's energy to 0. Instead, you need to set the light's visible property to false. This can lead to unexpectedly low performance when animating lights in and out using an AnimationPlayer.

Lights energy = 1

2022-01-08_23 42 54

Lights energy = 0

Look at the FPS counter in the top-left corner and compare with the above screenshot:

2022-01-08_23 42 59

Steps to reproduce

  • Add any kind of 3D light node.
  • Set its Energy property to 0.
  • Notice performance will be the same as if Energy was set to 1.

Minimal reproduction project

test_light_hide_master.zip

The MRP has 1 DirectionalLight with shadows enabled, 6 red OmniLights with shadows enabled and 6 green SpotLights with shadows enabled.

  • D: Toggle DirectionalLight's visible property.
  • O: Toggle OmniLights' visible property.
  • S: Toggle SpotLights' visible property.
  • E: Toggle all lights' energy property between 1.0 and 0.0.
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