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

Material: Add allowOverride. #30753

Merged
merged 2 commits into from
Mar 19, 2025
Merged

Material: Add allowOverride. #30753

merged 2 commits into from
Mar 19, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants