Wednesday, December 3, 2008


We tried Vimeo's HD videos and the result is here, with music giving it somewhat different mood

Only afterwards I noticed that the function computing the tree distribution stopped working correctly after some variables (namely the local terrain curvature) changed in magnitude as they are computed slightly differently. So the trees now grow on much steeper slopes than they should. I won't deal with it now, it has to be reworked into a generic vegetation placement module anyway, when climate info becomes available.

Just now I have to optimize tile manager and generator because it not very efficiently handles GPU memory.

Saturday, November 22, 2008

Flying above forest

Managed to finish some other tasks before the shadows and detail ground textures.

First was placing objects on terrain, with persistence to cache. Later the local cache will be synced with a server, which will be also used to retrieve objects existing anywhere in the world, placed there by other users. We plan a multiplayer demo where users could build their own cities or settlements, and also visit other people scattered on Earth. Still a long way there, though.

Also modified tree rendering so that the boundaries between trees and more distant areas where trees are rendered as solid color are almost invisible. There is a better tree model used too. Now I should focus on the ground texture generation because its the ugliest part there.

Here is video with the new stuff:

Friday, November 7, 2008

Collisions - terrain vs. Jose

I am now reading the generated terrain tile data back from GPU and doing basic collision testing (ray vs. terrain). We test it with one model of man we call Jose Jalapeno, because of the lacking animation.

The yellow lines that are visible somewhere mark the boundaries of the tile where Jose currently resides - without this we cannot possibly find him in the world, ever.

We are currently working also on several other things too:
  • Finally adding the shadows. We waited with these until quad-tree traversal would be right

  • Detailed ground textures, selected by several parameters: climate, bedrock or soil type, terrain slope and curvature etc.

  • Elevation datasets with better detail - 30m resolution for many mountain ranges, along with additional datasets for whole world with climate data. These will be used to select the ground material sets and to condition various other subsystems, like vegetation probabilities or modification of fractal algorithm parameters by bedrock type or other local terrain attributes.

Monday, October 20, 2008

xnview plugin

We created XnView plugin for viewing terrain elevation maps (raw or srtm files) to help us visualize input heightfield data in any combination of format (8-, 16- or 32-bit depth, signed or unsigned, integer or floating point, endianness etc.).

The plugin also autodetects image dimensions by computing row correlation coefficient for all possible image dimensions (i.e. the dimensions that give the correct file size for specified image options)

Find it here.

Friday, August 29, 2008

Tree placement

In addition to the elevations that are read from wavelet-compressed dataset and then refined by fractal algorithm, the engine computes 3 other fractal channels in parallel. These contain 'normal' fractals that will be used as source for coherent random values for various engine parts.

First of these channels was used to enhance the tree placement algorithm. The algorithm in fragment shader first computes the probability of tree being there, according to elevation, slope and terrain curvature. If the actual tree occurrence is determined by comparing the probability against a fixed threshold, it results in large continuous forest areas. The fractal channel provides threshold value that changes continuously and modifies the probability threshold, that results in clearings and woods, but an occasional lonely tree too.

Here is a short video, flying from somewhere in Europe to Africa:

An earlier video without the trees, where angrypig madly flies and turns around

Friday, August 22, 2008

Atmospheric scattering

I've implemented atmospheric scattering as described by Sean O'Neil, with some modifications and endless tweaking. I'm still not quite satisfied, though, but I'll return to it later.

Meanwhile the other two lethargic programmers are presently awakened too.
Angrypig is working on tree generator that will produce all levels of detail needed for tree&forest rendering, from detailed models through continuously simplified and increasingly unified models down to billboards.

Jonsky is modifying the toolchain used to process heightfield maps for the engine (currently used to process earth's elevation data - remapping and wavelet compression). This can be then used to create custom planets; in fact he is currently testing it with the heightfield map of Tolkien's Middle-earth. When we release a demo you will be able to fly over that fantasy planet, or land in Mordor

So if people are interested, we could release some flyable demo sometime in the near future, with the possibility to define your own world using the heightfield map patches, specifying elevations in some rougher resolution. Fractal algorithm computes the details, vegetation is placed by algorithm taking terrain properties into account. One thing still missing are the climatic maps so we could generate deserts and steppes and so on; but this one still requires some thinking.

Sunday, August 3, 2008

Lots of trees

We've added some simple, crude billboard trees into the terrain. These are generated in fragment shader after the tile elevation map is computed. There can be one tree in roughly each 2x2 meter square; whether there actually is one is determined by an ecotype probability equation that takes into account elevation, slope and curvature of the terrain. There's currently just a testing one, producing a single type of tree. Everything is computed in shaders, billboards are created using render-to-vbo technique.

Now there are more than 500 000 trees rendered as billboards, but the furthermost ones are just a pixel high. Even more distant tiles, that have texels covering larger area than 2x2 meters have the trees just baked in as colors (in a marketing-speak it would read as hundreds of millions trees rendered, but if you get to that parts you'd really see the trees there, so .. ). I shall use a different approach for the far billboards though - the frame rate dropped considerably, from 350-600 to about 60-100 with the trees (on 8800GT), and it chokes ati x1600 mobility on my nb to ~12 fps.

Nevertheless the trees nicely show the scale of the world and the ranges of detail that is generated by the fractal algorithm.

Replying to the comments in the previous entry - we should soon produce some videos too. That is, if the other two lethargic programmers here manage to create something during my one week offline vacation (going to forests to observe tree distribution patterns to think about optimizing the forest rendering .. to rest )

Thursday, July 31, 2008


Hi everybody.
I'd like to introduce our project - a planetary engine.

  • Planetary engine that can be used with an elevation dataset, enhancing its resolution using fractal algorithms. Resolution of the elevation data is arbitrary, fractal algorithms further refine the detail down to under-foot resolution. It's possible to have a completely random fractal terrain too, or to sketch the terrain in rough resolution and have the fractal to generate the details.

  • Level of detail ranging from thousands of kilometers down to centimeters.

  • Currently working with earth elevation data (3arc sec dataset remapped to cube faces with roughly 150m resolution).

  • Elevation data are packed using a modifed wavelet compression, the required level of detail can be extracted effectively on the fly. Decompression done on GPU.

  • Finer resolution tiles are generated by fractal algorithm entirely on the GPU.

  • Textures are generated on the GPU from the fractal data using per-pixel computed elevation, slope and terrain curvature; later a material mapper would also utilize climatic data, bedrock maps etc. to more accurately texture the world.

  • Fully asynchronous engine using OpenGL, majority of the algorithms running on the GPU

There are many things to do, though - the material mapper, detail textures, atmospheric model, rendering rivers and water bodies, vegetation etc.

Now some pixel food.

Approaching earth. Until we implement the atmosphere, space is full of air :-)

Heading towards High Tatras in central europe.

Fractal refinement starts to show up. Original elevation data have resolution ~152 meters.

That rock over there ..

.. is roughly 4 meters wide, completely fractal generated.