BOCCARA Michael (MICHAEL.BOCCARA++at++siege.aerospatiale.fr)
Wed, 12 Feb 1997 12:45:29 +0100
I want to "ghostify" a part of my scene, ie I want to make it
semi-transparent by applying a non-1 alpha value.
For that I use a DRAW pre&post callback function.
The only way I see is to create a new material with an alpha < 1.0f, to apply
it, and to override the PFSTATE_FRONTMTL.
But I don't want to loose the material colors of the child geodes.
My question is :
How (or is it possible) to override only the alpha value of the child
geometry of a given node ?
NB : all my subsequent geometry is (for the moment) non-textured, backface
culled (no PFSTATE_BACKMTL)
Here is a code sample, overriding the PFSTATE_FRONTMTL state mode
int
preApplyAlpha(pfTraverser *, void* data)
(
float alpha = *((float*) data);
pfMaterial *mtl_alpha = new(pfGetSharedArena()) pfMaterial;
mtl_alpha->setAlpha(alpha);
mtl->apply();
pfOverride(PFSTATE_FRONTMTL, PF_ON);
delete mtl_alpha;
return PFTRAV_CONT;
)
int
preApplyAlpha(pfTraverser *, void*)
(
pfOverride(PFSTATE_FRONTMTL, PF_OFF);
return PFTRAV_CONT;
)
I am using Performer 2.0.1, IRIX 5.3, on an Onyx RE2 or an High Impact.
Thanks to the good soul who will help me,
Mike
Michaël Boccara ! Aerospatiale
Virtual Simulation engineer ! Common Research
email : ! Center - DCR/IK
michael.boccara(a)siege.aerospatiale.fr ! 12 rue Pasteur
Tel : (+33) (0)1 46 97 32 40 ! 92150 Suresnes
Fax : (+33) (0)1 46 97 32 59 ! FRANCE
===================================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:54:38 PDT