Re: Material Alpha values and flt loader

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Wed, 07 Apr 1999 14:59:09 -0700


Some texture environments will blow away alpha, also vertex colors can
change alpha of the material depending on the colormaterial mode.

You should also verify the the flight loader is giving you the correct
material.

Cjeers,Angus.

Scott Herod wrote:
>
> I'm building simple models with materials that can have
> their alpha values dynamically adjusted. If, in addition
> to my model, I load an flt model (for example cane.flt)
> with the MultiGen loader, zero alpha on my models make
> them invisible. My model without the flt model or with
> an obj model (at least, I've not checked other formats)
> is roughly 75% opaque if I set the material to zero alpha.
> I really want to make zero alpha mean transparent. Could
> someone suggest what the flt loader is doing to change how
> transparent materials are displayed?
>
> Thank you,
>
> Scott Herod
> scott++at++evt.com
>
> Some details:
>
> I've seen this on O2, MXE, and RE running 6.5 with Performer
> 2.2.3.
>
> mat->setAlpha( material->alpha() );
> mat->setColorMode( PFMTL_BOTH, PFMTL_CMODE_OFF );
>
> pfGeoState *geostate = new pfGeoState;
> geostate->setMode( PFSTATE_TRANSPARENCY, PFTR_BLEND_ALPHA );
> geostate->setMode( PFSTATE_ENLIGHTING, PF_ON );
> geostate->setMode( PFSTATE_CULLFACE, PFCF_BACK );
>
> geostate->setAttr( PFSTATE_FRONTMTL, mat );
> geostate->setFuncs( preFunc, postFunc, NULL );
>
> The predraw function preFunc is there to grab the current
> pfState:
>
> int preFunc ( pfGeoState* gstate, void* udata )
> {
> pfState* state = pfGetCurState();
> pfPrint( state, PFTRAV_SELF | PFTRAV_DESCEND, PFPRINT_VB_DEBUG, NULL
> );
> return 0;
> }
>
> >From this I know that the flt loader is turning off ENTEXTURE,
> ENTEXGEN, ENLPOINTSTATE, and ENCOLORTABLE. I've also tried
> turning these off myself with no effect.
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
"Microsoft's system was like a forest that hadn't had a controlled
 burn in decades, just waiting for one person with a match to turn
 it into a disaster. Melissa was Microsoft's fault. They left their
 system wide open to this sort of abuse, they knew it could happen
 and did nothing." -- Bruce Perens

For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Wed Apr 07 1999 - 14:59:12 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.