Sign in to follow this  

Texturing Roads over terrain

This topic is 3292 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

http://www.youtube.com/watch?v=l5w3JrX6fJw a very good example of what im talking about
http://www.youtube.com/watch?v=5BxIvFh7l5Q 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 3292 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this