Skip to content

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Mar 18, 2025

Fixed #30726.

Description

The PR introduces Material.allowOverride which controls whether the material can be overwritten by Scene.overrideMaterial or not. It is true by default.

With this new flag, the background textures and skyboxes are not affected by Scene.overrideMaterial, see #30726. If users render a scene with Scene.overrideMaterial e.g. to produce a normal pass, they must set the background to null. For a correct result, this was mandatory even before this PR but now the overall engine behavior is more consistent.

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.02
78.26
336.08
78.29
+65 B
+30 B
WebGPU 525.13
146.26
525.17
146.28
+41 B
+23 B
WebGPU Nodes 524.59
146.16
524.63
146.18
+41 B
+23 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.07
112.14
465.15
112.18
+87 B
+41 B
WebGPU 597.91
162.53
597.97
162.56
+63 B
+31 B
WebGPU Nodes 553.03
152.01
553.1
152.04
+63 B
+31 B

@sunag sunag added this to the r175 milestone Mar 18, 2025
@Mugen87 Mugen87 merged commit 58d5c51 into mrdoob:dev Mar 19, 2025
12 checks passed
repalash added a commit to repalash/three.js that referenced this pull request Jul 20, 2025
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.

A small square will appear threejs the background and overrideMaterial properties of the scene are set at the same time.
2 participants