Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!McRCIM.McGill.EDU!peta From: peta@McRCIM.McGill.EDU (Peter Whaite) Newsgroups: comp.sys.sgi Subject: Re: zbuffer lrectread Keywords: lrectread readsource SRC_ZBUFFER zbuffer Message-ID: <1991Jun18.000218.5825@thunder.mcrcim.mcgill.edu> Date: 18 Jun 91 00:02:18 GMT References: Sender: news@thunder.mcrcim.mcgill.edu Reply-To: peta@McRCIM.McGill.EDU (Peter Whaite) Organization: McRCIM, McGill University Lines: 38 Nntp-Posting-Host: thunder.mcrcim.mcgill.edu In article , 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