Angus Dorbie (dorbie++at++sgi.com)
Tue, 05 Oct 1999 12:40:48 -0700
Light sources are 'special' in that they must be applied before
everything else is drawn. Performer does this by taking all lights in a
scene and multiplying all the matrices above the light so it can
transform the light position before it has drawn the graph to that
point.
Cheers,Angus.
Allen Bierbaum wrote:
>
> I am having a problem with lighting in a Performer application. I have
> been wrestling with it for quite a while. I think I may just be making
> some bonehead mistake that I am missing.
>
> My scene graph looks like this
>
> LS = pfLightSource
> MD = Model
>
> Scene
> / | \
> LS1 | Group
> Scene | \
> / | DCS DCS
> LS2 DCS | |
> | MD MD
> Node
> |
> klingon.flt
>
> The code for the both lightsources is the same except that I set the
> ambient color differently for each light to detect the influence of the
> light:
>
> pfLightSource* sun1 = new pfLightSource;
> sun1->setPos(0.0f, -1.0f, 0.0f, 0.0f);
> sun1->setColor(PFLT_DIFFUSE,1.0f,0.0f,0.0f);
> sun1->setColor(PFLT_AMBIENT,1.0f,0.2f,0.0f);
> sun1->setColor(PFLT_SPECULAR, 1.0f, 1.0f, 1.0f);
> mRoot->addChild(sun1);
>
> The problem is that only LS1 is influencing the scene. LS2 seems to be
> making no contribution whatsoever. When I turn of LS1 there is no
> lighting in the scene. When I turn it on, there is lighting, but only
> from that light.
>
> When I save out the scene graph without LS1 as a .pfb and load it in
> perfly, the scene graph view shows LS2, but it has no influence over the
> lighting at all.
>
> What (stupid thing) am I missing or what should I check?
>
> -Allen
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
--
"One of the best-known folk theorems of software engineering is that
60% to 75% of conventional software projects are either never
completed or rejected by their intended users. If that range is
anywhere near true (and I've never met a manager of any experience
who disputes it) then more projects than not are being aimed at goals
which are either (a) not realistically attainable, or (b) just plain
wrong."
Eric S. Raymond - The Cathedral and The Bazaar
For advanced 3D graphics Performer + OpenGL based examples and tutors:
http://www.dorbie.com/
This archive was generated by hypermail 2.0b2 on Tue Oct 05 1999 - 12:40:52 PDT