Depth buffer capture

New Message Reply Date view Thread view Subject view Author view

Henry Hoeh (henry_hoeh++at++esplt14m-s.grumman.com)
7 Nov 1996 11:57:30 -0400


I am trying to capture the depth buffer values using the perfly application.
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


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:53:54 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.