Skip to content

Faster section aabb test#3099

Merged
IMS212 merged 1 commit intoCaffeineMC:devfrom
MoePus:faster-section-abb-test
Feb 19, 2026
Merged

Faster section aabb test#3099
IMS212 merged 1 commit intoCaffeineMC:devfrom
MoePus:faster-section-abb-test

Conversation

@MoePus
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
@douira douira modified the milestones: Sodium 0.8.1, Upcoming Minor Dec 17, 2025
@douira douira requested a review from jellysquid3 January 11, 2026 20:50
@douira
Copy link
Copy Markdown
Contributor

douira commented Feb 2, 2026

I'm interested in finally merging this, but there's a minor merge conflict. Also, would it be possible to use a (mixin) Accessor instead of reflection?

@MoePus MoePus force-pushed the faster-section-abb-test branch from 90dafcd to a4c630a Compare February 2, 2026 13:46
@douira douira modified the milestones: Upcoming Minor, Sodium 0.8.5 Feb 8, 2026
@IMS212 IMS212 merged commit b2b8a88 into CaffeineMC:dev Feb 19, 2026
1 check passed
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.

3 participants