Date: Wed, 8 Apr 1998 16:55:17 +0200 From: Hans-Bernhard Broeker Message-Id: <199804081455.QAA29048@acp3bf.physik.rwth-aachen.de> To: ShawnH AT Probe DOT co DOT uk (Shawn Hargreaves) Cc: djgpp AT delorie DOT com Subject: Re: What is Z-sorting? Newsgroups: comp.os.msdos.djgpp Organization: RWTH Aachen, III. physikalisches Institut B Precedence: bulk > >> Lately I have been hering about somthing called Z-Sorting. What is > >> it? > > Z-buffering is an algorithm used to remove hidden surfaces when > > displaying 3d surfaces. The x and y coordinates (plotted on the [...] > You just described the depth sort algorithm, also known as a z-sort: > this is a totally different thing to a zbuffer. Isn't it funny how many interpretations such a seemingly innocent question can have? Original poster asked about z-*sorting*. Got an answer that deals with z-*buffering*, and that answer even happens to mean the wrong thing by that name. Instead, what he called 'z-buffering' is claimed to be 'z-*sorting*' now. (And by my book, it's neither of them, but actually closer to zbuffering with the order of operations mixed up) > Depth sorting is a very crude algorithm, where all the polygons in > a scene are sorted by distance from the camera and then drawn from [...] > but there are some cases that it just can't handle correctly, where > polygons intersect or overlap in some interleaved patterns. Just for the sake of correctness: this isn't the whole truth on depth-sorting. Actually, you *can* make depth-sorting correct, it just takes a bit more effort to get it right (been there, done that). Take Quake, as an example: AFAIK some of it uses BSP-trees, which can be viewed just as a clever approach to depth-sorting. And there are situation where you *need* one property of depth-sorting that is nearly impossible to do with z-buffering: the result of depth-sorting is still a set of polygons, not pixels, so you can use a vector graphic device or file format (postscript, e.g.) for output. That's why I (have to) stick to it in 'gnuplot'... BTW: To make the difference between the 'naive' implementation and full-fledged depth-sorting clear, the naive one is often called 'painter's algorithm', instead. > A zbuffer is a 100% accurate sorting method, where you store the > distance to each pixel as it is drawn, so that subsequent pixels can I have to raise a small objection to this: zbuffer is not '100%' accurate. It's exactly as accurate as the the pixel resolution you happen to apply it to. And as z-values are only stored at limited precision (often 16 bit fixed point), it may well be *less* precise than a well-though-out depth sorting algorithm that uses the full (floating point) precision of the geometric input. > For a proper discussion of things like this, comp.graphics.algorithms > is the place to go. I second that. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.