pfdCallbacks(3pf) OpenGL Performer 3.2.2 libpfdu Reference Pages
NAME
pfdPreDrawTexgenExt, pfdPostDrawTexgenExt, pfdPreDrawReflMap,
pfdPostDrawReflMap, pfdPreDrawContourMap, pfdPostDrawContourMap,
pfdPreDrawLinearMap, pfdPostDrawLinearMap, pfdTexgenParams - Node
callbacks examples for special effects.
FUNCTION SPECIFICATION
#include <Performer/pfdu.h>
int pfdPreDrawTexgenExt(pfTraverser *trav, void *data);
int pfdPostDrawTexgenExt(pfTraverser *trav, void *data);
int pfdPreDrawReflMap(pfTraverser *trav, void *data);
int pfdPostDrawReflMap(pfTraverser *trav, void *data);
int pfdPreDrawContourMap(pfTraverser *trav, void *data);
int pfdPostDrawContourMap(pfTraverser *trav, void *data);
int pfdPreDrawLinearMap(pfTraverser *trav, void *data);
int pfdPostDrawLinearMap(pfTraverser *trav, void *data);
void pfdTexgenParams(const float *newParamsX, const float *newParamsY);
DESCRIPTION
These callback functions provide a useful generic callback prototype for
pfNodes. Use these callbacks to create effects that OpenGL Performer
does not support directly, or to perform graphics library tasks
differently than the built-in mechanisms. The currently implemented
callbacks perform reflection mapping using texgen.
To write a database loader that loads reflective materials (as in
pfdLoadFile_obj), just group reflective materials under different geodes
from non-reflective materials and call pfNodeTravFuncs using
pfdPreDrawReflMap as the pre-draw callback and pfdPostDrawReflMap as the
post-draw callback as follows.
pfNodeTravFuncs(MyReflMappedGeode, PFTRAV_DRAW,
pfdPreDrawReflMap, pfdPostDrawReflMap);
This will tell the loader to set pfdPreDrawReflMap as the pre-draw
callback and pfdPostDrawReflMap as the post-draw callback for the geode
containing the reflective materials.
At one time the pfdLoadFile_obj database loader used these mechanisms to
implement reflection mapping. Now that the pfTexGen attribute has been
added to libpr's pfGeoState this is no longer necessary and the OBJ
loader has been updated. The techniques of the reflection map callback
Page 1
pfdCallbacks(3pf) OpenGL Performer 3.2.2 libpfdu Reference Pages
utilities is provided as an example of how similar functions might be
implemented.
NOTES
The libpfdu source code, object code and documentation are provided as
unsupported software. Routines are subject to change in future releases.
SEE ALSO
pfNode, pfNodeTravFuncs, pfdLoadFile_obj, texgen
Page 2