Just thought I'd share one of my little projects.
At work, I am a terrain rendering programmer for an upcoming console game. Also branched out into terrain deformation, terrain collision, terrain streaming, and terrain pretty much everything else.
Because of this, I recently got shown a university student's paper on procedural terrain generation. It interested me, so naturally I have had a go at implementing it myself in my free time. (To be clear, the following is not for the game I'm writing at work, it's a
free time project.)
I chose a technique called
midpoint displacement (the wiki article is pretty terrible though). Here are the results:
Selected Eyecandy:
All images:
Test 1 - First test, single terrain cell, colour assigned by height
Test 2 - Same as test 1 but with new random seed
Test 3 - 4x4 terrain cells
Test 4 - 8x8 terrain cells? Maybe 16x16. Algorithm clearly doesn't scale well this way...
Test 5 - Back to 3x3 cells, with wrapping enabled (but glitching on edge)
Test 6 /
Shifted - Same as test 5, but wrapping is fixed. Also shifted image manually to center the resulting island to get a better look
Test 7 - Forced low seed points around edge, makes an island in the middle, don't need to shift image now
Test 8 - Up to 4x4 cells, bigger island
Test 9 /
Heightmap - Heightmap export
Test 10 - Adapt algorithm to work with triangles instead of squares, output result to a model file which is later rendered in 3d. Back to 1 cell (which is now triangular).
Test 11 - Up subdivision another couple of steps. Result is awesome.
Any guesses as to why I adapted the algorithm to triangles?