Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity 5 - Transparent rendering mode problem

Discussion in 'General Graphics' started by HarpSeal1, Mar 5, 2015.

  1. HarpSeal1

    HarpSeal1

    Joined:
    Oct 23, 2013
    Posts:
    35
    Hello everyone!
    When I set my material's rendering mode to Transparent, it is completely invisible no matter what alpha settings i use in Albedo. This started happening since RC3. Any ideas on how I should troubleshoot it? I am running the public release of unity 5.
    Thanks!
     
  2. varfare

    varfare

    Joined:
    Feb 12, 2013
    Posts:
    227
    Do you have any underlying object that use custom shaders? Maybe your transparent object is rendering but other objects are being renderer on top of it?
     
  3. HarpSeal1

    HarpSeal1

    Joined:
    Oct 23, 2013
    Posts:
    35
    Hi Varfare, I appreciate your reply! I don't have any custom shaders in use, but I did use the FX/Glass/Stained BumpDistort at one point.
     
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    The cause of this is usually that the mesh is combined with something else or the origin of the mesh is far off the visible parts and the render order with other transparent objects becomes unfortunate.
     
  5. HarpSeal1

    HarpSeal1

    Joined:
    Oct 23, 2013
    Posts:
    35
    Thanks for your input Dantus! I tried creating a cube at (0,0,0) and applying a new material to troubleshoot, the cube will go fully transparent :/ . I noticed this started happening in this level after a GI bake completed. I did try clearing the cache, no change. I also tried a rebake, no change. It is a very interesting problem!
     
  6. varfare

    varfare

    Joined:
    Feb 12, 2013
    Posts:
    227
    So applying transparency to the object in new, blank scene works? Does this happen only in this praticular scene?
     
  7. HarpSeal1

    HarpSeal1

    Joined:
    Oct 23, 2013
    Posts:
    35
    I just tried applied transparency to a cube in a new blank scene, it works! In the "broken scene" I also noticed the wireframe isn't rendering correctly when the selected object has transparency, see attached screenshot. The broken scene is also quite large with a lot of geometry. Thanks for all your help!
     

    Attached Files:

  8. Harold_83

    Harold_83

    Joined:
    Nov 25, 2014
    Posts:
    44
    I think I am having the same issue. I even tried putting in a new scene and no fix. I keep getting a little transparency on the trashcan. On the train it is really bad as you can see in the image. the doors and the skeleton of the train are the same value on the alpha but the walls and parts of the train still are see through. Also i toggled with those texture import settings and no change.
     

    Attached Files:

  9. HarpSeal1

    HarpSeal1

    Joined:
    Oct 23, 2013
    Posts:
    35
    I think its a different issue, but whats your material's rendering mode set to? It might be set to transparent or fade, make sure its opaque.
     
  10. Foj

    Foj

    Joined:
    Apr 11, 2013
    Posts:
    17
    Isn't this the same old transparency sorting issue? It's disappointing to find it still exists in 5, and very frustrating when doing characters - which I am, and having the sorting issue.
    I notice in the manual for the new shaders it's suggests cut-out is used (which has always sorted), and to reserve transparency for material like glass. Intriguingly there is an image of a character with a helmet with glass-visor in the manual - it would be good to know a best-policy pipeline for working with transparency, particularly for characters - I just set the eyelashes to transparent and the model turns in to a horror show!
    Has anyone seen a good tutorial for artists in respect to this?
    Hope this is the same issue as you guys are having, z-sorting transparency, looks like it to me (Unity takes the centre of the mesh and it's distance to the camera for the draw priority order - I think).
     
  11. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    This is not a Unity problem, it is a realtime application issue. It exists in all realtime 3d applications I have used.

    You basically answered your question with the next sentence. Make sure that the center of the transparent meshes is correctly placed and that you split them up. E.g. if you have eye lashes, make sure each of them has their own mesh and make sure the origin of the them is set correctly where the actual mesh is. Like that the draw order will automatically be correct, unless if you have overlapping transparent meshes which is always tricky.

     
    Foj likes this.
  12. Foj

    Foj

    Joined:
    Apr 11, 2013
    Posts:
    17
    Thank you Dantus.

    Does anyone know how Unity (5) gets the centre of the mesh, in order to calculate the distance to camera for transparency sorting - it seems to me it is not using the pivot position?
     
  13. Harold_83

    Harold_83

    Joined:
    Nov 25, 2014
    Posts:
    44
    Thank you for your response but before I posted, I played with all the render mode settings and still no fix
     
  14. Harold_83

    Harold_83

    Joined:
    Nov 25, 2014
    Posts:
    44
    Also I want to let you know where it says opaque. The widows suppose to be transparent, they just look like it. I am no the artirst responsible for texturing the train but I noticed this to be an issue with transparency not working properly.
     
  15. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
    I've seen a different case on Unity5. I've written a transparent shader, then make a material and apply to a sphere.
    To my surprise, the sphere doesn't appear in the game-mode, and disappear in edit-mode under certain angle.
    I've tried to switch from Unity5.2 to Unity5.1, but the problem persisted.

    And at last, I deleted the material ( not the shader ) and recreate it again (apply the same shader), this time it works normally.
     
  16. Oogar

    Oogar

    Joined:
    Oct 23, 2018
    Posts:
    1
    I met with the same problem After shift it from legacy shader , And at last I solve this problem with a new material ...