# Enable image processing jagged

**URL:** <https://forum.babylonjs.com/t/enable-image-processing-jagged/41997>\
**Category:** Bugs\
**Tags:** postprocessing\
**Created:** [June 28, 2023, 2:46am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997 "2023-06-28T02:46:06Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![lxq100](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lxq100/32/43689_2.png) [@lxq100](https://forum.babylonjs.com/u/lxq100)\
**Post date:** [June 28, 2023, 2:46am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/1 "2023-06-28T02:46:06Z")

</div>

I have a scene PG  
The model with imageProcessing turned on has jagged teeth, which will seriously affect the display effect at present, and I hope to modify it.

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

---

<div class="post-metadata">

**Author:** ![11128](https://avatars.discourse-cdn.com/v4/letter/1/d07c76/32.png) [@11128](https://forum.babylonjs.com/u/11128)\
**Post date:** [June 28, 2023, 5:54am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/2 "2023-06-28T05:54:37Z")

</div>

This has more to do with Declare defaultPipeline than imageProcessing  
To avoid this to some extent, do

> defaultPipeline.fxaaEnabled = true;

---

<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:** [June 28, 2023, 8:27am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/3 "2023-06-28T08:27:32Z")

</div>

If aliasing is the problem, you can also enable MSAA: `defaultPipeline.samples = 4`.

---

<div class="post-metadata">

**Author:** ![lxq100](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lxq100/32/43689_2.png) [@lxq100](https://forum.babylonjs.com/u/lxq100)\
**Post date:** [June 29, 2023, 1:58am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/4 "2023-06-29T01:58:34Z")

</div>

> [@11128](#):
>
> .fxaaEnabled

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/1/11611b761d87b85c6ba1a48c4fbf3bb56409aa4f.jpeg)  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/b/4bb0e5a3760aa3d5e27aec9a90247070b7f824fb.jpeg)  
The switch is turned on by default, and the scene effect changes. What is the reason?  
how can remove

---

<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:** [June 29, 2023, 9:00am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/5 "2023-06-29T09:00:59Z")

</div>

That’s because when image processing is off, it renders directly into the canvas, which in the playground is configured to use antialiasing (so, MSAA is enabled).

When image processing is on, it uses additional render targets internally, and by default MSAA is off for these render targets. You can enable it by doing `defaultPipeline.samples = 4` (or any value up to `engine.getCaps().maxMSAASamples`).

---

<div class="post-metadata">

**Author:** ![lxq100](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lxq100/32/43689_2.png) [@lxq100](https://forum.babylonjs.com/u/lxq100)\
**Post date:** [July 5, 2023, 5:32am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/6 "2023-07-05T05:32:13Z")

</div>

> [@Evgeni\_Popov](#):
>
> any value up to `engine.getCaps().maxMSAASamples`

I need a PG to show how to remove.Thanks to you!

---

<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:** [July 5, 2023, 9:14am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/7 "2023-07-05T09:14:42Z")

</div>

To set max MSAA for the default render pipeline, do `defaultPipeline.samples = engine.getCaps().maxMSAASamples`.

If you want to disable MSAA, do `defaultPipeline.samples = 0`.

---

<div class="post-metadata">

**Author:** ![lxq100](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lxq100/32/43689_2.png) [@lxq100](https://forum.babylonjs.com/u/lxq100)\
**Post date:** [July 5, 2023, 9:33am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/8 "2023-07-05T09:33:04Z")

</div>

> [@Evgeni\_Popov](#):
>
> `defaultPipeline.samples = 0`.

What I want to ask is how to keep the effect after turning on the image post-processing instead of anti-aliasing

---

<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:** [July 5, 2023, 9:42am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/9 "2023-07-05T09:42:16Z")

</div>

Which effect do you mean?

---

<div class="post-metadata">

**Author:** ![lxq100](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lxq100/32/43689_2.png) [@lxq100](https://forum.babylonjs.com/u/lxq100)\
**Post date:** [July 5, 2023, 9:49am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/10 "2023-07-05T09:49:26Z")

</div>

image Processing

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

open

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/7/07136fe7d8be93be23a6ff49cbcc30cb874c072f.jpeg)  
close  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/a/ba8e5aa89b6ebb49ae450fd1d92a0784f4c393ee.jpeg)

---

<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:** [July 5, 2023, 10:27am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/11 "2023-07-05T10:27:30Z")

</div>

Is this not what you want?

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

---

<div class="post-metadata">

**Author:** ![lxq100](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lxq100/32/43689_2.png) [@lxq100](https://forum.babylonjs.com/u/lxq100)\
**Post date:** [July 5, 2023, 10:41am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/12 "2023-07-05T10:41:26Z")

</div>

Do not add a white mask when the image processing switch is enabled  
Thanks！

---

<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:** [July 5, 2023, 10:56am UTC](https://forum.babylonjs.com/t/enable-image-processing-jagged/41997/13 "2023-07-05T10:56:56Z")

</div>

That’s because the clear color must be converted to linear when using the default render pipeline:

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