Dewey Anderson (dewey++at++evt.com)
Tue, 22 Apr 1997 18:02:02 -0600
Here's another problem:
Same application: I take a rectangle and apply a texture to it. The rectangle
is solid white and I use
tenv->setMode( PFTE_MODULATE );
so that the texture determines what we see, including alpha. (The texture has
alpha values.) I take this textured rectangle and fly it around some with a
DCS.
This works fine on my Indy and our High Impact (with TRAM option card).
Recently we got an MXI Octane and an SI Octane with the texture option. On
these machines the exact same software has a problem in that it draws the
rectangle as solid white with no texture FOR THE FIRST FRAME ONLY. Subsequent
frames look fine (textured).
I believe this problem also showed up when we had a Max Impact on loan, but I
no longer have access to verify. Also, running almost the same software on our
O2's also has the problem. (I say "almost" because we had to make changes to
run on the O2.)
Any ideas what would cause this? I imagine it's something I'm forgetting in
the texture object setup that didn't matter on the High Impact but is showing
itself on the Octanes.
I was suspecting the existence of the hardware texture memory (because that's a
big diff between the Indy and the others) but that doesn't explain why it's
fine on the High Impact.
Another thought is IRIX and Performer eoe version. The Indy and High Impact
are running IRIX 5.3 with Performer eoe 2.0. The Octanes are 6.4 with eoe
2.0.4. The O2 is IRIX 6.3 with eoe 2.0.3. But I'm pretty sure the Max Impact
was set up like the High (5.3 & 2.0) so that doesn't quite explain that.
I'm trying to excise this code from our application and make a small example
that exhibits the problem but so far I can't get the problem to happen there.
Thanks for any thoughts,
Dewey Anderson
dewey++at++evt.com
Evolving Video Technologies
For reference, here's the code dealing with this. This is in a function that
returns a pfNode to higher code that is building the scene.
------------------------
snip: rectangle coords, normal, tcoords definitions
// set up the color of the rectangle to be opaque white.
// This will combine with the MODULATE mode for the texture
// to give us just the texture result.
pfVec4 *color = (pfVec4 *)pfMalloc( sizeof(pfVec4), pfGetSharedArena() );
color->set(1.0f, 1.0f, 1.0f, 1.0f);
// set up the geoset holding the rectangle
pfGeoSet *geoset = new pfGeoSet;
geoset->setAttr( PFGS_COORD3, PFGS_PER_VERTEX, coords, NULL );
geoset->setAttr( PFGS_NORMAL3, PFGS_PER_PRIM, normal, NULL );
geoset->setAttr( PFGS_TEXCOORD2, PFGS_PER_VERTEX, tcoords, NULL );
geoset->setAttr( PFGS_COLOR4, PFGS_PER_PRIM, color, NULL );
geoset->setPrimType(PFGS_QUADS );
geoset->setNumPrims( 1 );
// set up the geostate for the rectangle. Attach it to the geoset
pfGeoState *gstate = new pfGeoState;
gstate->setMode( PFSTATE_ENTEXTURE, 1 ); // enable texturing
gstate->setMode( PFSTATE_CULLFACE, PFCF_OFF ); // show both front & back
geoset->setGState( gstate );
// set up the texture for the geostate
pfTexture *tex = new pfTexture;
tex->setImage( tex_data, 4, rimg->Width(), rimg->Height(), 1 );
tex->setRepeat( PFTEX_WRAP_S, PFTEX_CLAMP ); // clamp edges so filtering
tex->setRepeat( PFTEX_WRAP_T, PFTEX_CLAMP ); // won't wrap around
tex->setFilter( PFTEX_MINFILTER, PFTEX_MIPMAP_TRILINEAR );
// to keep full color resolution in texture (32 bit texels)
tex->setFormat( PFTEX_INTERNAL_FORMAT, PFTEX_RGBA_8 );
gstate->setAttr( PFSTATE_TEXTURE, tex );
gstate->setMode( PFSTATE_TRANSPARENCY, PFTR_BLEND_ALPHA );
// Set alpha function to clip off alpha values less than 10.
// This is needed to make low alpha pixels actually NOT be drawn at all.
// THAT is necessary so that z-buffer isn't filled in by clear pixels.
gstate->setMode(PFSTATE_ALPHAFUNC, PFAF_GREATER);
gstate->setVal(PFSTATE_ALPHAREF, (10.0f/255.0f));
// set up the texture environment. Attach it to the geostate
pfTexEnv *tenv = new pfTexEnv;
tenv->setMode( PFTE_MODULATE );
gstate->setAttr( PFSTATE_TEXENV, tenv );
// make the actual geode and attach the geoset to it
pfGeode *text = new pfGeode;
text->addGSet( geoset );
snip: at this point I create a pfSCS, attach the pfGeode, text, to it and
return the SCS as the pfNode.
-------------------------------
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
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:55:06 PDT