Re: Overriding ONLY Alpha value

New Message Reply Date view Thread view Subject view Author view

Rémi Arnaud (remi++at++remi.asd.sgi.com)
Wed, 12 Feb 1997 11:41:56 -0800 (PST)


Bonjour Michael

BOCCARA Michael wrote:
>
>
>
> =0C Good morning Performers (from a french point of vue),
>
> 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.

 Making part of a scene transparent in the Draw is too late. It works, but
 for performance it is a lot better to have the Cull know what part of
 the database is translucent, so a special sorting transparent bin can be used.
 Therefore, you should change the values in the database tree directly.

 Or, you can use the bin mechanism to mark the GeoSets that have to be transparent, and set the BACK to FRONT order for the bin you have set. then you can use
 a global state for the entire bin and inherit a transparency value .

 Another ideo would be to use a geoset table as the transparent value you
 want to have are not continuous.

  Best regards

> 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 chil=
> d
> geometry of a given node ?
>
> NB : all my subsequent geometry is (for the moment) non-textured, ba=
> ckface
> culled (no PFSTATE_BACKMTL)
>
> Here is a code sample, overriding the PFSTATE_FRONTMTL state mode
>
> int
> preApplyAlpha(pfTraverser *, void* data)
> (
> float alpha =3D *((float*) data);
> pfMaterial *mtl_alpha =3D 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 Impa=
> ct.
>
> Thanks to the good soul who will help me,
>
> Mike
>
> Micha=EBl Boccara ! Aerospatia=
> le
> 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
>

    _ / _ _
|_) _ ._ _ o /\ |_)|\ | /\ | || \
| \(/_| | || /--\| \| \|/--\|_||_/
                                           
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:39 PDT

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