# Mesh is Jittering - ZFighting

**URL:** <https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997>\
**Category:** Questions\
**Tags:** documentation\
**Created:** [September 8, 2020, 11:03am UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997 "2020-09-08T11:03:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nipundavid](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nipundavid/32/8789_2.png) [@nipundavid](https://forum.babylonjs.com/u/nipundavid)\
**Post date:** [September 8, 2020, 11:03am UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/1 "2020-09-08T11:03:07Z")

</div>

Hi ,

I am using a revit file which I have converted into glb and then imported in my scene.

Apparently the model was beautiful when I loaded it in sandbox but it is jittering a lot in my project.

any idea what could be the reason?

![error](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/8/8e92082e1d89204dbd74ba73f4341b6699406ee9.png)

regards,  
Nipun David

---

<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:** [September 8, 2020, 11:15am UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/2 "2020-09-08T11:15:34Z")

</div>

It seems your are experiencing z-fighting but we would need a repro in the Playground to be able to find why.

---

<div class="post-metadata">

**Author:** ![nipundavid](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nipundavid/32/8789_2.png) [@nipundavid](https://forum.babylonjs.com/u/nipundavid)\
**Post date:** [September 8, 2020, 11:18am UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/3 "2020-09-08T11:18:57Z")

</div>

I tried that on playground on and it was working fine there as well

Playground URL - [https://playground.babylonjs.com/#CR09RC#4](https://playground.babylonjs.com/#CR09RC#4)  
the issue is somewhere in my scene setup or post processing i guess ? 🤔

regards,  
Nipun David

---

<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:** [September 8, 2020, 11:20am UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/4 "2020-09-08T11:20:58Z")

</div>

Hard to say.

Maybe you can provide a live link to your scene?

---

<div class="post-metadata">

**Author:** ![nipundavid](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nipundavid/32/8789_2.png) [@nipundavid](https://forum.babylonjs.com/u/nipundavid)\
**Post date:** [September 8, 2020, 12:03pm UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/5 "2020-09-08T12:03:01Z")

</div>

Here is a live link - SomeURL

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 8, 2020, 12:30pm UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/6 "2020-09-08T12:30:19Z")

</div>

It is definitely z-fighting. you can either solve by reducing between your camera minz and maxz to increase precision and if all meshes are at the exact same position (the model should be reviewed to prevent that) you could use the babylon z offset functionnality to force a draw order.

---

<div class="post-metadata">

**Author:** ![nipundavid](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nipundavid/32/8789_2.png) [@nipundavid](https://forum.babylonjs.com/u/nipundavid)\
**Post date:** [September 8, 2020, 1:03pm UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/7 "2020-09-08T13:03:05Z")

</div>

Thanks, can you share some working examples for z-offset API?

and one more thing. The camera rotation is really smooth in playground example but my camera rotations are not smooth - FYI i am using react-babylon

Playground example - [https://playground.babylonjs.com/#CR09RC#7](https://playground.babylonjs.com/#CR09RC#7)

Any thoughts on that?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 8, 2020, 1:39pm UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/8 "2020-09-08T13:39:17Z")

</div>

[https://playground.babylonjs.com/#CR09RC#8](https://playground.babylonjs.com/#CR09RC#8)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [September 8, 2020, 1:39pm UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/9 "2020-09-08T13:39:46Z")

</div>

adding @brianzinn for the react part 🙂

---

<div class="post-metadata">

**Author:** ![brianzinn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/brianzinn/32/28013_2.png) [@brianzinn](https://forum.babylonjs.com/u/brianzinn)\
**Post date:** [September 8, 2020, 2:33pm UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/10 "2020-09-08T14:33:37Z")

</div>

There is no difference between the playground and using `react-babylonjs` for camera. That library is only responsible for adding a camera to a scene. You may be doing something else when props change that is causing your frame rate to drop. For example, there is no createDefaultCameraOrLight or createDefaultEnvironment available declaratively, so if you were running that equivalent in a loop would cause something like that. You would need to share code for us to be able to help there - since playground doesn’t support React - you can create a sandbox - ie: [blissful-framework-br0hl - CodeSandbox](https://codesandbox.io/s/blissful-framework-br0hl).

---

<div class="post-metadata">

**Author:** ![nipundavid](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nipundavid/32/8789_2.png) [@nipundavid](https://forum.babylonjs.com/u/nipundavid)\
**Post date:** [September 8, 2020, 3:10pm UTC](https://forum.babylonjs.com/t/mesh-is-jittering-zfighting/13997/11 "2020-09-08T15:10:14Z")

</div>

Thanks, Okay will check with team and create a sandbox here

regards,  
Nipun David
