Issue with NME and instances

Hello!

I am following the documentation about instances from here:

So I have created a very simple scene with some cubes using instances:

Then I have tried to apply a custom material that contains a texture to these instances, and following the docs I have made sure that the instance block is added on the vertex output calculation:

It seems pretty simple, but the scene is appearing with visual artifacts, so I am clearly missing something:

Can someone help me figure out what I am missing here? Thank you!

Looks like an alpha issue: https://playground.babylonjs.com/#WVWIUE#3 Assuming you do not need transparency, so I turned it off.

1 Like

Another way to disable transparency is to not connect something to the alpha component of the FragmentOutput block: when this channel is connected, the system assumes that the node material should be transparent, which disables the writing of the depth, leading to the artifacts you are experiencing.

1 Like

Thank you both! I wish I could mark both as answers as they both work :slight_smile:

1 Like