Home Unity

Unity 5 - Standard Shader - Transparent issue- see 2min vid

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

  • cupsster
    Options
    Offline / Send Message
    cupsster polycounter lvl 11
    Try to restart unity and start from fresh project again. This is indeed strange.
  • Farfarer
    Options
    Offline / Send Message
    This is normal, sorting issues are very common for transparent meshes. Fade's a bit different because it z-primes, but as you can see it has a few other issues if you want bits of the mesh totally transparent.

    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.
  • Eric Chadwick
    Options
    Offline / Send Message
    I'm dealing with this for foliage models, because iOS runs very slow with alpha test, so I have to use alpha blend (fade).

    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.
  • jasonmousehand
    It is a common issue with transparent object, because the vertex doesnt sort the way you like it and there is no depth writing for transparent.
    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
Sign In or Register to comment.