Jump to content
  • Advertisement
  • entries
  • comments
  • views

And more roads...

Sign in to follow this  


Just can't seem to get off the subject of roads...

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.
Sign in to follow this  


Recommended Comments

Looking excellent, and I thought the original implementation looked pretty good!

I may or may not post some images of turbulent roads later, depending on how I feel.

I think you should [wink]

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.

Just spotted a post in the DX forums - Streets on Terrain - that seems to be at least similar to what you're doing. Might well interest you if you haven't already spotted it..


Share this comment

Link to comment

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
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!