Wireframe for a terrain

I was wondering if someone knows if it’s possible to code a script that would display the wireframe of a terrain made using the terrain editor.

I tried to get to the renderer component of the terrain and it says that the terrain doesn’t have that component so I’m pretty stuck.

I wanted that too, when building terrain, but i found a workaround for that.

I used a grid texture on the terrain… you can calculate the needed grid size by synchronizing heightmap-size with texture-size. The result is very exact. So if you dont need the mesh to be transparent, it works pretty well that way.

Cool, how do you apply the texture to the terrain?

Just apply the grid texture as the first terrain-texture. Make your Texture just a square with a border and set its size to 1 in the terrain inspector.

Look at the terrain docs if you dont know how to add textures to the terrain-object at all.

I see, I was thinking more along the ways of doing it using a script, I need to be able to toggle between wire and textured.

Wireframe terrain rendering, among other goodies, is coming in a future Unity update.

Good to hear, can´t wait for an an update that will enable us to script the hell out of the terrain engine.