GL and UGUI(world) Render order

In my game, i use gl to draw wireframe of building, but my ugui were covered by gl lines.
like this:


i try to change material render queue. but it is no use!

Depends on when you call your GL commands. Those draw immediately, so when you call the commands changes what they draw on top of. If you call the GL commands at the end of the frame it’ll render on top of all GUI since that’s already been drawn. You need to render it first with an opaque material at the start of the frame, or render them at the end of the opaque / beginning of the transparent passes. Unfortunately I don’t believe there are any easy to use events / functions that happen at the beginning of the frame after the render target has been set (they all happen before then), or in the middle of rendering. For that you need to use command buffers, but that doesn’t have a convenient GL.Begin(GL.LINES) equivalent. Instead you’ll need to construct a mesh with line topology and render that instead, either using the just mentioned command buffers or as a normal mesh renderer component.