From: Brian Furtaw (brian++at++sgi.com)
Date: 04/15/2004 07:11:43
What Chris is trying to say is on enter to your draw callback
int
DrawCallback(pfNode *, void *) {
pfPushState();
glPushAttrib(GL_CURRENT_BIT); // you are safer with GL_ALL_ATTRIB_BITS
...do your stuff...
glPopAttrib();
pfPopState();
return(PFTRAV_CONT);
}
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.
>
>
>
>
--
----oOOo---- ----oOOo---- ----oOOo---- ----oOOo----
Brian Furtaw (brian++at++sgi.com) Mailstop: DSE-2612
Graphics Guru Office:(301)814.6858 Fax: (253)323-8182
12200-G Plum Orchard Drive OpenGL/OpenGL Performer/Commodity Graphics
Silver Spring, Maryland 20904 Solutions and Integration Services
This archive was generated by hypermail 2b29 : Thu Apr 15 2004 - 07:19:58 PDT