Table of Contents

Accessing Billboard Geometry

Core Library

There are two types of billboard geometry: vertical/360-degree billboards, and a single static horizontal billboard.


Vertical Billboards

The SVerticalBillboards structure can house multiple vertical billboard images, each generated by the SpeedTree Compiler. It contains the dimensions of the billboard image as well as a table of texture coordinates that reference the billboard atlas. By default, billboards are rendered with a normal map. It is assumed that the diffuse and normal billboard atlases will be aligned and accessing with the same texture coordinates. m_pTexCoords will hold four floats for each billboard image. These floats represent:

In addition to the m_pTexCoords values, m_pRotated contains an array of bool flags, one per vertical billboard image, specifying if that billboard is rotated in the atlas. These hints are helpful in optimizing the billboard vertex shaders. If the flag is true, the corresponding atlas entry is rotated.

The SVerticalBillboards structure is below:








Cutouts

Added as an optional feature, the Compiler application can generate non-rectangular billboard geometry. More more-fitting silhouettes can be created to reduce the fill requirements at the cost of increased vertex processing. The image below shows an example eight-billboard atlas and the corresponding four-triangle cutouts (as opposed to the default two-triangle rectangles).











The cutout coordinates are available as indexed percentage values. That is, they will be rendered as indexed triangles where the coordinates are in the [0.0, 1.0] range. Percentages are used instead of absolute numbers so that the shader may multiply against the current image's geometry width and height as well as its texture coordinate width and height for proper interpolation.


Horizontal Billboards

This is a simple static quad the does not change based on the camera direction other than fading in or out. Like the vertical billboard, it is assumed that the texture coordinates for the diffuse billboard atlas and the normal map billboard atlas will be the same, both accessed by the m_afTexcoords member below.

Horizontal billboards do not use cutouts.