zbuffer lrectread

Peter Whaite peta at McRCIM.McGill.EDU
Tue Jun 18 10:02:18 AEST 1991


In article <acas.676654349 at godzilla>, mpapp@ (Mike Papper) writes:
> I have been trying to read the contents (of a small area) of the 
> zbuffer using lrectread. All I seem to get is a smattering of
> 16777216s (i.e. almost 2 * 8388607 i.e. 2 * 0x7FFFFF), sometimes
> mixed in with other values.
> ...
> ... deleted
> ...
> Does anyone have some strightforward code that reads the numeric zbuffer values
> from the current zbuffer? (These values shouyld always
> be in the range used in lsetdepth(near, far)).
> 
> Email responses would be preffered.

I'd like to know the answer to this as well.  I'm using the z-buffer to simulate
laser range scanner data from the surface of superellipsoid models.  My hack was
to read both the color and the z-buffers.  I render shaded white models onto a
black background so I use the colour to tell whether I am looking at background
or at the model's surface.  I found that the z buffer values in the backgound
were garbage, and not z-far as one would expect.  The values on the model are
correct.  

I was under the impression that the z buffer value at a screen coord changed
only if something was rendered there.  If not it remained at the previous value.
zclear() doesnt seem to write z-far values into the buffer.  I suspect it sets a
flag somewhere that effectively does this for the graphics engine, but,
unfortunately, not for lrectread.

The machine is a Personal IRIS w. turbo graphics, running IRIX 3.3.2.  It'd be
nice if someone at SGI could clear this one up.  I wasted an embarassing amount
of time on it.


Peter Whaite,
McGILL Research Centre for Intelligent Machines
McGILL UNIVERSITY
Montreal



More information about the Comp.sys.sgi mailing list