Search Unity

SpriteRenderer over geometry?

Discussion in 'Shaders' started by Flag74, Jun 23, 2017.

  1. Flag74

    Flag74

    Joined:
    May 31, 2017
    Posts:
    128
    Hi,
    I'm working on a 3D game.
    I just need to have my sprite HUDs (small icons over characters) rendered after the geometry, without being clipped at all.
    I prefer to not use a second camera.

    Render queue and sorting layers seems to not having any effect. (maybe they are used for 2d only?)

    Tried also

    r.material.SetInt("_Zwrite", 0);
    r.material.SetInt("_Ztest", 0);

    I need help...
    thank you
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    If check with Frame Debugger, it shows ZTest is still used,
    upload_2017-6-23_21-13-7.png

    so if want to do it manually, add
    Code (CSharp):
    1. ZTest Off
    to the sprite shader:

    You can download built in shaders from
    https://unity3d.com/get-unity/download/archive (see dropdown for the shaders)
    upload_2017-6-23_21-27-58.png