|
04/30/1999, Hybrid Visibility (HyVis)
|
For this entry I am going to talk about a visibility idea I've been kicking
around my head for a while. It's by no means new... or good. My description
may be terse but I will not, however, insult your intelligence by saying
it's really advanced stuff. Nevertheless, the following are the
requirements/recommendations for understanding this.
Requirements: Knowledge of S-Buffers. Search for the S-Buffer FAQ by Paul
Nettle (not a hard find)
Recommendation: "Hierarchical Z-Buffer Visibility", by Greene et al. You can
find this at the wonderful Grafix3D
Basically the visibility algorithm, which I will refer to as Hybrid
Visibility (or HyVis), that I will describe will propose a vis algorithm
which uses software techniques and, optionally, hardware.
You will need:
1. A hierarchical space subdivision scheme where each node (including leafs)
contain a bounding polyhedron (never actually displayed) and each leaf
contains a potential list of geometry.
2. A simple S-Buffer which only contains the Z-Buffer values (unless you're
using software rendering).
Basically, this is how HyVis works. Using a front to back traversal of the
scene from the given viewpoint/view-direction, you do the following.
1. Check the current node against the view frustum. If it doesn't pass go to
step 4.
2. Start scan converting the node's bounding polyhedron and enter it into
the S-Buffer. The instant you find a span which is even partially visible,
stop and go to step 3.
3. The current node is _potentially_ visible. If it's a leaf add the
geometry to the S-Buffer and then send it to the rasterizer to be drawn. If
it isn't a leaf, get the front-most child of the current node and go to step
1.
4. Get the next front-most node and go to step 1.
The this works is simple, it tests each node recursively against the results
of the already drawn scene. There are obviously some drawbacks and room for
improvement. I'll discuss some, if you have others, please bring them up.
1. Adding a dense mesh to the S-Buffer is inefficient. I can't think of any
effective way to use dense meshs for occlusion, sorry.
2. What you might want to do to help culling is to give dense meshes a
bounding polyhedron and apply the HyVis test to each of these bounding
polyhedrons to decide whether an individual dense mesh is visible or not.
3. If you stop scan-converting the bounding polyhedrons the instant a span
is found to be visible, you will have an unpredictable results because you
can get a best case scenario (top span is visible) or a worst case scenario
(bottom span is visible) which both will yield a visible node. To help this
out you can try span interleaving by testing "odd numbered" spans then, if
necessary, "even numbered" spans.
4. Personally, I recommend that if HW cards ever allow you to read in
Z-Buffers quickly, that you use the regular Hierarchical Z-Buffer Visibility
algorithm as it can use dense meshs for occlusion as easily as coarse
meshes.
Anyways, that's all I had to say... I think.
-- Anis Ahmad
07/24/1999 - Cartoon Rendering
04/30/1999 - Hybrid Visibility (HyVis)
This document may not be reproduced in any way without
explicit permission from the author and flipCode. All Rights Reserved.
Best viewed at a high resolution.
The views expressed in this document are the views of the author and NOT neccesarily of anyone
else associated with flipCode.
|