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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Always render 3D object in front of everything, no matter its position

Discussion in 'General Graphics' started by UnMAnU, Feb 10, 2018.

  1. UnMAnU

    UnMAnU

    Joined:
    Oct 28, 2015
    Posts:
    13
    Hi!

    I was wondering if you could help me with this.

    I am doing a VR project that is kind of an interactive infography, with bullet points floating inside a big 3D object. The thing is I want the bullets to always be rendered, no matter what's in front of them, like if its z-index is just ignored by the renderer and always is rendered last, culled or not by other objects.

    Any ideas about how to accomplish this?

    Thanks in advance!

    Manuel
     
    dan_ginovker likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,419
    You can adjust the "Render Queue" in a material (or Shader code) to make Unity render these objects last. Additionally you need to adjust the Shader to render the object regardless of the depth buffer content (ZTest Always).

    This should make those objects to get rendered always.
     
    GameDeveloper1111 and APTEM59 like this.
  3. UnMAnU

    UnMAnU

    Joined:
    Oct 28, 2015
    Posts:
    13
    Thank you! Let me try that and I'll be back at you.
     
  4. UnMAnU

    UnMAnU

    Joined:
    Oct 28, 2015
    Posts:
    13
    Hi there! Excuse me, does this work with sprite renderers?
     
  5. UnMAnU

    UnMAnU

    Joined:
    Oct 28, 2015
    Posts:
    13
    I managed to do something that fits my needs, but by creating a new shader first, no chance of getting the render queue working with Unity's default sprite shaders...