Re: [info-performer] Light source for part of the scene

New Message Reply Date view Thread view Subject view Author view

From: Paolo Farinelli (paolo++at++sgi.com)
Date: 08/26/2002 14:44:00


Hi Kevin,

The easiest way to do this is to bind your own DRAW callbacks
to nodeA and nodeB (see pfNode::setTravFuncs).
In each node's PreDrawCB, you would turn on the lights associated
with that node, and in the corresponding PostDrawCB you would
switch them off.
This solution is easy, but there is some overhead in having draw
callbacks on nodes..

Another way is to assign lights to specific pfGeoStates (see man
pfGeoState::setAttr). You would have to traverse your geometry (say
nodeA), get to each geostates pointed to by any geoset, and ensure the
specific lights are set.
You would have to make sure that no geosetate is shared across nodeA
and nodeB geometry, so you may need to preprocess your scene to
ensure this.

Hope this helps,
Paolo

kcc++at++dynres.com wrote:

>Hi,
>
>I am trying to use different pfLightSources on different pfNodes.
>For example, use pfLightSource A on pfNode A and use pfLightSource B on pfNode B. And pfNode A and B are in the same pfScene.
>I looked up in the archives and found someone had the same question but no anwsers.
>
>Thanks.
>
>Kevin
>
>-----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-----------------------------------------------------------------------
>

-- 
Paolo Farinelli                                           paolo++at++sgi.com
Member of Technical Staff, OpenGL Performer              1-650-933-1808
Silicon Graphics        1600 Amphitheatre Pkwy, Mountain View, CA 94043


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Aug 26 2002 - 14:44:05 PDT

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