Table of Contents

Geometry Structures

Core Library

While the vertex declarations of SpeedTree geometry may vary from model to model and even within a single SpeedTree model or a single LOD, the hierarchical organization of the geometry structures remain otherwise rigid.


SGeometry Structure

Each tree model contains one SGeometry object that encapsulates all of its 3d, billboard geometry, and render states. Render state objects contain material colors, lighting model data, shader names, and many other states. SGeometry also contains data for vertical and horizontal billboards, with details here.











SLod Structure

Each tree model consists of one or more LOD levels, as defined by the SLod structure below. It contains all of the geometries associated with its LOD level, and may optionally have bone data (an option on the Compiler's SRT exporter). If no bones are present, m_pBones is NULL and m_nNumBones is zero.






SDrawCall Structure

While dubbed SDrawCall, this structure holds a group of geometries that can be rendered in a single draw under a shared render state (e.g. all have backfacing culling active, the same diffuse lighting model, etc). Note the vertex data-accessing functions named GetProperty(). Index data is also available in this structure. Think of m_pIndexData as an st_byte pointer that can be typecast into either an st_uint32* or st_uint16*, depending on the value of m_b32BitIndices.


Bringing It All Together

The following code example shows how to load an SRT file, access the SGeometry pointer and run through its LODs, draw calls, and access the raw vertex and index data.