- Home /
Do submeshes get sorted properly for transparent materials?
Some background: I'm procedurally generating a mesh, so this may come down to some low-level thing I'm doing incorrectly.
I have a mesh composed of about 12 submeshes, and 3 of these submeshes use a transparent material. I'm finding that the draw order of those 3 submeshes is incorrect. (In this case, when viewing from behind the whole mesh of a caped warrior in a kilt, the kilt is being drawn thru the cape. Both the cape and the kilt are using transparent materials.)
However, I've noticed that if I load the cape and kilt into separate meshes altogether, and merely place them at the exact same position, the draw order is correct. (The cape properly obscures the kilt, in the example above.)
So my first thought is to load all of the submeshes into their own meshes, and just have them all at the same position; however my next task involves procedurally generating animations for this mesh, and I don't know how having it all divided into separate meshes (as opposed to a single mesh with multiple submeshes) would affect my ability to set up bones and animations for this particular mesh.
My experiments are showing that submeshes don't seem to get properly sorted for drawing with transparent materials. Is this the case, or am I just missing some step?