I've already my roads most of the time hovering above the terrain but still sometimes the terrain temporarily "shines" through depending on distance and view angle. I guess it's due the terrain's LOD, so some polys might become higher than intended on some LOD levels.
In Virtools there is something called "Render Priority": a per-object settings that can be adjusted in the hierarchy manager. It can help for these kind of situations. I was looking for something similar in Unity. The editor itself doesn't seem to have anything related but the shader framework, called ShaderLab, itself has.
So you have to download the built-in shader sources, and create a derivate. First I thought it's the SubShader RenderQueue-Tag, but that didn't had any visual impact. You have to adjust/bias the z/depth buffer value via the Offset state.
In my case I went through the "diffuse" shader and added an "Offset -1,-1" to any spot where RenderStates where set. Like you can see from the image above, it helped a lot. Unfortunately it's not perfect, I am still having tiny but annoying cracks here and there when driving or flying along the roads:
I guess I've no choice and adjust further the terrain heights manually to get rid of them…











[...] Rendering Roads on Top of Terrain with Unity3D Share and Enjoy: [...]
Pingback by Unity 3D Procedural Content Generation Roundup diamondTearz’s Flex, Flash, iPhone & Unity3D Blog — Wednesday, 22nd July, 2009 @ 04:45
Comment by chaiwa berian — Friday, 31st July, 2009 @ 04:34
[...] Rendering Roads on-áTop of-áTerrain with Unity3D [...]
Pingback by Precedural Content Generation in Unity3D — Tuesday, 10th November, 2009 @ 03:40
Comment by chaiwa — Wednesday, 30th December, 2009 @ 09:46
Comment by 3d renderings — Monday, 18th January, 2010 @ 03:23
[...] Rendering Roads on Top of Terrain with Unity3D [...]
Pingback by Procedural Content Generation in Unity3D — Wednesday, 17th February, 2010 @ 04:52
[...] Rendering Roads on Top of Terrain with Unity3D [...]
Pingback by Procedural Content Generation in Unity3D » Infinite Unity3D — Sunday, 28th February, 2010 @ 10:40