A SERVICE OF

logo

158
Chapter 14: Optimizing Rendering
Building Back Patch Culling Data for a csGeoSet
Before calling a csDrawAction, which triggers back patch culling, you must rst build
back patch culling data for the csGeoSets of the scene. You only need to call
csGeoSet::buildBPCullData() once; afterwards, the data can be automatically
recomputed.
If back patch data does not exist for a csGeoSet, nothing is culled by back patch culling.
You can check to see if back patch data exists for a csGeoSet by using
csGeoSet::existsBPCullData().
Back patch data is written to, and read from .csb les.
You can delete back patch data using csGeoSet::deleteBPCullData().
Building Back Patch Culling Data for a Scene Graph
csGeoSet::buildBPCullData() builds the back patch culling data for a csGeoSet. It is the
job of the application, however, to recursively go down through the scene graph and
build back patch culling data for all of the csGeoSet nodes in a scene graph.
Updating Back Patch Culling Data
As the coordinates or the normals of primitives are changed, whether or not a primitive
should be culled might also change. Optimizer, by default, automatically updates back
patch culling data and culls the primitives correctly.
You can, however, turn off this automatic updating by setting
csGeoSet::setBPCullDynamicBuildMode() to FALSE. Setting the argument to TRUE
enables the automatic updating of back patch culling data.
csGeoSet::getBPCullDynamicBuildMode() returns TRUE if back patch culling data is
automatically recomputed when csGeoSets change their coordinates or normals.