4
\$\begingroup\$

I'm reading Hierarchical z-Buffer Visibility by Ned Greene et al. and they state that

traditional Z buffering makes reasonably good use of image-space coherence in the course of scan conversion.

I don't see how the z-buffer algorithm that I know makes use of image-space coherence at all. In the paper, they state that

implementations usually do a set-up computation for each polygon and then an incremental update for each pixel in the polygon.

How exactly is this "set-up computation" and "incremental update" defined?

\$\endgroup\$
  • \$\begingroup\$ You might try asking on this on e.g. the opengl.org forums. \$\endgroup\$ – Engineer Mar 23 '16 at 11:56
  • \$\begingroup\$ @ArcaneEngineer I don't think that this a question of a specific implementation (I suppose your advice is motivated by the "implementations usually ..." part), but of algorithm design. \$\endgroup\$ – 0xbadf00d Mar 23 '16 at 12:24
  • \$\begingroup\$ In truth it would probably be speculation on the part of most here to give you a straight answer on what are, at the end of the day, hardware-specific implementation details, yes. The same is true of the "scan conversion" part. But maybe here someone will know. I'm just trying to help you accelerate your search. \$\endgroup\$ – Engineer Mar 23 '16 at 13:10
  • \$\begingroup\$ @ArcaneEngineer No offense to you, but I don't think that these are (hardware-specific) implementation details. Don't focus on the "implementations usually ..." part. I'm not interested in specific implementations. I just want to know in which sense the traditional z-buffer algorithm is image-space coherent and how we need to alter (abstractly) it in order to use "incremental updates". \$\endgroup\$ – 0xbadf00d Mar 23 '16 at 13:19
  • \$\begingroup\$ You might have better luck on computergraphics.stackexchange.com \$\endgroup\$ – opa Mar 31 '18 at 17:39
0
\$\begingroup\$

It seems to me that the setup refers to calculating the the Z values (as these can be determined a polygon at a time, once per frame) & the update is comparing a pair of Z values to update the pixel color as needed.

In terms of implementation, I've always seen it presented in an interleaved fashion (much like your definition link), but conceptually, you can think of them as separate steps.

\$\endgroup\$
0
\$\begingroup\$

I would say the traditional Z-buffer algorithm is temporally coherent in image-space. That is to say that, frame by frame, given fine adjustments of camera position and orientation, you are likely to see a lot of similarities between temporally-adjacent frames (frame N and N+1, for example).

I remember reading about the concept some years ago, for accelerating global illumination and/or raytracing(?). Here is a source that discusses this as an optimisational approach.

\$\endgroup\$
  • \$\begingroup\$ It's not merely time coherence, there is also a reasonably high probability that the adjacent scan-segments in succesive scanlines themselves also belong to the same polygones, but with slight displacements. So starting with a copy of the previous line could be a way to optimize memory operations. If the scene is rather static or slow moving you would have a stronger benefit. \$\endgroup\$ – StarShine May 7 '18 at 17:49
  • \$\begingroup\$ You are indeed right about the ray tracing use of Z buffer for a more real time. In fact, if I get time, I can dig up a technical demo where the previous frames data is used to determine next frames ray tracing (and reuse the previous frame to refine the frame outcome). \$\endgroup\$ – ErnieDingo Aug 20 '18 at 3:09
0
\$\begingroup\$

The Z-Buffer algorithm itself does not use image-space coherence concept, it works exactly as we know. But the result of this algorith is quite coherent, which means that for any given pixel there's a big chance that neighboring pixels have similar value.

This property (image-space coherence) of Z-Buffer data makes it possible to use i.e. Quad-Tree to make some tests faster. (If you had noise in ZBuffer then there's no point in using QuadTree over such data).

So in short: The coherence of data coming from traditional Z-Buffer makes it reasonable to use Hierarchical Visibility tests.

I hope this answers your first question. For the second let's say you're writing your own ZBuffer and you want to add a feature of Hierarchical Visibility tests. You have a grid of Z values already and you add a QuadTree, which contains min/max values for each node. At start you initialize those structures as needed.

Then you render a pixel, you compute its Z and test it with latest Z value of this pixel. If it's visible you store the new Z value but you also need to update the Quad-Tree and this is the 'incremental update' part.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.