Terrain Generation Complete

May 16th, 2009


My university term is now over, which means my terrain generation application has been completed and handed in.

The project page is here, where you can download the executable and source, and watch a high-definition video of the generator in action.

Here’s some screenshots of the application at various stages during development:
textured100over20fnoise

Pertty lights in first-person mode.watershaderonterrain

Even more Simplex Noise

April 4th, 2009


Just thought I’d upload some further screenshots from the terrain generation program I have in development.

Last time I wrote a post about Simplex and Perlin noise it ranked highly in google for searches about Simplex noise almost immediately, which really demostrates how under valued it is and how few resources are already available. For this reason, I definitely intend to share any source code I write and hopefully offer as simple an explanation as possible of my understanding of how it works after this project is complete.

 First, I started colouring my terrain according to changes in its height. Soon I’ll improve this further by texturing the terrain and also varying colours on areas with certain gradients, for example to create the appearance of cliffs.
blendedcoloursloadsofpolys

 
 Getting the river to a realistic value wasn’t easy (and I’m still constantly fiddling with the values I feed it).
rivercolourriveroflava

 
 I added a water plane to the scene and sloped the terrain downwards to form a coastline.
slopesideviewwaterplanesmoothed

 
 Obviously, the next step was to simulate some waves to make the water more realistic. Here, you can see points along an edge of the plane are being displaced to create ripples across the water.
generatorsterrainwithgenerators

 
 In the actual simulation, these “generators” are on a part of the water plane not being drawn to make the water look more natural. I also drew edges of a box around the terrain so that it isn’t simply a plane floating in space: not more realistic, but it looks kind of interesting.
waves2box

Simplex Noise

March 30th, 2009


No huge update, just figured I’d share some screenshots from my terrain generation/openGL project:

Here, several octaves of Perlin noise (on the left) and Simplex noise (right) are layered to produce a fairly bland landscape. At the moment I’m not sure whether to get it a little more bumpy or to leave it flat and try and plot some buildings. These maps both use 2D noise, inputing X and Z coordinates to give a height at each point.

perlinnoise3 simplexnoise2

 
 As these top-down views show, Perlin noise (left) is less ‘active’ than Simplex noise given the same values. Simplex noise is also lacking Perlin noise’s distinctive thread-like patterns.
perlinnoise4 simplexnoise4

 
 These images both show Simplex noise using the same X and Z coordinates, this time using time as a final variable in generating 3D noise in order to allow different landscapes to be produced.
simplextime1simplexnoise2

 
 Finally, here’s the landscape with a river cutting through it. As you can see it still needs some work – the repetitive sin wave is far too obvious at this scale – but the function is actually very flexible and after some experimentation with values and some more variation I think it will be fine.
simplexwithriversimplexwithriver2

 
 The next step is to look at using noise maps to create procedural and possibly animated textures, and getting some water in there.

In other news:

  • We’re demonstrating and handing over our group project game “Some Assembly Required” to the BBC tomorrow. It’s looking rather nice (screenshots and videos to follow) and we might need to do a little more work before our coursework hand-in, but I think the whole team is pretty pleased with the final product.
  • The whole “Variables don’t vary” deal with functional languages is only weird when you stop and think about it. When you actually get to writing code, it isn’t really something you notice. Just a different mindset I guess. In other words, my experimentation with Haskell continues.