Re: Z Buffer on Octane2

New Message Reply Date view Thread view Subject view Author view

From: Radomir Mech (rmech++at++engr.sgi.com)
Date: 05/17/2001 09:39:38


phowe++at++csc.com.au wrote:
>
> Hi,
>
> I'm wanting to read back values from the Z-buffer using glReadPixels and
> I have found I'm getting different values on an Octane2 compared to an
> Oynx2 and an O2. What I'm doing is using gluProject to convert a point
> in world space to screen space, and compare it with what gets read back
> from the Z buffer (to determine if the point is occluded by another
> object).
> On an Oynx2 and O2 the values match (more or less), but on an Octane2
> they are completely different. Now I have determined that the cause of the
> issue is due to the fact that we change the projection matrix to
> orthographic
> before the call to glReadPixels. If the call to glReadPixels is made before
> the projection matrix is changed, the values match.
>
> Does anybody know what is happening here, does the glReadPixels call
> use the projection matrix for converting the Z value somehow in openGl 1.2
> verses 1.1 ? Is there away to avoid this?
>
> The man pages mentions on option GL_DEPTH_COMPONENT24_SGIX,
> which I tried using but it gave me the same result.
>
> The tech spec on the Octane2 mentioned it has a24bit eye space Z buffer.
> What does that mean? Is that different to the Oynx2?
>
> Any Information would be appreciated.
>
> Thanks
>
> Peter
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: 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
.H 3 "Depth Buffer in Eye Space"

Hi Peter,

Release notes on Ocane2 say:

----
The Octane2 VPro graphics system stores eye Z values in the depth buffer
instead of device Z values as many other graphics chips do.
Specifically, it stores eye Z divided by eye W. Let us call this divided eye Z.
In addition, the eye Z values are stored in the depth buffer in an internal 
floating point representation.

Note: Eye coordinates are obtained by multiplying the object coordinates by the modelview matrix. Eye coordinates multiplied by the projection matrix yield clip coordinates. Clip coordinates divided by their W coordinates (clip W) result in device coordinates. ---- This should answer your question about the difference between Octane 2 and an Onyx2.

When reading from the depth buffer, the OpenGL driver needs to convert divided eye Z values stored in the depth buffer to device Z values the user expects. To do this it needs to access the projection matrix, to determine the distance to the near and far clip plane from the matrix and to apply these distances to convert divided eye Z values to device Z values. If you change the projection matrix, you will receive incorrect values.

Hope this helps, Radomir


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu May 17 2001 - 09:39:42 PDT

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