Line rendering priority?

I wand to draw hexagons on my terrain. Currently, I have the linerenderer doing its thing, but the problem is, where the terrain is uneven, the lines pass through it, and then become obscured. Can I use a separate camera to render just the line renderer and make that render over top the terrain instead, so the lines obscure the terrain insted? Otherwise, I’ll have to increase the number of points in my hexagons set all of them to the height of the terrain where they are at, which is not really the way I want to go.

You should be able to do this by using a shader with depth testing off for the hexagons, and then assigning them to a camera that renders after the main camera.

Note that with this approach the lines will show through everything in the scene; there won’t be any occlusion. (I’m not sure how you would solve the problem you describe while still having the hexagon lines be properly occluded.)

Ok. So, maybe a line renderer isn’t the way to go about it. Is tehre an easy tutorial on procedurally creating meshes? Specifically, I’m wondering if I can just create a plane mesh that follows the contour of the terrain and use that as my hexagon outlines. I would need to draw a line from point a to point b, and using a resolution variable to determine the numebr of triangles per segment, I can control how accurately the line follows the terrain. I could do something similar with a line renderer, but I have discovered that the line renderer won’t just lay the line flat on the terrain. It appears to billboard.

There are some example projects demonstrating procedural mesh techniques in the ‘resources’ section of the Unity site.

Are you wanting the hexagons to be occluded correctly along with the rest of the terrain?

Yes, I do. I’m thinking I’m just going to have to suck it up and take the hit on overhead of just using planes as segments of line and lay them down on the terrain wherever I need the outlines drawn. The line renderer actually isn’t very good at all, apparently, because the lines seem to be billboarding. I need the lines to remain parallel to the ground regardless of where the camera is in relation to them.