Re: LPOINTSTATE INTENSITY

New Message Reply Date view Thread view Subject view Author view

Marcus Barnes (marcus++at++multigen.com)
Wed, 24 Jul 1996 11:02:55 -0700


> On Jul 22, 4:12pm, GRAUX Ludovic wrote:
> Subject: LPOINTSTATE INTENSITY
>
> Hi pfGurus,
>
> Sorry again. A last try, and after I will give up, crying alone in front of
my
> screen.

Don't give up yet! pfLPointState does work (generally). The OpenFlight loader
uses them exclusively when creating light points for example.

> I have a problem with LPointState attributes of pfGeoState.
> I have loaded the "3010.star" file from the Performer data directory.
> I want to control the intensity of the Stars, to be able to make them
> gradually
> disappear from my channel.
> I have got the pfGeoState of the only geoset of this geode, and I have
> attributed a LPointState attr to this pfGeoState.
> As shown in the attached file testStars.C, I have set a null intensity to the
> LPointState. Unfortunately, my stars are as much visible as before.
> What's the problem ? Is there a bug ? Does someone know some special features
> for the .star files ??
>
> I am compiling with IRIS GL, on an 2 CPU 1 RM ONYX with IRIX 5.3.
>
> waiting for answers,
>
> Mike
>
> #include <Performer/pr.h>
>
> pfNode*
> CreateStars(void)
> {
> static void *arena = pfGetSharedArena();
>
> //Les etoiles
> pfNode *Starsf = pfdLoadFile("/usr/share/Performer/data/3010.star");
>
> pfGeoState *starsGState = ((pfGeode*)Starsf)->getGSet(0)->getGState();
>
> pfLPointState *starsLPS = new(arena) pfLPointState;
> starsGState->setAttr(PFSTATE_LPOINTSTATE, starsLPS);
> starsGState->setMode(PFSTATE_ENLPOINTSTATE, PF_ON);
> starsLPS->setVal(PFLPS_INTENSITY, 0.0f);
>
> return Starsf;
> }
>-- End of excerpt from Marcus Barnes

Read the pfLPointState man page and look at the example code. Notice that it
sets up many of the pfGeoState modes to complement the pfLPointState. I do not
see you doing any of that in your example code. For starters, add the
following setup:

{
        // blend is high quality transparency
        starsGState->setMode( PFSTATE_TRANSPARENCY, PFTR_BLEND_ALPHA );
        starsGState->setVal ( PFSTATE_ALPHAREF, 1.0f / 255.0f );
        starsGState->setMode( PFSTATE_ALPHAFUNC, PFAF_GREATER );
        starsGState->setMode( PFSTATE_ENFOG, PF_OFF );
        starsGState->setMode( PFSTATE_ENLIGHTING, PF_OFF );
        starsGState->setMode( PFSTATE_ENTEXTURE, PF_OFF );
}

Also consider doing a complete setup of the pfLPointState itself. Take care
when using texture modes as they may exhibit some shape or color anomolies,
depending on the platform.

Regards.

--
   ____ ___  ____  _    Marcus Barnes, Member Technical Staff
  / __ `__ \/ __ `( )   MultiGen Inc. 550 S. Winchester Blvd. STE 500
 / / / / / / /_/ / /    San Jose CA 95128 WEB: http://www.multigen.com
/_/ /_/ /_/\__, /_/     PH:1-408-556-2654 FX:1-408-261-4102
          /____/        EMAIL: marcus++at++multigen.com
=======================================================================
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:53:13 PDT

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