I'm working on a new method right now to prevent some of the weird, drastic elevational changes in the original method that resulted in so many long, high causeways and other unnatural formations.
In this new method, I start with the same tesselated curve as before. Only now, I generate 3 different quadstrips. The first one I generate very wide, then rasterize into one buffer as elevation gradients. Like so:
I generate a second quad strip that is much narrower than the first, then use this second quadstrip in conjunction with the wide one to rasterize a blending map into a second buffer. This blending map specifies a fall-off for the road bed, to blend the road elevation gradient with the map heightmap. The blend map is rasterized so that the center strip of the road is fully white (meaning, that 100% of the final map elevation in these areas comes from the road elevation map) with a fall off to 0 at the edges of the fat quadstrip. Something like this:
I then perform an operation where I composite the road elevation map with a perlin noise buffer or other noise source, using the blend map to interpolate between the noise map and the road elevations, to get the final map. This has the effect of smoothing out or gradualizing the harsher transitions from rolling terrain to sculpted road bed, eliminating or reducing many of the artifacts previously encountered. The final heightmap may look something like this:
The third quadstrip is created to be even narrower than the second, and is used for laying down the road terrain.
Some new shots of this technique in action show subtle yet significant differences in how the road carves it's way through the terrain. Sharp, high causeways are mostly eliminated, and vastly reduced in jarring visual impact where encountered. Carved canyons also are not so sharp and abrupt.
I still run into some occasional problems with how quadstrips are built and rendered. Tight, hairpin curves with drastic elevational differences on both sides of the curve result in lots of weird overdraw that causes stair-stepped elevational artifacts to appear at the nexus of the curve; the greater the difference in elevations on either side of the curve, the worse the artifacts are. Wider roadbed quadstrips also magnify the problem. I can lessen the occurrence of such artifacts by more careful selection and modification of roadbed elevation gradients to avoid such drastic changes in elevation.
If I apply turbulence to the generated roadbeds and terrain, the effect is much, much nicer than these shots show, eliminating the strange, smooth, unnatural feel of things. I may or may not post some images of turbulent roads later, depending on how I feel.
That's probably all I'm going to write about roads (unless I post the above-mentioned shots), since after all it isn't a very exciting topic. [grin]
Washu: It's possible that I might release a demo of some sort of this thing sometime. I'll keep that in mind, and maybe try to get to it sometime this week or something.