Hierarchical Occlusion Map

20
Hierarchical Occlusion Map Zhang et al SIGGRAPH 98

description

Hierarchical Occlusion Map. Zhang et al SIGGRAPH 98. Basic Ideas. Choose a set of graphics objects from the scene as Occluder Use the occluder to define Occlusion Map (hierarchically) Compare the rest of scene against the occlusion map. Example. Blue: Occluders Red: Occludees. - PowerPoint PPT Presentation

Transcript of Hierarchical Occlusion Map

Page 1: Hierarchical Occlusion Map

Hierarchical Occlusion Map

Zhang et al

SIGGRAPH 98

Page 2: Hierarchical Occlusion Map

Basic Ideas Choose a set of graphics objects

from the scene as Occluder Use the occluder to define

Occlusion Map (hierarchically) Compare the rest of scene against

the occlusion map

Page 3: Hierarchical Occlusion Map

Example

Blue: OccludersRed: Occludees

Page 4: Hierarchical Occlusion Map

Algorithm Pipeline

Occluder Viewing Frustum Occluder Rendering Database Culling Selection

Build Occlusion Map Hierarchy

Real Viewing Frustum Occlusion Test Scene Culling

Page 5: Hierarchical Occlusion Map

2-Step Occlusion Test

1. Overlap Test 2. Overlap Test Overlap + Depth = Occlusion

Page 6: Hierarchical Occlusion Map

Why decomposition?

The occlusion test is done approximately (conservatively)

We can afford to be more conservative in depth test than overlap test

Page 7: Hierarchical Occlusion Map

Why Decomposition?

Page 8: Hierarchical Occlusion Map

Overlap Test – Occlusion Map

Representation of projection for overlap test: occlusion map

A gray scale image – each pixel represents one block of screen region

Generate by rendering occluders

Page 9: Hierarchical Occlusion Map

Occlusion Map (OM)

Each pixel of the occlusion map has an opacity, which represents the ratio of the sum of the opaque areas in the block to the total area.

If fully covered, p= 1, if anti-alised pixel, p <1)

Occlusion map: the alpha channel of an image

Page 10: Hierarchical Occlusion Map

Overlap Test using OM

For each potential occludee, we can scan-convert it and compare against the opacity of the pixels itoverlaps Expensive!!

• Conservative Approximation: use the screen-space bounding box of the occludee (a superset of the actual covered pixels) • If all the pixels inside the bounding box are opaque, the object is occluded.

Page 11: Hierarchical Occlusion Map

Hierarchical Occlusion Map

Like hierarchical Z-buffer, we can create a hierachy to speed up the comparison (for large objects)

The low resolution pixel is an average of the high resolution pixels

Page 12: Hierarchical Occlusion Map

Overlap Test using HOM

1. Start from the lowest resolution2. If the pixel cover the bounding rectangle has a value 1, the object is occluded3. Otherwise traverse down the hierarchy:

• If all children =1: occluded• If all children =0; not occluded• Otherwise, traverse down further

Basic Algorithm

Page 13: Hierarchical Occlusion Map

Approximate Overlap Test Instead of concluding an object is

occluded only when the bounding box is within pixels with opacity 1, we can use an threshold between [0,1]

Early termination in the high level of the hierarchy

What does it mean when a block has high opacity but not one?

This is the unique feature of HOM !!

Page 14: Hierarchical Occlusion Map

Depth Test (1)

Approximate Z (depth) test: A single Z Plane A single Z plane

to separate the occluders fromoccludees.

Page 15: Hierarchical Occlusion Map

Depth Test (2)

Break the screen into small regions

• Build at each frame• Instead of using Z-buffer, use the occluder’s bounding volume’s farthest Z • Compare each potential occludee’s nearest Z (con- servative test)

Page 16: Hierarchical Occlusion Map

Occluder Selection

Ideal occluder: the visible objects – it’s a jokeView-dependent occluder: too expensive (m^6 log m) – Wow!

Solution: Estimate and build an occluder database

Discard objects that do not server as good occluders

Page 17: Hierarchical Occlusion Map

Occluder Selection (2) Size: not too small Redundant: detail polygons (clock

on the wall) Complexity: Complex polygons are

not preferred (why?) Done at run time – sort the

occluders in depth, add them in order until reach the polygon count.

Page 18: Hierarchical Occlusion Map

Discussion Robust Very little assumption about

hardware Need high depth complexity Adpative occlusion culling

Page 19: Hierarchical Occlusion Map

Hardware Support Most of the aforementioned

algorithms need to be done by applications (software)

Hardware support is emerging – Example HP Visualize fx board (1997)

Page 20: Hierarchical Occlusion Map

HP hardware occlusion

Extend the OpenGL – add a OCCLUSION_MODE The bounding box of an object is scan converted

first A flag is set if any pixel of the BB faces is visible Only need to read back one flag, instead of the

entire frame buffer Tradeoff – valueable rendering time is used to

render useless BB faces (need to be used wisely) Reportedly 25%-100% speedup were observed