In this example three.js examples , MSAA is not supported. It seems we don’t have a AA solution for mrt.
WebGLMultisampleRenderTarget
is a way to handle AA in render target, the properties like .samples
,.useRenderbuffer
affect the render logic in WebGLRenderer
, but it doesn’t work in mrt.
Is there a way to support AA for MRT?
Yakuno
January 22, 2022, 5:22am
2
There is a few ways of doing it as mentioned in this issue: Antialiasing and MultipleRenderTargets · Issue #333 · vanruesc/postprocessing · GitHub
It seems that MSAA + MRT is possible “Yes, you can. All MRT draw targets must having matching sample counts,
but it’s otherwise fine.”
→ https://www.khronos.org/webgl/public-mailing-list/public_webgl/1609/msg00084.php
So the most pertinent way to apply antialiasing on MRT would be to support MSAA in threejs. I’ve been trying to do it without success so far, my output textures are not getting rendered or something:
Also, this StackOverflow might help to understand the way of doing it:
ios, swift, opengl-es
If anyone expert enough on that matter could guide us the way it would be awesome!
Just to bump, I’ve implemented this from scratch here: WebGL Multi-sampled MRT FBOs - CodeSandbox
and updated the issue on supporting this in three with my findings and design concerns: Multisampling over Multiple Render Target · Issue #23300 · mrdoob/three.js · GitHub .
2 Likes
Yakuno
July 5, 2022, 12:55am
4
Solved and merged in r141
mrdoob:dev
← RenaudRohlinger:mrt-msaa
opened 10:15AM - 03 May 22 UTC
Fixed #23300
**Description**
Added multisampling support for WebGLMultiple… RenderTargets.
Example (build is included in order to run the example):
<a href="https://raw.githack.com/RenaudRohlinger/three.js/mrt-msaa/examples/index.html#webgl2_multiple_rendertargets_multisampled" target="_blank">
<img src="https://user-images.githubusercontent.com/15867665/166488129-838daec4-5ba1-409e-822f-89de6114b458.png" />
</a>
*This contribution is funded by [Utsubo](http://utsubo.co/)*
2 Likes