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

Occlusion culling buffer is still updated when moving hidden OccluderInstance3Ds #70375

Open
Tracked by #70533
Calinou opened this issue Dec 20, 2022 · 0 comments
Open
Tracked by #70533

Comments

@Calinou
Copy link
Member

Calinou commented Dec 20, 2022

Related to #70373.

Godot version

4.0.beta9

System information

Fedora 36, Vulkan Forward Plus, AMD Radeon RX 6900 XT

Issue description

The occlusion culling buffer is still updated when moving hidden OccluderInstance3Ds. This could be avoided at least when the node itself is hidden, but also when one of its parents is hidden. This way, you wouldn't have to worry about moving nodes with OccluderInstance3D children while they're hidden (to avoid unnecessary BVH rebuilds, which take a significant amount of CPU time).

Using this approach of rotating the occluder without hiding it also doesn't resolve frametime spikes. They are certainly reduced, but still noticeable enough that it prevents getting perfectly smooth frametimes with V-Sync enabled. Overocclusion also occurs when doors open, due to the BVH taking a few frames to be fully updated.

Steps to reproduce

  • Create or download a 3D scene with geometry. You can use https://github.com/Calinou/game-maps-obj as a reference.
  • Enable occlusion culling in the project settings.
  • Add an OccluderInstance3D node and bake it to match the level geometry.
  • Add a second OccluderInstance3D node with a BoxOccluder shape.
  • Move the OccluderInstance3D node every frame with an AnimationPlayer or script.
  • Disable V-Sync to ensure you can reach the highest possible framerate on your hardware.
  • Measure framerate using the editor profiler, MangoHud, RTSS or similar.
  • Hide the OccluderInstance3D node. Notice how framerate fluctuations due to occlusion culling still occur.

Minimal reproduction project

occlusion_culling_mesh_lod_hidden_occluder_rotating.zip

Tap the F key to make the doors close and reopen continuously while V-Sync is disabled. Notice how framerate dips with occlusion culling enabled compared to occlusion culling disabled, even though the door's OccluderInstance3D node is hidden in this situation (you can check the remote scene tree to confirm this).

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