# Z-index of same meshes with different material

**URL:** <https://discourse.threejs.org/t/z-index-of-same-meshes-with-different-material/27326>\
**Category:** Questions\
**Tags:** materials, z-index\
**Created:** [June 18, 2021, 5:22am UTC](https://discourse.threejs.org/t/z-index-of-same-meshes-with-different-material/27326 "2021-06-18T05:22:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RAUMIK\_RANA](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/raumik_rana/32/12395_2.png) [@RAUMIK\_RANA](https://discourse.threejs.org/u/RAUMIK_RANA)\
**Post date:** [June 18, 2021, 5:22am UTC](https://discourse.threejs.org/t/z-index-of-same-meshes-with-different-material/27326/1 "2021-06-18T05:22:00Z")

</div>

I have to put same mesh with 2 material.  
I used below material for 2nd mesh. my main motto is to compare models with other same model with minor changes.

```javascript
new THREE.MeshBasicMaterial({
              vertexColors: false, transparent: true,
               precision:"highp",opacity: 0.45,
                polygonOffset: true, polygonOffsetFactor: -10,polygonOffsetUnits:-4 ,
                side: THREE.FrontSide, color: new THREE.Color('rgb(0, 0, 110)')
            });

```

It works fine. but when I zoom in weird result came

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

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [June 18, 2021, 9:02am UTC](https://discourse.threejs.org/t/z-index-of-same-meshes-with-different-material/27326/2 "2021-06-18T09:02:40Z")

</div>

> [@RAUMIK\_RANA](#):
>
> `precision:"highp"`

You can remove this bit since it likely has not effect on your issue. Try adding `depthWrite: false` to your configuration instead.

> [@RAUMIK\_RANA](#):
>
> `polygonOffsetFactor: -10,polygonOffsetUnits:-4 ,`

Start with `- 1` for `polygonOffsetFactor` and `1` for `polygonOffsetUnits`.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [June 18, 2021, 10:28am UTC](https://discourse.threejs.org/t/z-index-of-same-meshes-with-different-material/27326/4 "2021-06-18T10:28:18Z")

</div>

Without a debugging option, it’s hard to further investigate the issue. Try to replicate the glitch with a live example.
