[info-performer] Re: pfTex subload problem/question

Date view Thread view Subject view Author view

From: Gary Quinn (G.Quinn++at++tees.ac.uk)
Date: 03/25/2004 08:35:47


  Thanks for your reply Chris.

  I'd missed that stuff out of the email to
  keep it short.

  I've just modified simple.c to create a
  shortened version of the problem...

http://vr.tees.ac.uk/gary/subload.c

  Thanks,
  Gary.

"Dorosky, Christopher G" wrote:
>
> You made no attempt to clear up all the GL matrix, ortho and other stuff
> that Performer
> left over. You need to clear this up, do your thing, then put it back.
>
> This may not be it, but it is suspicious.
>
> Chris
>
> -----Original Message-----
> From: owner-info-performer++at++performer.engr.sgi.com
> [mailto:owner-info-performer++at++performer.engr.sgi.com]On Behalf Of Gary
> Quinn
> Sent: Thursday, March 25, 2004 9:24 AM
> To: info-performer++at++performer.engr.sgi.com
> Subject: [info-performer] pfTex subload problem/question
>
> PfHi !
>
> I'm trying to grab the frame buffer into a pfTex,
> ultimately for dome distortion, but I'm getting
> strange results...
>
> When I read the framebuffer, and draw a textured
> GL_QUAD in the top right of the frame I'm getting
> different (and wrong) results on an O2 and a PC.
>
> On an O2 performer 2.5.3 runtime...
> http://vr.tees.ac.uk/gary/grab_sgi.jpg
>
> The topleft triangle (of the GL_QUAD) is
> correct, but the bottom right triangle is
> wrong.
>
> However, on a PC performer 3.0.2
> http://vr.tees.ac.uk/gary/grab_pc.jpg
> the whole GL_QUAD texture is sheared, and
> the amount of shear changes at each frame
>
> To setup the pfTexture...
>
> texture = pfNewTex(shared->arena);
> image = (unsigned int *)pfMalloc(sizeof(unsigned
> int)*sizeTex*sizeTex, shared->arena);
>
> pfApplyTEnv( pfNewTEnv( shared->arena ) );
>
> pfTexLoadMode(texture, PFTEX_LOAD_SOURCE,
> PFTEX_SOURCE_FRAMEBUFFER);
>
> pfTexFormat(texture, PFTEX_EXTERNAL_FORMAT, PFTEX_PACK_8);
> //PFTEX_PACK_8
> pfTexFormat(texture, PFTEX_INTERNAL_FORMAT, PFTEX_RGBA);
> //PFTEX_RGBA_8
> pfTexFormat(texture, PFTEX_IMAGE_FORMAT, PFTEX_RGBA); //PFTEX_RGBA
>
> pfTexName(texture, "Frame Buffer Texture");
> pfTexImage(texture, image, 4, sizeTex, sizeTex, 1);
>
> pfTexLoadOrigin(texture, PFTEX_ORIGIN_SOURCE, 0, 0);
> pfTexLoadOrigin(texture, PFTEX_ORIGIN_DEST, 0, 0);
> pfTexLoadSize(texture, sizeTex, sizeTex);
>
> pfTexFormat(texture, PFTEX_SUBLOAD_FORMAT, PF_ON);
> pfTexFilter(texture, PFTEX_MINFILTER, PFTEX_BILINEAR);
> pfTexFilter(texture, PFTEX_MAGFILTER, PFTEX_BILINEAR);
>
> pfApplyTex(texture);
>
> Then to use the texture after pfDraw() in the draw callback...
>
> pfLoadTex(texture);
>
> glColor3f(1.0f, 1.0f, 1.0f);
>
> glBegin(GL_QUADS);
>
> glVertex2f(xsize/2.0f, ysize/2.0f);
> glTexCoord2f(0.0f,0.0f);
>
> glVertex2f(xsize,ysize/2.0f);
> glTexCoord2f(0.0f,1.0f);
>
> glVertex2f(xsize,ysize);
> glTexCoord2f(1.0f,1.0f);
>
> glVertex2f(xsize/2.0f,ysize);
> glTexCoord2f(1.0f,0.0f);
>
> glEnd();
>
> In an attempt to narrow down the problem, I
> tried ...
>
> pfSaveTexFile(texture, filename);
> but that just gives me a blank image in the file.
>
> Sadly, www.dorbie.com seems to be down :-(
>
> What am I doing wrong ?
>
> Cheers,
> Gary.
>

-- 

Gary Quinn, VR Centre Technical Manager University of Teesside SGI Network Admin Borough Road, Middlesbrough Go Player Cleveland, TS1 3BA mailto:Gary++at++tees.ac.uk +44 (0)1642 384303 fax 384310 http://vr.tees.ac.uk

#include <std.disclaimer>

Virtual Reality Centre at Teesside Ltd. Wholly owned company of the University of Teesside

The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the use of the addressee and others authorised to receive it. If you are not the intended recipient, please note that any circulation or copying of this e-mail is strictly prohibited. If you have received this e-mail in error please notify us immediately. The Virtual Reality Centre at Teesside Ltd makes every effort to ensure that this e-mail and any attachments are sent virus free. However it is the responsibility of the recipient to perform any checks they deem necessary.


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Mar 25 2004 - 08:39:32 PST