Richard M. Owens (rmo++at++kingsnake.nrlssc.navy.mil)
Wed, 22 May 1996 12:12:15 -0500
First, transparency -- I'm developing a C++ application, and I'm just trying to
get one polygon to have an alpha value of about 0.2. I'm using the "Builder"
functionality to create the geometry (one rectangle). I specify the alpha
component of the "color" field of the primitive, and call
pfdBldrStateMode(PFSTATE_TRANSPARENCY, PFTR_ON). I've also tried an alternate
method of:
1. enabling lighting with pfdBldrStateMode(PFSTATE_ENLIGHTING, PF_ON)
2. adding a material with the following properties:
material->setColorMode(PFMTL_FRONT, PFMTL_CMODE_COLOR);
material->setAlpha(0.2f);
This didn't work, either. After calling pfdBuild(), I am adding this node to my
scene object (scene->addChild(transparentPolygon)).
The second problem, texturing. I made my own pfdLoadFile_xxx based on one of
the provided ones, and added texture coords to it (and setting buffer->tbind =
PFGS_PER_VERTEX). A debugging session showed valid values being set for S and
T. Then I tried to enable texturing with:
pfTexture *tex = new pfTexture;
tex->setFilter(PFTEX_MINFILTER, PFTEX_BILINEAR);
if (tex->loadFile(textureName))
{
gstate->setAttr(PFSTATE_TEXTURE, tex);
gstate->setMode(PFSTATE_ENTEXTURE, PF_ON);
gstate->setAttr(PFSTATE_TEXENV, new pfTexEnv);
}
Again, no dice. The scene is appropriately slower (Indigo Elan), but my surface
is not textured. (It is a bit darker, however).
I am able to supply more source code if necessary. Any help would be GREATLY
appreciated.
Richard
--
O o~ o_O/ Richard Owens
/|-o _______|_______ \ PSI/NRL Code 7183
/ \ | | |\ Richard.Owens++at++nrlssc.navy.mil
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer.html
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:55 PDT