image space occlusion culling - taudcor/graphics/adv-slides/short-image-based-cullin… ·...

24
1 Image Space Occlusion Culling Image Space Occlusion Culling

Upload: others

Post on 26-Jul-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

1

Image Space Occlusion CullingImage Space Occlusion Culling

Page 2: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

2

Hudson et al, SoCG 97

CB

AViewpoint

Occluder

umbra

Page 3: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

3

What Methods are Called Image-Space?

• Those where the decision to cull or render is done after projection (in image space)

View volume

Object space hierarchy

Decision to cull

Two classic examples– Hierarchical Z-Buffer [HBZ93]– Hierarchical Occlusion Maps [HOM97]

Page 4: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

4

Ingredients of an Image Space Method

• An object space data structure that allows fast queries to the complex geometry

Space partitioning

Hierarchicalbounding boxes Regular grid

Page 5: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

5

An image space representation of the occlusion information

• Discrete– Z-hierarchy– Occlusion map hierarchy

• Continuous – BSP tree– Image space extends

Page 6: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

6

General Outline of Image Space Methods

• During the (front-to-back) traversal of the scene hierarchy do:– compare each node against the view volume– if not culled, test node for occlusion – if still not culled, render objects/occluders

augmenting the image space occlusion

Page 7: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

7

Testing a Node for Occlusion• If the box representing a node is not visible then

nothing in it is either• The faces of the box are projected onto the image

plane and tested for occlusion

Page 8: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

8

Testing a Node for Occlusion• If the box representing a node is not visible then

nothing in it is either• The faces of the box are projected onto the image

plane and tested for occlusion

Page 9: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

9

Hierarchical Tests

O

Page 10: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

10

Hierarchical Tests

O

Page 11: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

11

Hierarchical Tests

O

Page 12: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

12

Differences of Algorithms

• The most important differences between the various approaches are:

– the representation of the (augmented) occlusion in image space and,

– the method of testing the hierarchy for occlusion

Page 13: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

13

Hierarchical Z-Buffer (HZB) (Ned Greene, Michael Kass 93)

• An extension of the Z-buffer VSD algorithm • It follows the outline described above.• Scene is arranged into an octree which is

traversed top-to-bottom and front-to-back.• During rendering an occlusion map is

incrementally built.• Octree nodes are compared against

occlusion map.• The occlusion map is a z-pyramid…

Page 14: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

17

The Z-PyramidObjects arerendered

Depth takenfrom the z-buffer

Construct pyramid by taking max of each 4

= furthest= closer= closest

Page 15: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

20

Maintaining the Z-Pyramid

• Ideally every time an object is rendered causing a change in the Z-buffer, this change is propagated through the pyramid

• However this is not a practical approach

Page 16: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

21

More Realistic Implementation

• Make use of frame-to-frame coherence:– at start of each frame render the nodes that

were visible in previous frame– read the z-buffer and construct the z-pyramid – now traverse the octree using the z-pyramid

for occlusion but without updating it

Cool idea!

Page 17: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

22

HZB: discussion

• It provides good acceleration in very dense scenes

• Getting the necessary information from the Z-buffer is costly

• A hardware modification was proposed for making it real-time

Page 18: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

23

Hierarchical Occlusion Maps (Hansong Zhang et.al 97)

Similar idea to HZB but:– they separate the coverage information

from the depth information, two data structures

• hierarchical occlusion maps• depth (several proposals for this)

Page 19: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

24

HOM:Algorithm Outline

– Select occluders until the set is large enough– Build occlusion representation– Occlusion culling & final rendering

Page 20: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

25

Demonstration

Blue parts: Blue parts: occludersoccluders Red parts: Red parts: occludeesoccludees

Page 21: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

27

Occlusion Map Pyramid

64 x 64 32 x 32 16 x 16

Page 22: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

29

Occlusion Map Pyramid

Page 23: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

32

Set of Occluders Occlusion Map

Representing Occluders

Page 24: Image Space Occlusion Culling - TAUdcor/Graphics/adv-slides/short-image-based-cullin… · occlusion map. • The occlusion map is a z-pyramid… 17 The Z-Pyramid Objects are. rendered

35

Aggressive Approximate culling

0 1 2 3 4