I have exported the obj from magica voxel and when I imported it into unity it worked fine. I am now wanting to make the object fade out while another fades in. The moment I set the texture to transparent it starts rendering weird. If any textures overlap the one in the front either doesn’t render or the one behind is rendering in front of the other one.
I think this has something to do with the way MagicaVoxel outputs its models. Instead of doing what I think other voxel modelling programs do (such as the more expensive ones), which is carefully change UV’s and such of faces so that multiple colors can be used and spread over the proper UV to “look” like voxels but really just be pixels (that probably barely makes sense haha), which instead it seems MagicaVoxel outputs models broken into chunks (polygons) containing the areas of a certain color, and uses solid colored rendering instead of pixel/uv based rendering to “paint” those voxels. There isn’t necessarily anything wrong, but it does increase the overall number of vertices, and faces on the final model. But obviously you have discovered another drawback
.
This means, there are lots of faces/groups of polygons that are not connected to a mesh as a whole, but as separate like “objects” of their own, and because of this it causes problems if you try and do transparency with them. This is kind of just a drawback to the way the program outputs its models and textures… it really does it in a way that is simple and quick to edit/render, but not honestly something you could easily change (unless you want to tear into its source code!) for a quick fix.
Anyway, that’s all just based on having used MV a few times, and noticed those things going on with the output it creates! I could be wrong about some stuff.
First of all: Models exported from MV are UV mapped. They use a single bitmap texture which is the palette that was used for the object inside MV and then each quad is mapped to one pixel of the bitmap.
Secondly, the problem you describe is well-known: So far it apparently has not been possible for consumer-level graphic chips to correctly handle z-ordering of transparent surfaces on a single mesh. This has nothing to do with Unity, it’s just a technical limitation. One way to overcome this is to make sure that only overlapping transparent surfaces are on sperate GameObject to ensure they are z-sorted correctly. Of course, this is probably out of the question for your model. So, I would actually say that you will not be able to achieve what you are trying to and instead settle for an alternative effect.