How to render Rectangle or Line Shapes on top of everything else?

Avatar
  • updated
  • Answered

Hello.

I'm using Shapes to display debug content in builds and I wonder how to render elements on top of everything else. I saw this post and I was wondering how to do it on Rectangles and Lines... Is there a secret trick here for that to happen?



Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Answered

it should work exactly the same as in that post!

if you're in component mode, you set it at the top, set depth test to "always"



if you're in immediate mode, you use:

Draw.ZTest = CompareFunction.Always;
Avatar
laurent victorino

Thanks for your reply and time.

And that's when I realized that I used an old version of Shapes. Sorry for the useless noise. And thanks for the help.

Avatar
Freya Holmér creator
  • Answer
  • Answered

it should work exactly the same as in that post!

if you're in component mode, you set it at the top, set depth test to "always"



if you're in immediate mode, you use:

Draw.ZTest = CompareFunction.Always;