Skip to content

Faster section aabb test #3099

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: dev
Choose a base branch
from

Conversation

MoePus
Copy link
Contributor

@MoePus MoePus commented Apr 6, 2025

This PR precomputes section size into SimpleFrustum and skips far plane check to make it faster during RenderSectionManager.createTerrainRenderList
In Sparks time per tick mode createTerrainRenderList's time decreases from 10.75ms to 7.81ms and fps improves from 400 to about 500 when continuously moving mouse around with RD 40.
Reflection is used in this pr to access planes in FrustumIntersection

@douira
Copy link
Collaborator

douira commented Apr 6, 2025

I've measured the actual time it takes to perform the occlusion culling on an average test scene with and without this patch after plenty of warmup, averaged over 5000 samples, and over multiple runs.
dev: 1164µs
this patch: 1015µs
This comes out to an occlusion culling time reduction of around 12.8%. As a nitpick we might want to adjust some of the method's names but it looks good to me in principle and practice.

@douira douira added this to the Sodium 0.7 milestone May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants