Home Technical Talk

Roads on large-scale terrain?

I'm in the design doc stage of figuring out workflow. I'm trying to figure out how to create roads that follow large terrain meshes, levels nearly 100 km across.

Roads should go up and down in elevation but stay fairly level across the width of the road.

To map the road texture, I'm guessing the roads will need to be extruded along paths. I'm thinking of stitching them to the terrain mesh, but they also have to deform the terrain some... cutting into a hill on one side will adding landfill on the other.

I'm thinking maybe I could blur the heightmaps along the road paths, which would give me the width-flattening deformations from the roads.

Someone here turned me on to World Machine, a great heightmap maker. I love the erosion. Anybody use this a lot? Maybe there's a way to deform the heightfield using nodes in their graph system?

Or maybe there's some better software for this kind of thing.

Replies

  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    I never dealt with terrain that large, so I can only guess.
    Although I do play a lot of World War 2 Online, which is 1/4 the size of western europe.
    It looks like they extrude roads along a path, but they are not attached to the main ground mesh. Their terrain also does not deform.
    Operation Flashpoint used this floating road technique as well.
    I suppose you should be able to create a script that would weld the road surface into the world mesh.
  • Sage
    Offline / Send Message
    Sage polycounter lvl 19
    Eric can you layer it with a shader? Make two maps one with the mountains and on with the roads and just have the road height carve slighting into the mountains? Maybe make the roads be like a decal?

    Alex
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    making a heightmap by rendering out an extruded path from the top-down view in max, and using that as a mask in world machine sounds like it might make a good basis...
  • anton980
    The project I'm finishing up right now called for a creation of a terrain almost as large as yours. The idea was - a student would drive a car down a road following a GPS-type map, so the road network has to be very close to the real map (same goes for elevations and such). The way I built it: I traced all the height lines in illustrator, combined all the lines on the same height level into one spline, then merged it all into max, and changed the z coordinates of each one accordingly. Then used "terrain" (in compound objects) to build a rough environment. After this, I set up a camera pointing down, set ranges on it and rendered a z-depth image, smoothed it a bit in photoshop and then used it as a displacement map on an evenly divided plane with enough polygons to support whatever amount of detail I needed. The reason I didnt use the "terrained" object - those come out too jagged.
    After that I traced roads in illustrator, made 3 splines (major highways, regular roads and dirt roads), brought them into max, extruded a certain amount (made sure my "generate mapping coordinates" was turned on for easy texturing) then I duplicated them. I then projected the duplicate roads onto the surface, extruded the original again so they penetrated the terrain and cut the surface of the ground. Then simply combined them and I had my terrain with accurate road network and elevations. The engine we used at a time didnt support decent enough texture blending, so roads had to be cut out like that.
    Sorry for a long post, hope it helps and my appologies if I repeated someone elses suggestions.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    [ QUOTE ]
    anyway, hey how do you get more than 8-bit bitmap output out of max anyway?

    [/ QUOTE ]

    use a format that supports it ? OpenEXR, HDRI
  • Eric Chadwick
    Good suggestions all, going to play with these. Sorry can't show any pictures, client is the cloak-n-dagger type.

    Per, I just save the render from Max as a 16bit TIFF, works OK for me.

    Mop have you ever actually banned someone? I'd be mighty pissed if you tried to ban me. Not my fault Per has ADD. laugh.gif
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    I don't have the power to ban people smile.gif

    However, I do have the might of Bearkub on my side, and he is usually happy to listen to any suggestions I might have wink.gif

    I just recently ran into the bucket of fun that is 16-bit images (max has a horrible time with them if you're using them as displacement), and Photoshop's support is a tad flaky at times, although CS2 actually makes 16/32-bit editing viable.

    Seems everyone's doing terrain these days... smile.gif
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    also, if you are headed to the Unreal engine a handy little tool called G16ed is usefull for working with and exporting 16bit greyscale images to their proper format.
    These suggestions are quite good. You could also draw out the road system in photoshop in a layer above your height map. Set the blending mode to overlay, and set the color to like 120 grey. It will create a slight displacement from the surounding terrain, but not carve holes into mountains. could be worth a shot
  • Eric Chadwick
    I think the blurring method might work. Then I guess if I pro-boolean the road into the terrain, I could blend the edges together with a shader. Hmmmm.

    Some World Machine methods discussed here.
    http://72.14.209.104/search?q=cache:peda...t=clnk&cd=6
    With a link to this road tutorial...
    http://www.coniserver.net/ubbthreads/showflat.php/Cat/0/Number/595946/page/0/fpart/all/vc/1

    Also found another terrain app. No road tool yet, but something in development apparently.
    http://www.cajomi.de/GeoControl/geocontrol_features.htm

    Terrain linkage.
    http://www.ridgecrest.ca.us/~jslayton/terrain.html
  • Ryno
    Offline / Send Message
    Ryno polycounter lvl 18
    Loft the road with generate UVs checked. This makes for nice easy UVing. You can make sure that the spline path's points at are appropriately the right altitude which should get the road height close. After that, soft select the vertices on the terraing neighboring the road, pulling them up to fit things even tighter.
  • Eric Chadwick
    Yeah, except I'm blending the road-edges with a shader, so I'd like the roads welded to the terrain.

    Here's the basic method I came up with yesterday.

    1. World Machine. Whole-level heightfield.
    2. 3ds Max. Displace a plane. Break into 1024s. Draw road splines. Bake roads from planes.
    3. Photoshop. Blur heightfield using roads (+ border) to mask blur. This cuts/raises roadways into/out of terrain.
    4. 3ds Max. Displace road splines and terrain with new heightmaps. Loft roads, contour but no banking (keeps road width flat), adjust UVs, remove self-intersections. Boolean union. Assign mat IDs. Select road edge verts, Relax. Create masks for shader transitions.

    I'll post a pic when I have something worth looking at.
  • bearkub
    Offline / Send Message
    bearkub polycounter lvl 20
    for the record, I don't listen to anything that crazy bastard MoP says.

    Oh no! he read that!

    ha ha! uhhh...just kidding ha ha!
  • Eric Chadwick
    Ah I had it in my head Mop was an admin, but that's over at CGChat not here I think.

    Anyhow. As promised, here's what I have so far. Mesh is a bit high res for the eventual app, there's some nasty optimizing from ProBooleans (anyone know how to avoid that?), and the textures need some luvin'...

    2006.10.10_landscape_sm.jpg

    2006.10.10_landscape_wire_sm.jpg

    Crits/ideas welcome.
  • Ninjas
    Offline / Send Message
    Ninjas polycounter lvl 18
    That is looking cool Eric. I don't want to derail your thread but does anyone know if you can extract an "erosion map" from World Machine that color codes the extent of erosion that was calculated?
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Yep, you can output 3 different map types from the erosion filter - Flow, Deposition and Wear... all of them are useful for various things. Nice for masking textures etc.
  • Ninjas
    Offline / Send Message
    Ninjas polycounter lvl 18
    Ah, thanks Mop. That sounds awesome.
  • Eric Chadwick
    Oh that's good to know. Thanks for bringing that up. I've been making my masks with a Falloff map in Max, affected by the bump. But isolating erosion/etc. sounds like it might be helpful.

    How do you divide World Machine output into tiles? Like say I make a 8192^2 landscape, and want to output sixteen 1024^2 tiles. I'm getting close to buying it, but haven't really spent enough time with it yet.
  • Eric Chadwick
    OK, figured it out, and bought the software. Basically I split it up in Photoshop. Also figured out how to get a tiled heightmap... feed it a tiled image, erode, output. Feed it the same image but half-offset first, erode, output. Then stitch the two together in PS to eliminate edge-erosion seam.

    I like how Battlefield 2 has seemingly-endless terrain. The edges are off limits, but they give you a natural horizon. They use a 3x3 grid of landscape meshes, the middle one using a higher-frequency heightmap.
Sign In or Register to comment.