pfCullFace(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
NAME
pfCullFace, pfGetCullFace - Specify face culling mode
FUNCTION SPECIFICATION
#include <Performer/pr.h>
void pfCullFace(int mode);
int pfGetCullFace(void);
PARAMETERS
mode is a symbolic constant and is one of:
PFCF_OFF Face culling is off,
PFCF_BACK Polygons that are back-facing will be culled.
PFCF_FRONT Polygons that are front-facing will be culled.
PFCF_BOTH Polygons that are front and back-facing will be
culled.
DESCRIPTION
pfCullFace sets the face culling mode used to cull all subsequent
polygons. A polygon is considered to be backfacing if its vertices are
in clockwise order (screen coordinates). Frontfacing polygon vertex
ordering is counterclockwise.
pfGetCullFace returns the current face culling mode.
The face culling mode state element is identified by the PFSTATE_CULLFACE
token. Use this token with pfGeoState::setMode to set the face culling
mode of a pfGeoState and with pfOverride to override subsequent face
culling mode changes.
pfCullFace is a display-listable command. If a pfDispList has been
opened by pfDispList::open, pfCullFace will not have immediate effect but
will be captured by the pfDispList and will only have effect when that
pfDispList is later drawn with pfDispList::draw.
Example 1:
/* Set up 'face-culled' pfGeoState */
gstate->setMode(PFSTATE_CULLFACE, PFCF_BACK);
/* Attach gstate to gset */
gset->setGState(gstate);
/* Draw face-culled gset */
gset->draw();
Page 1
pfCullFace(3pf) OpenGL Performer 3.2.2 libpr C++ Reference Pages
Example 2:
/* Override face culling mode to PFCF_OFF */
pfCullFace(PFCF_OFF);
pfOverride(PFSTATE_CULLFACE, PF_ON);
NOTES
Backface culling with pfCullFace(PFCF_BACK) can significantly improve
performance for "solid" databases whose polygons are oriented
consistently and where objects are closed. With these databases you
cannot see backfacing polygons since they are always obscured by nearer
front-facing ones. The graphics hardware can quickly reject backfacing
polygons so use of backface culling is strongly encouraged to increase
performance.
Face culling should be disabled when using two-sided lighting, since the
two-sided lighting is only useful for distinguishing backfacing objects.
SEE ALSO
backface, frontface, pfDispList, pfGeoState, pfOverride, pfState
Page 2