Henry Hoeh (henry_hoeh++at++atdc.northgrum.com)
12 Nov 1996 15:00:12 -0400
I am having trouble capturing the depth buffer values on my new IR machine
with code that works on an RE2.
I am using the perfly application with the minor additions listed below. I
simply duped the color buffer calls and made them depth buffer calls.
My configuration is as follows:
IRIS 6.2
Performer 2.1
Graphics: InfiniteReality
Compiled with -o32 and OpenGL
Anti-aliasing (or Multisampling) is off
I am using all of the perfly code unmodified. I copied the file SNAPWIN.C and
modified the function pfuSaveImage to capture and write the depth buffer
values to a file in addition to the color values as follows:
scrbuff = (unsigned long *)pfMalloc((unsigned int)(xsize*ysize*sizeof(long)),
NULL);
scrzbuff = (unsigned long *)pfMalloc((unsigned int)(xsize*ysize*sizeof(long)),
NULL);
glReadBuffer(GL_FRONT);
glReadPixels((short)xorg, (short)yorg, (short)xsize, (short)ysize, GL_RGBA,
GL_UNSIGNED_BYTE, scrbuf);
glReadPixels((short)xorg, (short)yorg, (short)xsize, (short)ysize,
GL_DEPTH_COMPONENT, GL_FLOAT, scrzbuf);
fid1 = fopen("test.out", "w");
for(x=0; x<xsize*ysize, x++)
status=fprintf(fid1, "Z value: %8x Color: %8x\n", scrzbuf[x], scrbuf[x]);
fclose(fid1);
When I look at the values in the file, the color values vary with the image
but the depth values are a constant (0x3f7fffff).
What am I missing? TIA.
Henry
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:56 PDT