Ogre demo

Binary, media and shaders available here (please, unpack and run with DirectX) !
Sourcecode with VisualStudio 8 C++ solution available here.

Handles a forest of 40 000 trees, pixel shaded, with shadows and atmospheric effects...(between 8 and 18fps in 1024*768 on a GeForce 7800GTX, runs 30 fps in 640*480).

Real screenshot preview (click to enlarge)...

 

The aim is to provide an efficient yet simple sample of forest rendering. Thus we use the Ogre3D rendering engine combined with TreeGenerator's billboarding facility.

To keep the example simple, we neither take benefit of the PagedGeometry add-on for Ogre3D, nor do any deffered shading nor do an early depth pass (this last improvement might not speed up the rendering since the early depth has to access the alpha channel of billboard's texture). Consequently, this sample is highly fillrate limited (realtime in 640*480 while quite slow in 1024*768).

Remarks :
- We use static geometry which is overall faster than standard entities. Static geometries are loaded completely into the graphic card and remain fixed, so they cannot provide levels of detail for trees.
- Terrain is drawn first since trees are highly fillrate consuming. Drawing terrain first allows trees' fragments to be mostly discarded by the depth test.
- The shadowmap is not updated at every frame since trees are static. Moreover, the shadowmap is only 512*512 since we could not expect to get leaf-level details in the shadowmap, so the shadowmap just gives a rough idea of the shadowed areas.
- Exponiential fog and aerial perspective are computed per vertex.
- Due to a known bug, one quad has been manually removed from each billboard cloud in a 3d modeler. Moreover, the transparency mask generated separately by TreeGenerator has been combined with the billboard texture as alpha channel.

 

About Us | Contact Us | ©2007 TreeGenerator |