I'm running into a weird z-sorting issue with the standards shader in Unity 5. I have a prop with transparency. When applied to the model in render mode cutout. Things look fine. When render mode is set to transparent, the model has sorting issues. I recorded a 2 minute video explaining and showing the problem. Any help or advice is welcome.
video link:
https://youtu.be/VLIJdMWfW7g
Thanks again.
Replies
Your best bet is keeping as few areas of your mesh transparent as possible. Use alpha-test (cutout) wherever you can get away with it, too.
If you can orient the surfaces to mostly overlap from the main viewing angle, then you can use a vertex-ordering trick to force the game engine to sort them in the order you want. Detach them, then reattach in back to front order.
Doesn't really help in your case though, since the two straw arms can be overlapping from different angles. As suggested, limit fade to only the arms, then see if any major artifacts get in the way.
for example, the head straw seems render AFTER the head, so it's on top of head, in alpha test or opaque object, the pixel of straw on top of the head would be blocked out by the head pixel even it's render AFTER the head, because head has its depth writing to depth buffer. without the depth, Unity has to draw any pixel on top of whatever that's already on screen.
there are few tricks to help with this situation:
1. Most importantly, separate the mesh that is opaque. You don't wanna render a whole character in transparent/alpha test just for a few straw. both for performance and the rendering issue reason
2. Like Eric said, you can also re-order the vertex to force the engine render it with the correct order. It's not a solution for this character, but it might work for your other characters.
3. For this particular character, I'll suggest to model those straw instead of make it with alpha blend. like the 1st suggestion, It's probably better in term of performance and remove the ordering issue