# NodeMaterial alpha order problem

**URL:** <https://forum.babylonjs.com/t/nodematerial-alpha-order-problem/33169>\
**Category:** Bugs\
**Tags:** material\
**Created:** [August 18, 2022, 4:06pm UTC](https://forum.babylonjs.com/t/nodematerial-alpha-order-problem/33169 "2022-08-18T16:06:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterimg](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@peterimg](https://forum.babylonjs.com/u/peterimg)\
**Post date:** [August 18, 2022, 4:06pm UTC](https://forum.babylonjs.com/t/nodematerial-alpha-order-problem/33169/1 "2022-08-18T16:06:53Z")

</div>

Hi

I also some time a go created this ticket:

> [@NodeMaterial alpha makes Mesh see through](https://forum.babylonjs.com/t/nodematerial-alpha-makes-mesh-see-through/15329):
>
> I used a shader to make an alpha cut out and when I use alpha in this way as in my PG, this makes mesh error that you can see polygons that are obscured behind it. Without “needDepthPrePass” this error is purely visible, but I’m losing the alpha cut out of a mesh that I’m after. And this cut out approach make quite a performance hit on my scenes. My Questions: Am I making this in a good way, the alpha cut out? Or is there a better and lighter on performance way to do it? the…

I think this is not fully sorted and I have a similar problem again. I made a small Playground to demonstrate the issue.

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

I got this as a result:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/9/c93f9db6da7a0f1c14091756fe0c9ab35aa96105.png)

But I expect this to look like this:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/8/b/8bf5fb16d45e5928537bc89d1fc1516e75bdbd7d.png)

I got issues with NodeMaterials that use alpha on the FragmentOutput and textures that have alpha channels in NodeMaterials. Cant add the proper options to meshes and materials to make them work together. Always entire mesh is in front of another. Surprisingly I do have a situation with a model that during rotation with the ArcRotateCamera is switching the order of just the alpha transparent meshes. At some angles, the one that is behind is purely above the other.

I tried everything you got in the docs and nothing works for me. Also this magical fix all thing from version 5:

```auto
scene.useOrderIndependentTransparency = true;

```

Can you help me to achieve the desired effect?

Regards  
Peter

---

<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:** [August 18, 2022, 5:43pm UTC](https://forum.babylonjs.com/t/nodematerial-alpha-order-problem/33169/2 "2022-08-18T17:43:02Z")

</div>

this is not a NME issue but a general 3d issue.

It is not possible to do what you want ☹ basically you need to split the mesh going through the ground in 2 to achieve it as they can not be rendered at the same time 🙂

basically aside of techniques like OIT there is no way to have order independent transparency 🙂
