Re: spotlight in Performer

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Tue, 29 Sep 1998 10:37:46 -0700


Liu Xiaoyan wrote:
>
> Hi, all,
>
> I'm trying to implement VRML-like Spotlight with Performer 2.2, i.e.
> no projected texturing, just plain color with fading off along the spot
> cone. What I did was commenting out this 2 lines from sample code
> "shadow.c":
> pfLSourceMode(proj, PFLS_PROJTEX_ENABLE, 1);
> pfLSourceAttr(proj, PFLS_PROJ_TEX, tex);
> and add in lines to control the Spotcone:
> pfSpotLSourceCone(proj, 2.0f, 2.0f);
> pfSpotLSourceDir(proj, ..........);
>
> However, I cannot see the spotlight in effect, the geometry looks flat
> and is not lightened.
>
> What else should I do?

Lighting is performed at vertices only, so you must ensure
that some vertices fall inside and outside the cone to see
the effect. Improving this is the motivation for the
projective texture.

Not required:

pfLSourceVal(shad, PFLS_SHADOW_SIZE, SPOT_SIZE);
pfLSourceMode(proj, PFLS_PROJTEX_ENABLE, 1);
pfLSourceAttr(proj, PFLS_PROJ_FRUST, shadFrust);
pfLSourceAttr(proj, PFLS_PROJ_TEX, tex);

pfChanTravMode(chan, PFTRAV_MULTIPASS, PFMPASS_NONTEX_SCENE);

Cheers,Angus.

-- 
"Only the mediocre are always at their best." -- Jean Giraudoux 

For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Sep 29 1998 - 11:29:09 PDT

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