# Default pipeline AA disabled when applying MotionBlurPostProcess

**URL:** <https://forum.babylonjs.com/t/default-pipeline-aa-disabled-when-applying-motionblurpostprocess/36418>\
**Category:** Questions\
**Created:** [December 9, 2022, 7:50pm UTC](https://forum.babylonjs.com/t/default-pipeline-aa-disabled-when-applying-motionblurpostprocess/36418 "2022-12-09T19:50:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Higor\_Guimaraes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/higor_guimaraes/32/28611_2.png) [@Higor\_Guimaraes](https://forum.babylonjs.com/u/Higor_Guimaraes)\
**Post date:** [December 9, 2022, 7:50pm UTC](https://forum.babylonjs.com/t/default-pipeline-aa-disabled-when-applying-motionblurpostprocess/36418/1 "2022-12-09T19:50:36Z")

</div>

I’m using the default rendering pipeline with samples set to 4 and fxaa enabled and it looks good.  
But when I try to add a MotionBlurPostProcess it seems to be disabling AA for some reason.

Here’s the code:

```auto
    const pipeline = new DefaultRenderingPipeline(
      'defaultPipeline',
      true,
      this.scene,
      [this.camera],
    );
    pipeline.samples = 4;
    pipeline.fxaaEnabled = true;

    const mb = new MotionBlurPostProcess('mb', this.scene, 1.0, this.camera);
    mb.samples = 4; 

```

Is that expected behavior?  
I saw this other [thread](https://forum.babylonjs.com/t/msaa-disable-when-turn-on-other-postprocess-dynamically/26371/7) the recommendation to set the samples of the mb post process as well so that’s why I have it in there, it didn’t solve the issue for me.

I created this playground where we can see that happen if you uncomment the motion blur lines:

> **[Babylon.js Playground](https://playground.babylonjs.com/#Y3C0HQ%23880)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 9, 2022, 9:41pm UTC](https://forum.babylonjs.com/t/default-pipeline-aa-disabled-when-applying-motionblurpostprocess/36418/2 "2022-12-09T21:41:18Z")

</div>

Welcome aboard!

By default the motion blur post process is using the pre-pass renderer. You enable MSAA on the pre-pass renderer by doing `scene.enablePrePassRenderer().renderTargets[0].samples = 4;` but for some reason it does not work in your PG…

A workaround is to use the geometry buffer renderer instead (set the 10th parameter of the motion blur constructor to `true` to use it):

> **[Babylon.js Playground](https://playground.babylonjs.com/#Y3C0HQ%23883)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Higor\_Guimaraes](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/higor_guimaraes/32/28611_2.png) [@Higor\_Guimaraes](https://forum.babylonjs.com/u/Higor_Guimaraes)\
**Post date:** [December 16, 2022, 7:39pm UTC](https://forum.babylonjs.com/t/default-pipeline-aa-disabled-when-applying-motionblurpostprocess/36418/3 "2022-12-16T19:39:16Z")

</div>

Thank you @Evgeni_Popov ! Both enabling msaa on the pre pass renderer and using the geometry buffer for motion blur worked. Although I did have a slowdown on perfomance using the geometry buffer 🤔 .

I still have a few newbie questions if you wouldn’t mind answering:

1. Does the default rendering pipeline uses the geometry buffer? Is there/ do you think there will ever be a way to make it use the pre-pass renderer instead?  
2 - Is the issue happening because we can’t have some effect using the pre-pass renderer while other uses the geometry buffer at the same time? If so, is this a bug or intended behavior?  
3 - Is there a way to enable FXAA on the pre pass renderer? - I guess not from my research

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 17, 2022, 1:03pm UTC](https://forum.babylonjs.com/t/default-pipeline-aa-disabled-when-applying-motionblurpostprocess/36418/4 "2022-12-17T13:03:50Z")

</div>

> [@Higor\_Guimaraes](#):
>
> Although I did have a slowdown on perfomance using the geometry buffer

They are doing essentially the same thing, so I don’t think the perf should be too different… You can try to use [Spector.js](https://spector.babylonjs.com/) and see if something differs between both cases.

> [@Higor\_Guimaraes](#):
>
> Does the default rendering pipeline uses the geometry buffer? Is there/ do you think there will ever be a way to make it use the pre-pass renderer instead?

It does not use it because none of the effects managed by the default rendering pipeline is using it. Only a small subset of the post processes have a need for the pre-pass renderer/geometry buffer renderer: SSAO, SSR, Motion blur and I think that’s it.

> [@Higor\_Guimaraes](#):
>
> Is the issue happening because we can’t have some effect using the pre-pass renderer while other uses the geometry buffer at the same time? If so, is this a bug or intended behavior?

I think it’s a bug with the pre-pass renderer, we will investigate to find the reason why it is not working.

> [@Higor\_Guimaraes](#):
>
> Is there a way to enable FXAA on the pre pass renderer? - I guess not from my research

FXAA does not need the pre-pass renderer/geometry buffer renderer (see above the list of post processes that need to use the PPR/GBR).
