Latest News

Experiments: Volumetric clouds, again
read more>>

Projects: Somewhere over the rainbow
read more>>

Projects: AMD ATI cards
read more>>

Projects: Cádiz downloadable
read more>>

Experiments: Volumetric clouds
read more>>

Advertisement
Donations
Please make a donation.


The money will be used for RAM extensions (i really need this).
Info
Erdstrahlen Freie Webseite!
This website does not support InternetExplorer 6.0 or older. If you are using one of these browsers please update your system or annoy your system admistrator with this.

Thanks for your understanding.
Procedural Terrain

I nearly rewritten the complete thing. Nearly everything gets calculated on the gpu now (on a geforce8 system this gives you a speedup up of x10). Creation of the density field, ambient occlusion term, marching cube index, vertex of every marching cube and the normals.

For creating the vertexes and normals i simply render a quad to a 256x256px texture using a quite complex pixel shaders (measured in headaches per hour) which outputs the vertex (position, normal and ambient occlusion term takes 2 pixels on the texture for a single vertex), after that i only need to download the texture to system ram and i have my triangle list.

I also programmed my own vertex welding and lod creation functions which are n-times faster than those of directx.

But whats much more interesting is that i've started to make a game out of it. The code now creates a tower with a pipe going widly from top to buttom, the goal is to roll this pipe downhill with a ball.

Procedural Terrain
added some normalmapping.
Procedural Terrain
Procedural Terrain

With procedural terrains you can produce very big non-repetive (of course they are repetive, but they are so big you will hardly notice this) worlds. Procedural means that the complete terrain is constructed by a function rather then by an artist (you can still use some maps which for example specify how rocky the terrain is and so on).

I split the whole scene which is to be generated into smaller tiles (typically 64*64*64), this saves memory (the memory used for creation stays constant, no matter how big your scene will be) and its easier to use several threads to speed things up (but every thread must has its own temporary memory for generation, so this could be a big problem, you can solve that if you use smaller tiles (which are slower though)).
So next is to create the density map for one part, these are double the size of the part (128*128*128) to prevent visible edges between the parts caused by wrong normals and occlusion term. Creating one takes around 50ms. Actually this map are 128 floating points textures which are filled with a shader, and then copied back to an array (faster then doing everything on the cpu). The densitymap specify which parts of the scene is rock (positive values) or air (negative values).
I'm using 4 64*64*64pixel noise 3d textures (filled with rand()s) which gets combined at several different frequencies and amplitudes to form the scene, but you can also encode your own worlds in the shader like planets, or a helix or...

On this map i run the marching cube algorithmus which creates the polygons. Normals and ambient occlusion term gets also calculated. This takes 500ms-2sec (depending on how many polygons needs to be created and if ambient occlusion is calculated)
After this there is also the possibility to generate several LOD meshes. With LOD i'm already able to display very large terrains, though there is still room for optimations.

Some numbers:
Memoryconsumption

  • 1 thread: 350mb
  • 2 threads: 570mb
  • 4 threads: 900mb


Creation time of the babel tower:

  • 1 thread: 16 sec
  • 2 threads: 10,9 sec
  • 4 threads: 10,7 sec
Procedural Terrain - Galleries
Volumetric clouds, again - Jun 10 2009

Ok, i'm working on the volumetric clouds again. I think these will add much to the game graphics. Its still to slow and there are not enough visible clouds but this will change.

Its completly dynamic now. The shading is just a quick approach at the moment.

New screenshots in the gallery.


Comments

by on Sep 20 2009 at 2:11 AM
Interesting things! I like tower test 2!