Calculating the prism of a plant
Just click here:
And wait a little bit (1 minute max for large prisms).. A prism is a multi-faceted impostor that replace a real plant mesh in the distance. Note that due to the high quality of these impostors, they may be used even very close to the camera position. For small plants such as grasses, it's very common to only use prisms and not source meshes, relaxing all polygon count constraints that way.
A prism's facet contain most of the parameters needed to do a proper shading of the plant. Even if geometrically it's a plane, it stores all lighting informations and it reacts to the lighting and it's rendered in 3D with depth. In the image below we have focused on a prism's facet and we see how it reacts to the variation of the sun direction:
If we move around the prism, we can see its facets:
Several parameters are to be considered when calculating a prism:
- First its "Pixel resolution". This is the base size of the texture used to store a prism facet. Generally speaking a real prism is smaller than the size indicated in the box. For instance, specifying a prism with 1024 pixels often end up with a real prism whose size is about 700-800 pixels, so significantly smaller than the wished size. This is due to the shape of the prism itself and how it fits into the texture.
- Second is the "Facet transition sharpness" value. At 1.0, the prisms is very blurry and its facets are often mixed together. At 10.0, the prism's facet transition is very sharp and under most looking angles, one facet dominates the view. But the transition between facets is always smooth.
- Other parameters rule shadows. The "Shadow bias" indicates the biasing of the sun shadow map. Even if a prism's facet is in 2D, the rendered prism is 3D and it casts and receives shadows. Therefore, the shadowing can be biased.
- The "Shadow texture LOD bias" define the sharpness of a prism cast shadows on the ground.
- Last parameter is the specular exponent that approximates the sun specular highlight for the entire prism as this is an information layer which is not stored per pixel in the prisms facets.
Reducing a prism pixel size
A prism has a quite high memory cost due to the number of impostor facets being used to define it and also due to the pixel size used for it. Therefore, it's good to look forward to reduce the size of a prism. It's worth noting that if a mesh switches at a given distance - for instance 50 meters - then a prism will never be visible closer than 50 meters. Therefore, it may be unnecessary to use a too large texture size for it since it'll never be that large on screen. This can be setup for each plant to balance the wished quality / performance ratio.
Using only prisms
Sometimes, there's no need to switch to use meshes. The prism - in which case must have a high resolution - can look good enough even when close. Below is an example of a grassy field looked from below 1 meter, only made with prisms:
Prisms are transparent, blended and have smooth edges, so they tend to work pretty well for this kind of display. Note that unlike most impostors, prisms are designed to be looked from a side angle and also from a top view.
Keeping a prism up to date
These markers in the information part of the prism panel indicate whether the prism is ready or not:
The first icon indicates whether the ambient occlusion field of the prism is correct or not. The second icon indicates whether the prism is correct or not. Modifying a value in the panel may invalidate the AO or the prism or both. For instance changing the resolution of the prism will invalidate it. An invalid prism will remove the display of the plant from Biomes that are using it. Regenerating the prism will make the plant appear again.
Note that changing a material of the source mesh of a plant does not invalidate its prism. Said otherwise it's possible to have a prism that does not exactly match to the mesh seen when close.
Transitioning from plants meshes to prisms | Plants splats when far away |