Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

3D z-index

Discussion in 'General Graphics' started by molosev, Feb 26, 2015.

  1. molosev

    molosev

    Joined:
    May 24, 2014
    Posts:
    11
    Hi,

    I wonder if it is possible to draw a 3d object on the foreground even if it is actually behind an other object.
    I tried to mess around with layers, but no results...
    Any ideas ?



    Thanks
     
    Last edited: Feb 27, 2015
  2. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    2nd camera which clears only the depth buffer and then draws the objects on top using layers
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,627
    Another option could be to draw such objects with a shader that uses ZTest (eg. with GEqual), but it pretty much depends on your requirements. There are multiple options to achieve that effect, but one might work better than another depending on your setup.
     
  4. molosev

    molosev

    Joined:
    May 24, 2014
    Posts:
    11
    Thanks for your answers. I'll try both.