# MRT supports antialiasing

**URL:** <https://discourse.threejs.org/t/mrt-supports-antialiasing/33215>\
**Category:** Questions\
**Tags:** mrt\
**Created:** [January 2, 2022, 4:58am UTC](https://discourse.threejs.org/t/mrt-supports-antialiasing/33215 "2022-01-02T04:58:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ligaofeng0901](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/ligaofeng0901/32/22617_2.png) [@ligaofeng0901](https://discourse.threejs.org/u/ligaofeng0901)\
**Post date:** [January 2, 2022, 4:58am UTC](https://discourse.threejs.org/t/mrt-supports-antialiasing/33215/1 "2022-01-02T04:58:42Z")

</div>

In this example [three.js examples](https://threejs.org/examples/?q=multiple#webgl2_multiple_rendertargets) , 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?

---

<div class="post-metadata">

**Author:** ![Yakuno](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/yakuno/32/23683_2.png) [@Yakuno](https://discourse.threejs.org/u/Yakuno)\
**Post date:** [January 22, 2022, 5:22am UTC](https://discourse.threejs.org/t/mrt-supports-antialiasing/33215/2 "2022-01-22T05:22:33Z")

</div>

There is a few ways of doing it as mentioned in this issue: [Antialiasing and MultipleRenderTargets · Issue #333 · vanruesc/postprocessing · GitHub](https://github.com/vanruesc/postprocessing/issues/333)

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](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:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/5/d/5dc3f9c63cac6c0c2a0be9649e0b97d2f63226aa.jpeg)

Also, this StackOverflow might help to understand the way of doing it:

> <https://stackoverflow.com/questions/39017450/combining-multiple-render-targets-mrt-with-multisampling-fails-on-ios-devices>

If anyone expert enough on that matter could guide us the way it would be awesome! 😄

---

<div class="post-metadata">

**Author:** ![CodyJasonBennett](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/codyjasonbennett/32/17442_2.png) [@CodyJasonBennett](https://discourse.threejs.org/u/CodyJasonBennett)\
**Post date:** [April 16, 2022, 3:45pm UTC](https://discourse.threejs.org/t/mrt-supports-antialiasing/33215/3 "2022-04-16T15:45:25Z")

</div>

Just to bump, I’ve implemented this from scratch here: [WebGL Multi-sampled MRT FBOs - CodeSandbox](https://codesandbox.io/s/webgl-multi-sampled-mrt-fbos-1vhkif)

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](https://github.com/mrdoob/three.js/issues/23300#issuecomment-1100666026).

---

<div class="post-metadata">

**Author:** ![Yakuno](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/yakuno/32/23683_2.png) [@Yakuno](https://discourse.threejs.org/u/Yakuno)\
**Post date:** [July 5, 2022, 12:55am UTC](https://discourse.threejs.org/t/mrt-supports-antialiasing/33215/4 "2022-07-05T00:55:54Z")

</div>

Solved and merged in r141

> <https://github.com/mrdoob/three.js/pull/24001>
>
> 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/)\*
