Skip to content

Box3: Use BatchedMesh bounds in precise mode. - #34863

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
gjija:fix/box3-batchedmesh-precise
Oct 7, 2026
Merged

Mugen87 merged 1 commit into
mrdoob:devfrom
gjija:fix/box3-batchedmesh-precise

Conversation

@gjija

@gjija gjija commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Related issue: None.

Description

Box3.setFromObject( batchedMesh, true ) reads the shared vertex buffer without applying instance transforms. For two boxes translated to x=10 and x=20, it returns x bounds [-1, 1] instead of [9, 21], missing the visible instances.

Use the existing conservative object bounds for BatchedMesh, as already done for InstancedMesh. Add a regression test covering two instance transforms and a world transform.

Validation: the new regression fails on unchanged dev and passes with the fix; npm test, npm run test-e2e-cov, build and ESLint on both changed files pass. The WebGL/WebGPU batch examples and the materials-array control pass with 0.0% screenshot difference on both baseline and fixed code in Ubuntu/Vulkan validation. On macOS, the materials-array control has an identical 0.2% difference before and after the fix. GPU-dependent addon unit cases were skipped where their backend was unavailable.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

📦 Bundle size

Full ESM build including core, minified and gzipped.

Before After Diff
Core 390.50
102.46
390.52
102.47
+22 B
+4 B
WebGL 776.58
193.95
776.60
193.95
+22 B
+5 B
WebGPU 1089.56
293.75
1089.58
293.76
+22 B
+5 B
WebGPU Nodes 1087.51
293.41
1087.53
293.42
+22 B
+4 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 518.11
124.50
518.13
124.50
+22 B
+5 B
WebGPU 769.27
206.22
769.29
206.23
+22 B
+5 B
WebGPU Nodes 716.52
192.99
716.54
193.00
+22 B
+4 B

@Mugen87 Mugen87 added this to the r187 milestone Oct 7, 2026
@Mugen87
Mugen87 marked this pull request as ready for review October 7, 2026 11:19
@Mugen87
Mugen87 merged commit 7c419dd into mrdoob:dev Oct 7, 2026
10 checks 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.

2 participants