Re: More than one pfScene

New Message Reply Date view Thread view Subject view Author view

Allan Schaffer (aschaffe)
Mon, 10 Apr 1995 18:41:47 -0700


On Apr 10, 9:35am, Torres Mario 678-3280 AMSRL-BE-M wrote:
> > From: Jim Helman <jimh++at++surreal.asd.sgi.com>
> >
> > Setting up the two channels and having the same or two different
> > scenes is straightforward.
>
> Is this really true? I can have two different scenes in two different
> channels?

Sure. This one is easy, all you need to do is create two scene
graphs (each with its' own pfScene node at the root), create
channels, and use pfChanScene() to connect them.

  pfScene *scene1 = pfNewScene();
  pfScene *scene2 = pfNewScene();
  pfChannel *chan1 = pfNewChan (pipe);
  pfChannel *chan2 = pfNewChan (pipe);

  pfChanScene (chan1, scene1);
  pfChanScene (chan2, scene2);

> Or can I have two different views of same scene with the fog
> turned ON ONLY in one channel?

This is easy if you're using EarthSky. Fog is something that can be
coupled with earthsky, and earthsky is a per-channel attribute. So,
all you have to do is create a different earthsky for each channel,
with a different fog (or no fog) in each earthsky.

If you're not using EarthSky, it will be more difficult. You have to
render the same scene but change the fog state "halfway" through.
One method to try would be:

In the APP: (as you expect)

  pfScene *scene1 = pfNewScene();
  pfChannel *chan1 = pfNewChan (pipe);
  pfChannel *chan2 = pfNewChan (pipe);

  pfChanDrawFunc (chan1, DrawCallback1);
  pfChanDrawFunc (chan1, DrawCallback2);
  pfChanScene (chan1, scene1);
  pfChanScene (chan2, scene1); /* same scene for both */

In DrawCallback1:

   turn fog on (using libpr)
   pfClearChan();
   pfDraw();

in DrawCallback2 do the same but turn fog off.

Loading & removing fog every frame will have a slight performance
penalty.

Performer 2.0 will include the concept of "indexed geostates", so this
switching will be much easier.

Allan

-- 
Allan Schaffer                                              aschaffe++at++sgi.com
Silicon Graphics                   http://reality.sgi.com/employees/aschaffe

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:51:10 PDT

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