Archived

This topic is now archived and is closed to further replies.

shakazed

Random terrain!

Recommended Posts

Guest Anonymous Poster
Try this
http://www.gamasutra.com/features/20000403/turner_01.htm

If you need more info then perhaps a search on google/gamedev/gamasutra/etc.

Good luck
Kevin

Share this post


Link to post
Share on other sites
at first, before i managed to load heightmaps, i would just make it random. they sucked though, becuase one height point would be a mile higher than the one next to it. so what i did is make a smooth routine, that goes through, and averages all the heights out, so i ended up with small rolling hills

Share this post


Link to post
Share on other sites
Hi,

Yeah random heights at the Y point can be pretty ugly, but there are many algorithms out there to generate beautiful looking terrain. The tutorial mentioned by finny generates pretty nice looking terrain (rolling hills, lots of variation) and my terrain renderer is based on it too.

There are also many other ways of generating terrain: perlin noise, faulting (is this what its called?), diamond-square algorithm, even some simple plasma. A search on google for any one of those should yield some good tutorials and websites.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I used an algorithm similar to perlin noise to make my terrian. If your graphics card supports bilinear interpolation, you can get the rasterizer to generate the heightmaps for you, alot faster than the CPU can And if it supports per pixel alpha blending, you can even get the graphics card to generate the texture maps too!

Share this post


Link to post
Share on other sites
(I was the anon poster above). I'm not sure if this is actually called Perlin noise, but this is what I've done (after trying to immitate tutorials on the web, and failing):

Say, you want a heightmap of 256 by 256 pixels. Start with a small number, say 2 by 2 or maybe 4 by 4 pixels, and just fill the pixels with random data (when I say pixels, they don't have to be, they could be just floating point numbers or single bytes representing height data, but for my project I wanted to use the graphics card to do the interpolation work). Then, using bilinear interpolation for texture filtering (available on most graphics cards), stretch this small heightmap over the entire 256 by 256 pixel heightmap. This gives a very smooth and blurry height map. Now repeat, but use a larger map of random data, such as 8 by 8 pixels, and, when you fill in the random data, use smaller values this time (I half the magnitude each time), and stretch this over the final 256 by 256 map (using a blending operation that adds the pixels, you don't want to completely overwrite your old data). Repeat this process several times, and you'll have a new random height map in the time it takes for your graphics card to blend 6 or 7 polygons.

I may be able to post some screenshots of the results soon... if I can get my webspace working.

[edited by - bazee on July 30, 2002 9:40:32 PM]

Share this post


Link to post
Share on other sites
You could try the following page:
http://filisoft.freeyellow.com/TUTS/ENGINES/teren3D/teren3D.htm
it''s in Romanian, but it still has some nice code for the diamond-square algorithm.
Good luck!

Share this post


Link to post
Share on other sites
Shakazed, you gave up on me? I know I was online that day I was really tired/busy. I havent seen you online ever since.

-------
"Programming is like sex make one mistake, and you have to support it forever."
Homepage: http://students.washington.edu/andrey

Share this post


Link to post
Share on other sites