Texturing Roads over terrain

Started by
6 comments, last by Arelius 15 years, 4 months ago
Hi all, this is more of a theory question, but Im just trying to understand the right approaches. Imagine you have a terrain mesh, with bumps and hills, etc. And you want to draw a concrete road on it. Do you actually just apply a concrete texture onto the terrain mesh? Or do you overlay a new "road" mesh thats essentially flat against the lower terrain, then texture that as concrete? To go a step further, what about generating an entire city on a terrain? For example games such as GTA IV? Surely each road must actually be another mesh overlayed onto the terrain right? So the problem is, if you texture a terrain with some concrete strip texture, how do you simulate something like a kerb? For that matter, how do you texture over the entire terrain in grass, but a specific line (that crosses multiple triangles) with concrete? On the flip side, if you overlay a mesh onto the grid, you're dramatically increasing your triangle count right? Which has got to be bad. My feeling is, to draw a straight road across a terrain, create 4 vertices, that form a rectangle, flat ontop of the terrain, and texture it. Edit: Just to add to this. Another problem I see with drawing a new mesh overlay is that the underlying terrain isnt flat. If a road continues over a hill, the overlay mesh suddenly become alot more complex, including more vertices, more triangles, etc, to mould to the terrain. Gratefuly for any response and thought to this. Regards Luca
Advertisement
So many views, and noone has an opinion on this?
I will be dealing with this too, so I may share some thoughts.
For trails and rough roads it will be just the applied texture. For the concrete road I reckon I will be doing both - baking the road texture, that will do in distance, but generating mesh for road&curb dynamically so that it has all the detail near the camera.

I have procedurally generated terrain, and I plan to employ multiple passes during creation of tile mesh and texture. One pass will modify the underlying heightfield to level it under the road and to remove features that would otherwise poke through. The pass that generates tile texture will bake in the road texture, etc.

This will work for cities too, but entire terrain tiles there won't have to be rendered since they will be often completely covered (after the leveling).
It's always worth looking at the Virtual Terrain Project whenever you have any terrain related problems.
I think it really depends on whether you want to create the roads procedurally from some sort of input data or game logic or whatever, or if you want the road to be modelled beforehand.
In the case of GTA IV, which you took as an example, I really doubt they overlay the roads over a terrain. That would be pretty wasteful and they don't need the roads to be generated procedurally or to be dynamic in any way, which means they can be modelled by an artist completely. My guess would be that they start by modelling the roads and fill in the gaps with whatever they need there.
For procedural roads I'd probably create a flat model (following the elevation etc of the terrain) with skirts downward on the outside edges. That way you can put the roads high enough above the terrain to avoid Z-fighting and still won't have seams that are too obvious.
my suggestion is to create a procedural road, that is a mesh. crysis uses this idea.

these 2 vids will be a huge help in visualizing this

a very good example of what im talking about
go to about 3:40 and start watching.

i do realize that the mesh will add triangles to your scene, but you will only add a few triangles per road segment. you can create a simple road mesh of maybe 10 triangles per segment and 1 texture. i noticed that crytek uses a bezier curve to model their road. unless you want curvy roads i wouldnt recommend that route. you could stick with simple straight lines. using the line will help out a lot. you can subdivide the line into points according to the triangles in the terrain below it. my recommendation for finding the points is to center them on the triangle and get the normal of that triangle. the normal will determine the angle and orientation of the road segment.
Thanks Adam,
thats what I needed to get the right understanding.
See I think as said earlier, maybe dirt roads can easily be textured into the terrain. But actual concrete roads, or strong contrasting lines work better when layered.

If you have the ability to, I may recomend taking a look at Crysis' editor, it wash supurb road capability. The basic just is that they build a seperate road mesh from a spline, this greatly simplifies texturing and ensures that you can have roads going in any direction (as opposed to the directions you have textures for) then the engine matches the surronding terrain to meet up with the road for a seamless join.

This topic is closed to new replies.

Advertisement