Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Dec 15, 2025

Related issue: #32546

Description

Refactoring based on the improvements made in #32546, since a new RenderObject should not be created after changing the camera after test #32527.

@sunag sunag added this to the r183 milestone Dec 15, 2025
@github-actions
Copy link

github-actions bot commented Dec 15, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 355.17
84.44
355.17
84.44
+0 B
+0 B
WebGPU 618.17
171.68
618.14
171.68
-32 B
-3 B
WebGPU Nodes 616.78
171.43
616.75
171.43
-32 B
-3 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 487.34
119.31
487.34
119.31
+0 B
+0 B
WebGPU 688.81
187.1
688.77
187.1
-32 B
+0 B
WebGPU Nodes 638.65
174.3
638.62
174.29
-32 B
-9 B

@sunag sunag marked this pull request as ready for review December 15, 2025 03:30
@Mugen87
Copy link
Collaborator

Mugen87 commented Dec 15, 2025

There is one use case where the camera does indeed influence the structure of the shader which is multi-view rendering. However, this is global setting for XR and it's okay if the shaders recompile when entering XR or when leaving it. We just have to make sure the cache keys are different.

@sunag sunag merged commit 0eda195 into mrdoob:dev Dec 15, 2025
10 checks passed
@sunag sunag deleted the dev-ref-camera branch December 15, 2025 13:16
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