Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hierachical Z-Buffering for occlusion culling

I'm reading the Occlusion Culling section in Real-Time Rendering 3rd Edition and I couldn't understand how it works. Some questions:

  1. How does having a "Z-pyramid" contribute? Why do we need multiple resolutions of the Z-buffer? In the book, it's displayed as follows (left side): enter image description here

  2. Is the Octree structure the same Octree that is used for general frustum culling and rendering? Or is it a specialized Octree made just for the occlusion culling technique?

  3. A more general question: In a previous section (and also here), the Occlusion Query term is described as "rendering a simplified bounding-volume of an object and comparing it's depth results to the Z-buffer, returning the amount of pixels that are visible." What functions in OpenGL are associated with this Occlusion Query concept?

  4. Is this technique the standard for open-world games occlusion culling?

like image 905
Pilpel Avatar asked Oct 19 '22 21:10

Pilpel


1 Answers

  1. Hierarchical Z-buffer is useful in situations when large nearby objects are likely to occlude a lot of small farther objects. An example would be rendering an inside of a building or a mountainous landscape.

    When the nearby object is rendered it would set a pixel somewhere on a lower-resolution level of the Z buffer pyramid to a near depth value. When a farther smaller object is being rendered, its bounding box can first be checked against that pixel and be culled in its entirety.

  2. Yes. It's the same octrees. But it doesn't have to be an octree. Any hierarchical spacial indexing data structure would work for both, hierarchical Z-buffer or frustum culling.

    In order to benefit from the hierarchical Z-buffer we would need to render the scenery starting with the nearest objects. Techniques like octrees or BSPs can be used for that.

    Additionally, having an octree at hand lets us cull entire tree branches based on the distance to their bbox rather than separate objects or triangles.

  3. The part of OpenGL that's responsible for occlusion queries is: glBeginQuery, glEndQuery and glGetQueryObject. See Query Objects for details.

  4. Hierarchical Z buffers were implemented in hardware on some early Radeons. However I didn't hear of it being used nowadays.

    Occlusion queries, on the other hand, are normally used. They, in essence, give similar benefits.

like image 61
Yakov Galka Avatar answered Nov 09 '22 20:11

Yakov Galka