I'm making a game and need a little help with the transparency stuff. So, in the game I have one material that has a texture (a png image that contains transparent parts). The mashes are made out of planes, merged together and the planes shows parts of the texture (think about it like Minecraft). I can set the colors of each plane in the mesh with the colorKind vertexdata.. except the alpha part. So I tried to find some topics about it and saw somewhere a tip to set the hasVertexAlpha on the mesh to true and add the texture to the opacityTexture. That worked, now I can set the RGBA on any parts of the mesh but the rendering order goes wrong
Here's an image: the red and the green are one mesh (that has two planes, the green is above the blue), the blue is the other mesh. The green is half transparent using the colorKind alpha :
It's cool, this is the result I'm looking for!
But when I rotate the camera, the blue is displayed above the green.
And here is playground link to what I'm experiencing in the game:
So in short, I want to have a material with a diffuseTexture that has transparent parts and use the colorKind RGBA on every plane in every mesh.
What am I doing wrong and how can I fix it?
Thanks for the help!