Skip to content

Minor Optimization to Occlusion Culling #107839

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rudolph-B
Copy link
Contributor

Minor performance improvement to occlusion culling as well as a partial fix for #106184 (I'm working on something more comprehensive).

The performance gain comes from swapping one version of Projection::xform for another that is inlined. The two functions aren't a 1-to-1 match, so a minor rework the logic was required. After further testing, I believe the issue of small objects self-occluding (as described by @JFonS in #52545) was fully resolved in #94210. I’ve therefore updated the logic to be less conservative, resulting in a small improvement in occlusion rate which can be seen in the video below. The test project is similar to the MRP in #106184. The camera is placed inside a box occluder, so ideally, everything should become occluded.

output.mp4

Regarding the performance improvements, I tested using occlusion_culling_mesh_lod. On my machine, it went from roughly ~1.2 ms/frame (~830 FPS) to ~1.05 ms/frame (~950 FPS). Since this project is specifically designed to be bottlenecked by occlusion culling, I also tested using the tps-demo. However, I wasn’t able to observe any noticeable performance improvement (~122 FPS before and after).

Godot v4.5.beta (b3d858f) - Ubuntu 24.04.2 LTS 24.04 on X11 - X11 display driver, Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 SUPER (nvidia; 550.144.03) - AMD Ryzen 7 3700X 8-Core Processor (16 threads) - 14.76 GiB memory

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

Successfully merging this pull request may close these issues.

2 participants