Search Unity

Question Renderering Relative to Camera

Discussion in 'UGUI & TextMesh Pro' started by renman3000, Feb 16, 2023.

  1. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    Hi there,
    Is there a setting that would get the TMPro material used to renderer like any 3D object? In other words if it is closer to the camera, it renders above any renderer behind it and vice versa?

    *including 3D mesh and Sprites.
    Thanks
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411
    do you mean world space text?

    like this,
    upload_2023-2-16_21-21-10.png
     
  3. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697
    Hi Sorry.
    I am not concerned about 3D renderers... just sprites.
    Perhaps I need to convert my "sprites" to 3D renderers?
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411
    if you put sprite sorting order -1, then its behind text, but of course not ideal...if they should be moving front and back.

    if you use AlphaTest shader queue in sprite shader and enable ZWrite On, then it works also. (but alpha gets bit broken)
    (transparent sprite shader doesn't write to depth, so cannot sort by depth i guess)
     
  5. renman3000

    renman3000

    Joined:
    Nov 7, 2011
    Posts:
    6,697

    Ok, so the easiest solution in my case, is probably not use Sprites.
    Thanks