Skip to content

NodeMaterial: Make sure fog is applied only once. #31463

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

Merged
merged 4 commits into from
Jul 21, 2025
Merged

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jul 21, 2025

Fixes #31462

Description

Since fog() relies on output and there are assignments to output in NodeMaterial.setup(), there is a side-effect that leads to #31462. Using toStack() avoids the duplication.

@sunag There might be a better point for calling toSack() or even another solution but the PR in its current form at least fixes #31462.

Copy link

github-actions bot commented Jul 21, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.04
78.86
338.04
78.86
+0 B
+0 B
WebGPU 559.09
154.77
559.1
154.77
+10 B
+2 B
WebGPU Nodes 558.01
154.55
558.02
154.56
+10 B
+3 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.29
113.56
469.29
113.56
+0 B
+0 B
WebGPU 634.38
171.81
634.39
171.81
+10 B
+6 B
WebGPU Nodes 589.51
161.12
589.52
161.12
+10 B
+2 B

@sunag
Copy link
Collaborator

sunag commented Jul 21, 2025

It's all good to me 👍

@Mugen87 Mugen87 merged commit 74efc68 into mrdoob:dev Jul 21, 2025
9 checks passed
@Mugen87 Mugen87 added this to the r179 milestone Jul 21, 2025
@Mugen87 Mugen87 changed the title NodeMaterial: Fix fog. NodeMaterial: Make sure fog is applied only once. Jul 21, 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.

WebGPURenderer: Fog applied twice in all materials
2 participants