const renderer = new WebGPURenderer({antialias:true,forceWebGL:true})
const postProcessing = new PostProcessing(this.renderer);
const scenePass = pass(this.scene, this.camera);
postProcessing .outputNode = scenePass;
I couldn’t find an example on how to use MSAA anti aliasing when using post-processing and web GPU renderer
I think you just set .samples = something > 1 on the rendertarget, (or rendertargets in the context of postprocessing)
https://threejs.org/docs/#api/en/renderers/WebGLRenderTarget
Mugen87
February 18, 2025, 1:01pm
4
If you set antialias
to true
with WebGPURenderer
, this will affect post processing. There is also a separate samples
parameter that allows to define the sample count. It is 0
by default but when using antialias: true
, 4
is used.
Apart from that, there is an open issue that MSAA with PassNode
isn’t supported for the WebGL 2 backend yet. That is a know issue and a TODO on our list.
1 Like
It sounds like I can only use FXAA at the moment. When will the problem with WebGL MSA be resolved ?
Mugen87
February 19, 2025, 8:43am
7
You can choose between FXAA, SMAA and SSAA. There is also an experimental TRAA pass.
Sorry, I don’t know that.
This will be fixed with r178
via below PRs:
dev
← Mugen87:dev1
opened 08:17AM - 05 Jun 25 UTC
Fixed #30995.
**Description**
The PR tries to make the combination of MSAA… and MRT work for the WebGL backend.
Unfortunately, the combination only works for the first attachment so far. I don't understand why additional attachments are not properly blit although the WebGL backend uses the same approach like in `WebGLRenderer`. The problem can be reproduced with below example (it always runs with the WebGL backend for testing).
https://rawcdn.githack.com/Mugen87/three.js/c4d55169b9dc56732cf43e5143cd31226a6d5c8e/examples/webgpu_mrt.html
The expected result looks like so: https://threejs.org/examples/webgpu_mrt
@RenaudRohlinger Since you have implemented the initial support in `WebGLRenderer`, did you ever encounter such a problem?
@cabanier I do not see any WebGL warnings in the browser console but do you see an obvious flaw in the framebuffer setup? I'm a bit out of ideas at the moment why the blit works partially but without reporting errors. A fresh pair of eyes would help^^.
The PR only implements the resolve. The setup of MSAA render buffers for each attachment has already been implemented by #27473.
https://github.com/mrdoob/three.js/blob/c7b6f81b608cbbb2b729f67b110dac50e82d96da/src/renderers/webgl-fallback/WebGLBackend.js#L2236-L2295
dev
← Mugen87:dev1
opened 09:32AM - 03 Jun 25 UTC
Related issue: #30995
**Description**
This PR is one step towards full MSA… A support for RTT with the WebGL backend of `WebGPURenderer`.
The depth and stencil data were never honored during the blit operation so far. That explains why examples like `webgpu_custom_fog_background` failed with `PassNode` using MSAA since `getViewZNode()` or `getLinearDepthNode()` returned nodes operating on empty buffers.
The WebGL backend uses the same approach like in `WebGLRenderer` to avoid this issue:
https://github.com/mrdoob/three.js/blob/c0854e60011c3af69488a84a95d59b2353691435/src/renderers/webgl/WebGLTextures.js#L2137-L2145
/cc @cabanier
2 Likes