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

BatchedMesh: Improve frustum culling performance #27219

Merged
merged 1 commit into from Nov 20, 2023

Conversation

gkjohnson
Copy link
Collaborator

@gkjohnson gkjohnson commented Nov 20, 2023

Related issue: #22376

Description

Adjusts the BatchedMesh frustum culling logic to use only the bounding sphere as Frustum.intersectsObject does (I missed this previously). This improves the time to perform frustum culling performance only by over 3x (sorting disabled). Between this and #27213 - the execution time of onBeforeRender can come down significantly from what was reported in #27202.

Before

~6.1ms

After

~1.9ms

@gkjohnson gkjohnson added this to the r159 milestone Nov 20, 2023
@gkjohnson gkjohnson marked this pull request as ready for review November 20, 2023 03:14
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
668.4 kB (165.9 kB) 668.3 kB (165.9 kB) -159 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
449.4 kB (108.9 kB) 449.4 kB (108.9 kB) +0 B

@Mugen87 Mugen87 merged commit 7551b23 into mrdoob:dev Nov 20, 2023
12 checks passed
@gkjohnson gkjohnson deleted the batched-frustum-cull-perf branch November 20, 2023 09:19
AdaRoseCannon pushed a commit to AdaRoseCannon/three.js that referenced this pull request Jan 15, 2024
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.

None yet

2 participants