Skip to content

Camera: Prevent setting non-uniform scale#33440

Draft
WestLangley wants to merge 1 commit intomrdoob:devfrom
WestLangley:dev-camera_uniform_scale
Draft

Camera: Prevent setting non-uniform scale#33440
WestLangley wants to merge 1 commit intomrdoob:devfrom
WestLangley:dev-camera_uniform_scale

Conversation

@WestLangley
Copy link
Copy Markdown
Collaborator

This PR prevents setting non-uniform scale in cameras.

Currently, this is just a draft for discussion.

@github-actions
Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 365.31
86.78
365.31
86.78
+0 B
+0 B
WebGPU 639.21
177.47
639.21
177.47
+0 B
+0 B
WebGPU Nodes 637.33
177.18
637.33
177.18
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 497.82
121.45
497.94
121.48
+117 B
+34 B
WebGPU 711.06
192.41
711.18
192.44
+117 B
+32 B
WebGPU Nodes 660.28
179.65
660.39
179.68
+117 B
+32 B

@Mugen87
Copy link
Copy Markdown
Collaborator

Mugen87 commented Apr 21, 2026

Related issue: #26659

Is this change required although #32805 is in place?

@WestLangley
Copy link
Copy Markdown
Collaborator Author

Is this change required although #32805 is in place?

TBH, since cameraMatrixWorldInverse is no longer guaranteed to be the inverse of cameraMatrixWorld, I am not sure.

For what use case is setting camera scale now required?

@Mugen87
Copy link
Copy Markdown
Collaborator

Mugen87 commented Apr 22, 2026

I can't think of a use case right now since normally if a camera is influenced by scaling, it's the scale from the world transform.

Could the PR updated so no (local) scaling is allowed?

@WestLangley
Copy link
Copy Markdown
Collaborator Author

Could the PR updated so no (local) scaling is allowed?

It can be, but I was thinking that would be overly-restrictive.

/ping @hybridherbst

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