Re: Z-Buffer Problem

New Message Reply Date view Thread view Subject view Author view

Allan Schaffer (aschaffe)
Fri, 13 Sep 1996 16:31:36 -0700


On Sep 13, 3:41pm, Janet Estabridis wrote:
> I need to read the z-buffer in order to do range calculations. I have a
> Performer 2.0 program with a draw callback routine in which I do the
> following:
>
> pfClearChan( chan );
> pfDraw();
> glReadPixels(0,0,360,120,zBuffer);
>
> My array zBuffer is always ZERO !!! eventhough I see my image in the
> window.
>
> I have successfully read and processed the zbuffer in OpenGL code. I
> was told at my Performer 2.0 class a few weeks ago how to properly do a
> draw callback routine but either I am missing something or there is a
> problem reading the zbuffer from Performer 2.0. Can anyone help ??

Are you using a multisample visual? If so, it won't work --
glReadPixels can only read the 'regular' Z buffer. It's not possible
to read the multisample Z buffer (either on RE or IR).

I would wager you get zero's because the call to glReadPixels is
reading the standard Z buffer, but none of the "real" Z data is
stored there.

If that's not it -- i also have a vague recollection that texture
needs to be disabled for glReadPixels to work..

Allan

-- 
Allan Schaffer                                             aschaffe++at++sgi.com
Silicon Graphics                            http://reality.sgi.com/aschaffe
=======================================================================
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:32 PDT

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