Can someone refresh my memory as to why, when you import a maya object into Unity, parts of it are transparent when they shouldn’t be? I’m using the Alpha/Diffuse shader. The texture has an alpha channel where it should, but parts of the rest of the model are appearing transparent.
I’m pretty sure I don’t have overlapping UV’s and my object is all quads… am I missing something?
Ok, I found a solution to my problem. Originally my model was a number of polygon meshes ‘combined’ in Maya. I then applied a texture (which contains the alpha map for the transparent part) to that new mesh. That’s when I get the funky xray transparency (in both Maya using ‘High Quality Rendering’ in the opengl view and in Unity).
The solution was to separate out the transparent mesh part (windscreen) and apply the texture with the alpha for transparency to that piece alone. Then combine all the other mesh parts into a new mesh and apply the same color texture but this time with no alpha.
This viewed fine in Maya and loads and works as expected in Unity.
It is the same as the problem I mention above with the cube and sphere… use the same texture which contains alpha for both objects and you get weirdness.
This is a usual issue with partly transparent objects - you don’t get 100% correct depth sorting. The usual trick is to either separate them into fully opaque and transparent parts; or use a shader that does two passes - one for fully opaque parts (100% correct) and then partly transparent parts (not always correct, but at least opaque parts are correct) on top. Similar to VegetationTwoPass shader on the wiki.