Re: Problems reading the z-buffer

New Message Reply Date view Thread view Subject view Author view

Rob Jenkins (robj++at++quid.engr.sgi.com)
Fri, 27 Mar 1998 10:07:17 -0800


On Mar 27, 6:57pm, Mario Veraart wrote:
> Subject: Re: Problems reading the z-buffer
> Wilfried Zeise wrote:
>
> >
> > Hi pfAll:
> >
> > I am using Performer 2.2 on an Onyx i-station with IRIX 6.2. I want to
> > read the z-buffer values for my currently displayed frame, and save them
> > as an image file (ppm format), for image processing purposes. But I am
> > having some troubles with it. To save such an image I modified the file
> > perfly.C.
> >
> > [snap]
> >
> >
> > glReadPixels(...,GL_RGBA,...) works fine.
> >
> > The GL_DEPTH tests show the following results:
> >
> > frame_snapshot: bias 0.000000, scale 1.000000, bits 23.000000, range
> > (0.000000, 1.000000), depth testing enabled
> >
> > In my opinion, this means glReadPixels(...,GL_DEPTH_COMPONENT,...)
> > should work. But I get for every pixel the value z=1.0 !!
> >
> >
> > Any idea why glReadPixels(...,GL_DEPTH_COMPONENT,...) douesn't work in
> > my application?
>
> If you have antialiasing enabled then you might have problem reading
> the Z-buffer, because then you have for every sub pixel a possible
> Z-value.

For OpenGL, you can read the Z buffer of a multisampled visual from IRIX 6.2
onwards. If you are running IRIX 5.3 on RealityEngine, you need patch 918 (or
one of its successors).

For RE or iR graphics the value returned is the depth stored at sample zero of
the pixel. Note that you do not need to turn multisampling off, nor do you have
to redraw the scene. In OpenGL you can either have a multisampled visual with a
multisampled Z buffer, or a non-multisampled visual with a non-multisampled Z
buffer. When using a multisampled visual, the same Z buffer is used when
multisampling is on or off.

I don't think any of this helps the above problem though, it looked like it
should work to me...

Wilfried, could you skim the test down to just OpenGL ? Sometimes that shakes
out a problem or at least makes it easier to debug...

Cheers
Rob

-- 
________________________________________________________________
Rob Jenkins mailto:robj++at++sgi.com
Silicon Graphics, Mtn View, California, USA
=======================================================================
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:57:06 PDT

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