From: Radomir Mech (rmech++at++engr.sgi.com)
Date: 10/11/2002 09:14:29
Hi Tze Lin,
we took the conversation off info-performer and there were following problems.
First, when pfShadow was initialized the channel was not known yet and
pfShadowAddChannel failed. Second, the program called pfDraw and not
pfShadowDraw.
Lastly, pfShadowAdjustCasterCenter does not work. That was a bug in performer.
So in c api you have to avoid this function for now. In c++ it works.
Regards,
Radomir
Ong Tze Lin wrote:
>
> I haven't had a chance to try the code out, but just checking if you're
> running this PFMP_APP_CULL_DRAW and perhaps issuing a gl command from APP
> (since I see the call in main() ) instead of DRAW? If so, try running
> PFMP_APPCULLDRAW (single process) and see if it works?
>
> Cheers,
> Tze Lin
>
> > -----Original Message-----
> > From: archerc++at++hitrontech.com [mailto:archerc++at++hitrontech.com]
> > Sent: Tuesday, October 08, 2002 6:02 PM
> > To: Performer List
> > Subject: Re: [info-performer] shadows using C
> >
> >
> > Hi performer,
> > I got the same problem about to show a shadow in C-API.
> > When the code run to "pfShadowApply()", it core dump .
> > The error message is:
> > ==============================================
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 1024 (LWP 2086)]
> > 0x403d24a0 in pfShadow::apply () at eval.c:41
> > 41 eval.c: No such file or directory.
> > in eval.c
> > ==============================================
> >
> > Please someone can give some suggestion to fix the problem.
> > Thanks a lot.
> > Here is some segment of my code.....
> >
> > #define PFSHD_PARAM_TEXTURE_SIZE 1
> > #define PFSHD_PARAM_NUM_TEXTURES 2
> > #define PFSHD_BLEND_TEXTURES (1<<0)
> > (I can't include the file pfShadow.h because it caused
> > compile error)
> >
> > main()
> > {
> > .....
> > t = pfGetTime();
> > shared->shadow.caster = pfdLoadFile("ch53.pfb");
> > pfMakeRotMat(shared->shadow.casterMat, 180+15.0*t, 0,0,1);
> >
> > shared->shadow.shadow = pfNewShadow(pfGetSharedArena());
> > pfShadowAddChannel(shared->shadow.shadow, chan);
> > pfShadowNumCasters(shared->shadow.shadow, 1);
> > pfShadowShadowCaster(shared->shadow.shadow, 0,
> > shared->shadow.caster,
> > shared->shadow.casterMat);
> >
> > pfShadowNumSources(shared->shadow.shadow, 1);
> > pfShadowSourcePos(shared->shadow.shadow, 0, -0.2,
> > 0.2, -0.2, 0);
> > pfShadowAmbientFactor(shared->shadow.shadow, 0, 0.6);
> > pfShadowVal(shared->shadow.shadow, 0, 0,
> > PFSHD_PARAM_TEXTURE_SIZE,
> > 512);
> > pfShadowVal(shared->shadow.shadow, 0, 0,
> > PFSHD_PARAM_NUM_TEXTURES,
> > 32);
> > pfShadowFlags(shared->shadow.shadow, PFSHD_BLEND_TEXTURES, 1);
> > pfShadowApply(shared->shadow.shadow);
> > ---------------- >core dump
> >
> > ....
> >
> > }
> >
> > Thanks again.
> >
> > Regards,
> > Archer Chen
> >
> >
> > _____________________________________
This archive was generated by hypermail 2b29 : Fri Oct 11 2002 - 09:14:37 PDT