Hierachical Z-Buffering for occlusion culling
Asked Answered
A

1

6

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?

Apron answered 29/11, 2015 at 15:53 Comment(6)
May be a good idea to also ask this on gamedev.stackexchange.com.Versicular
Isn't it unethical to ask the same question in different forums?Apron
I don't think so, no.Versicular
About the hierarchical z-pyramid side, just from a broad conceptual level (never implemented occlusion culling myself), the benefit of this kind of representation of the depth buffer is early rejection. Let's say you rendered a plane which covers the entire viewport. It doesn't have to be perpendicular, but let's say its maximum depth is 0.5. In that case, you can actually store a 1-pixel Z-Buffer at the root of this hierarchy with a value of 0.5. Now, any time you draw any object, it can be rejected by the depth test early by just looking at this one-pixel buffer and seeing that no part of...Nada
... the object would have a depth which is less than 0.5 (ex: by projecting its AABB and checking the furthest point). It also means you get more temporal locality on the upper levels of this depth hierarchy which only requires a small number of pixel entries. It gets a lot more involved with the way this interacts with shaders, but that would be the kind of broad conceptual reason for a depth buffer hierarchy.Nada
gamedev.stackexchange.com/questions/112155/…Balsaminaceous
D
3
  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.

Discriminatory answered 2/5, 2019 at 0:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.