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 )

No comments: