how to render 3d line on top everything else in the scene?

i am using opengl to render a line, but unfortunatlly i am not able to draw the line on top of everything else. the point is that i am using line to point and mark clearly objects in the scene. but sometimes it happens that line goes through other objects and you dont know where the line points. so drawing on top of everything else i think should solve the problem.

just is it possible?

thanks.

1 Answer

1

You can render the line using a dedicated camera. Use .depth to control the order in which cameras render (i.e. render the line on top of -everything-), and .cullingMask to define what each camera renders (or not).

http://unity3d.com/support/documentation/ScriptReference/Camera-depth.html

http://unity3d.com/support/documentation/ScriptReference/Camera-cullingMask.html