From: Dorosky, Christopher G (christopher.g.dorosky++at++lmco.com)
Date: 03/25/2004 08:04:16
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>
----------------------------------------------------------------------- List Archives, Info, FAQ: http://www.sgi.com/software/performer/ Open Development Project: http://oss.sgi.com/projects/performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com -----------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Thu Mar 25 2004 - 08:06:37 PST