Like the picture of this road, can not unity3d directly on the topography of this road map »how operation?
Another problem is in my 3 dsmax in the establishment of a terrain game objects, I can be converted to unity3d it in the terrain, can be drawn directly above the trees or plants?
No… from my experience and as far as I know Unity’s terrain engine cannot do anything as pixel perfect as those kinds of roads. The roads like you showed and from games like Crysis are done by projecting meshes onto the terrain with a slight offset and most likely forcing them to draw after the terrain so there’s no z-fighting. If you want a dirt path-ish type road or concrete that has grass or dirt up over the edges of it so there aren’t any straight and hard edges between the two, then that Unity’s terrain can do.
I believe that you can create any mesh from a 3D program and then apply the terrain shader to it. I haven’t tried this though and am not sure how the resulting texturing affects it, but I’d assume that it would end up being the same as a Unity generated terrain where even if you modeled in hard seams, the splat map that determines the texturing for the terrains will not give you the same resolution.
Are you talking about a script in Unity that makes the animation path follow the terrain makeing the road mesh from that? or are you manually makeing the animation path follow the terrain?
Sounds like a good idea either way.
I will be probably making an animation path in an external program (Lightwave) roughly follow the terrain, then extract a heightmap from that and incorporate it into the heightmap from Unity with a paint package, maybe using an alpha’d map on the edges and a decal shader to stop the depth fighting.
Hey, Forest, that’s pretty slick! I guess you do a few raycasts along a line perpendicular to the path at points along the path and then build the UVs to repeat the road texture?
Forest and I actually made the road mesh in Maya and created the terrain around it. The main trick is the lighting… the trick to doing that can be found in this thread.
Yeah we sort of made the mistake of starting before really thinking a lot about it, so we actually made the road mesh in maya and painted the terrain to fit it. A lot of painting, hehe.
What I was talking about was a script in Unity that does it all.
translates an animation path onto the surface of the terrain
generates a road mesh from the path.
sets the terrain heights around the road mesh so that they line up.
It would be a complicated script to make but surely it would be possible and very useful. However it doesn’t solve all problems: roads will be overlapped by terrain in low LOD areas.
hey guys i relise this post hasn’t been replyed to in a while, but on the road issue, how do stop your terrain mesh from poking through the road mesh, or z fighting i guess it is. I have tried applying the decal shader to it, but without any effect, if anything it made the z fighting worse.
But i guess the first question should be, at what height above the terrain should the mesh be placed .?
Seems like one way would be to use two cameras at different Depth Draw Orders and then use Culling Masks to draw only the terrain in one camera and the rest of the scene in the other camera. We’re creating a large scene with many cars, buildings and effects so I’m wondering what kind of performance cost there is to using two cameras like this?