Proland Documentation - Forest Plugin

The forest plugin provides a task to draw instantiated trees or other objects on a terrain. This plugin does not depend on any other plugin.

The above task uses a producer that generates a set of points per terrain quad, based on data produced by other producers. The points are generated by removing points from precomputed point patterns, and by computing attributes for the remaining points (such as an elevation, using an external elevation producer, a normal, using an external normal producer, etc). The decision to keep or remove a point being made based on a density map, using an external ortho producer.

During rendering, the union of the point sets for all the visible leaf quads is drawn with a single draw call, with a shader that can then generate camera facing quads from these points, place them on the terrain, and finally texture and shade them.

The main classes of this module are the following:

the position of each generated point is computed relatively to a given reference point. When the camera moves too far away from this reference point, all the generated points are recomputed relatively to a new reference, equal to the current camera position. We do this to ensure that the point coordinates remain small, in order to avoid numerical precision problems. Like for the ocean case, all computations are done in a local reference frame moving with the camera. Shaders have access to the position of the current reference point in this moving frame in order to transform the generated points in screen space in a correct way.

The "trees1" example illustrates how these tasks can be used, without shadow maps, and on a flat terrain. The "earth" examples show how they can be used with cascaded shadow maps, on a spherical terrain.

Generated on Sat May 12 09:42:31 2012 for proland by  doxygen 1.6.1