Eric S. Hirschorn (erich++at++pike.cecer.army.mil)
Sat, 12 Aug 1995 18:21:48 -0500 (CDT)
I think I just forwarded a previous posting back to info-performer and
to Marcus Barnes by mistake. My apologies for the annoyance.
Anyways, I got the pre- and post- draw callback method to work
finally, following another suggestion of Mark Visconti. I added the line:
pfMtlColorMode((pfMaterial *)data, PFMTL_FRONT, PFMTL_CMODE_COLOR);
into the pre- callback.
I'm a bit puzzled why I had to specify PFMTL_CMODE_COLOR instead of
something like PFMTL_CMODE_AD, because of this blurb from the
pfMtlColorMode man page:
The default color mode is PFMTL_CMODE_AD which causes both diffuse and
ambient material colors to be replaced by GL color commands.
Specifically, this setting allows colors specified by pfGeoSets to have
effect. When lighting is disabled, the color mode is set to
PFMTL_CMODE_COLOR.
Also, I wonder what the cost of this method is in terms of added DRAW time
per frame.
Final (?) version of the pre- draw callback:
/* Change material properties just before drawing */
long
planePreCallback(pfTraverser *trav, void *data)
{
pfPushState();
pfMtlColorMode((pfMaterial *)data, PFMTL_FRONT, PFMTL_CMODE_COLOR);
pfApplyMtl((pfMaterial *)data);
pfOverride(PFSTATE_FRONTMTL, PF_ON);
return PFTRAV_CONT;
}
Eric
_____________________________________________________________________
Eric S. Hirschorn, USACERL VE Group, EMAIL: erich++at++pike.cecer.army.mil
TEL: (800) USA-CERL ext. 6363 or 7528, FAX: (217) 373-6724
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:47 PDT