# What AA method does antialias = true use?

**URL:** <https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146>\
**Category:** Questions\
**Tags:** antialiasing, post-processing\
**Created:** [May 13, 2020, 7:07am UTC](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146 "2020-05-13T07:07:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [May 13, 2020, 7:07am UTC](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146/1 "2020-05-13T07:07:39Z")

</div>

When rendering directly to canvas, using `renderer.antialias = true;` gives you nice results. However, when rendering to a `WebGLRenderTarget`, you lose this built-in antialiasing mechanism.

My question is, what anti-aliasing approach does the browser use to achieve the built-in AA result? Is it supersampling somehow? I’m trying to re-create it with a post-processing pass, but [FXAA](https://threejs.org/examples/?q=aa#webgl_postprocessing_fxaa) doesn’t look as good, and a `MultisampleRenderTarget` [is only available in WebGL2](https://discourse.threejs.org/t/why-is-a-custom-fbo-not-antialiased/1329/3).

---

<div class="post-metadata">

**Author:** ![Fyrestar](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fyrestar/32/52793_2.png) [@Fyrestar](https://discourse.threejs.org/u/Fyrestar)\
**Post date:** [May 13, 2020, 7:28am UTC](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146/2 "2020-05-13T07:28:43Z")

</div>

> [@marquizzo](#):
>
> `MultisampleRenderTarget`

Basically just this, MSAA. The MultisampleRenderTarget makes it available for render targets as you see it on canvas without postprocessing. But it depends on the hardware and the settings.

FXAA is the best option for performance and quality still. Other AA techniques are more expensive but you can give them a try if FXAA doesn’t fit your needs.

> [@marquizzo](#):
>
> Is it supersampling somehow?

Yes, but actually no. MSAA is more efficient rendering subpixel only at edges of triangles but it also isn’t guaranteed that it will be applied, nor which level - it does look prettier but some of your users hardware might not provide it, and then there is no AA at all.

Supersampling will give you a flawless result with terrifying performance since you’re going to render at 4k for a regular 1080p screen.

FXAA is very cheap compared to all other options and also one for mobile. The example scene you linked also isn’t exactly the best case scenario, in actual scenes with less heavy contrast and diagonal edges it becomes much less visible.

---

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [May 14, 2020, 3:27am UTC](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146/3 "2020-05-14T03:27:14Z")

</div>

Thanks for your answer! I guess there’s no way for me to re-create the MSAA in WebGL1, so I’ll stick with FXAA for now.

I was wondering, is there a way to get higher quality with the shader code in the repo? I tried changing the `FXAA_QUALITY_PRESET` in line [84](https://github.com/mrdoob/three.js/blob/master/examples/jsm/shaders/FXAAShader.js#L84) from 12 to 39 as suggested [in the comments](https://github.com/mrdoob/three.js/blob/79edf22a345079dc6cf5d8c6ad38ee22e9edab3c/examples/jsm/shaders/FXAAShader.js#L223), but I got no noticeable visual improvement. I also saw in the notes that lots of quality features [only apply to 360, PS3 or PC](https://github.com/mrdoob/three.js/blob/79edf22a345079dc6cf5d8c6ad38ee22e9edab3c/examples/jsm/shaders/FXAAShader.js#L608)… is that talking about XBox 360 and PlayStation?

---

<div class="post-metadata">

**Author:** ![Kelle](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kelle](https://discourse.threejs.org/u/Kelle)\
**Post date:** [May 18, 2020, 11:13am UTC](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146/4 "2020-05-18T11:13:34Z")

</div>

Hi, sry if it’s a stupid question but -\> How did you find out that MSAA is the default AA-Method?

---

<div class="post-metadata">

**Author:** ![Fyrestar](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fyrestar/32/52793_2.png) [@Fyrestar](https://discourse.threejs.org/u/Fyrestar)\
**Post date:** [May 18, 2020, 11:45am UTC](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146/5 "2020-05-18T11:45:05Z")

</div>

I was reffering to MultisampleRenderTarget sorry, what the hardware does by default can be supersample or probably FXAA and others too (depending on the settings, but most GPUs support it and at least from my experience it is standard unless it’s bad onboard graphics or a notebook with nvidia suboptimus 😺 in these cases there is usually no AA at all.

If AA is important and you don’t want to rely on the client system it might be better to add it manually maybe as an option for the game or app, but getting no AA at all without high dpi screen can ruin it.

---

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [May 18, 2020, 7:44pm UTC](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146/6 "2020-05-18T19:44:26Z")

</div>

> [@Fyrestar](#):
>
> I was reffering to MultisampleRenderTarget

Ok, that was confusing. I thought [your answer to my original question](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146/2) was that `renderer.antialias = true` uses MSAA. We already knew `MultisampleRT` uses MSAA, it’s right there in the title 😄!

So just to clarify, `antialias = true` could give you a wide range of approaches depending on the graphics card?

---

<div class="post-metadata">

**Author:** ![Fyrestar](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fyrestar/32/52793_2.png) [@Fyrestar](https://discourse.threejs.org/u/Fyrestar)\
**Post date:** [May 19, 2020, 8:03am UTC](https://discourse.threejs.org/t/what-aa-method-does-antialias-true-use/15146/7 "2020-05-19T08:03:19Z")

</div>

Yes 😅 i had no sleep sorry, after quick reading thought you meant the MSRT for some reason.

> [@marquizzo](#):
>
> could give you a wide range of approaches

From the spec:

> antialias
> 
> If the value is true and the implementation supports antialiasing the drawing buffer will perform antialiasing using its choice of technique (multisample/supersample) and quality. If the value is false or the implementation does not support antialiasing, no antialiasing is performed.

Notebooks and office desktops are usually most critical in that regard, notebooks try to agressively save battery with optimus and other power options (disables gpu for browsers usually) and office machines (at least cheap or old ones) don’t come with a card or just poor or unsupported integrated graphics.
