Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Oct 1, 2025

Fixed #31966.

Description

#31966 exposed an issue in PassNode: If autoClear is set to false, the internal render target is never cleared which yields to different bugs in the backends. WebGL produces a persistent after image effect whereas WebGPU produces just a black texture.

The PR introduces the same behavior like in other FX passes by resetting the flag to its default value. We are not using RendererUtils.resetRendererState() though since most renderer settings should applied to PassNode as well.

If we don't want to force a clear, we would have to expose a PassNode.clear() method which I'm not sure is necessary at the moment.

@github-actions
Copy link

github-actions bot commented Oct 1, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.24
79.14
338.24
79.14
+0 B
+0 B
WebGPU 589.46
162.82
589.5
162.84
+43 B
+16 B
WebGPU Nodes 588.06
162.58
588.1
162.59
+43 B
+15 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.7
113.74
469.7
113.74
+0 B
+0 B
WebGPU 658.79
178.24
658.84
178.25
+43 B
+10 B
WebGPU Nodes 612.8
167.43
612.85
167.44
+43 B
+10 B

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Oct 1, 2025

@sunag The Inspector was already a help in debugging this issue! When looking in the Viewer tab, I've directly seen the black texture of the pass node. I've updated OutlineNode with some additional names to make the Inspector even more informative.

@mrdoob mrdoob added this to the r181 milestone Oct 1, 2025
@sunag
Copy link
Collaborator

sunag commented Oct 1, 2025

If we don't want to force a clear, we would have to expose a PassNode.clear() method which I'm not sure is necessary at the moment.

Maybe we can think of some other solution, the pass.clear() method in pass can be a problem since Node should be thought of as a flow, a chain of connections where the nodes are self-controlled, instead of a stack of call as it was previously.

The Inspector was already a help in debugging this issue! When looking in the Viewer tab, I've directly seen the black texture of the pass node. I've updated OutlineNode with some additional names to make the Inspector even more informative.

I'm glad to hear that :) I think the next step would be to create a tab for resources, to know how many textures, attributes, etc. were created.

@sunag sunag merged commit ec4c9b2 into mrdoob:dev Oct 1, 2025
9 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

Development

Successfully merging this pull request may close these issues.

WebGPURenderer&autoClear: Using renderer.autoClear = false yields a different effect.

3 participants