ShaderMaterial - mixing up texture and texture array

There’s something strange going on with ShaderMaterial when using both a texture array and an individual texture.

This first playground uses just a texture array of red, blue and green texture, and work ok:
https://playground.babylonjs.com/#6NBTZ0

The second playground uses a texture array of red and blue, and an individual texture for green:
https://playground.babylonjs.com/#09U7H0

As you can see, there’s no green color, just blue and red.

The funky thing is, when switching the order of setTextureArray and setTexture, the result is again different, as you can see in the third playground. Now there’s no blue, but green takes over.

https://playground.babylonjs.com/#US7JUG

Is this a bug or am doing something wrong?

Thanks

Hello and welcome!
I’ll have a look asap to see what is going wrong

Ok bug found…Will be fixed by next nightly

Amazing thank you @Deltakosh for such a fast fix!

1 Like

Thank you for having found the bug;)

1 Like