1 occlusion culling ©yiorgos chrysanthou, 1999-2001, anthony steed, 2004

21
Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

Upload: jodie-kelly

Post on 23-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

1

Occlusion Culling

©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

Page 2: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

2

Overview

Graphics Pipeline Problems• Speed up techniques

Occlusion Culling• Image-based• Object-based

Page 3: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

3

What’s wrong with the standard graphics pipeline?

It processes every polygon therefore it does not scale• Sometimes polygons than pixels• Pixels are being drawn multiple times

According to the statistics, the size of the average 3D model grows more than the processing power

Page 4: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

4

Speed Up Techniques

Roughly three classes:• Visibility culling

– Avoid processing anything that will not be visible in (and thus not contribute to) the final image

• Levels of detail – Generate several representations for complex objects

are use the simplest that will give adequate visual result from a given viewpoint

• Image based rendering– Replace complex geometry with a texture

Page 5: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

5

The Visibility Problem

Select the (exact?) set of polygons from the model which are visible from a given viewpoint

Average number of polygons, visible from a viewpoint, is much smaller than the model size

Page 6: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

6

Visibility Culling

Avoid rendering polygons or objects not contributing to the final image

We have three different cases of non-visible objects:• those outside the view volume (view volume

culling)• those which are facing away from the user (back

face culling)• those occluded behind other visible objects

(occlusion culling)

Page 7: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

7

Visibility Culling

Page 8: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

8

View Volume Culling

If a spatial subdivision exists, it can be used for view volume culling

Page 9: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

9

Occlusion Culling

Image-space methods• Generally analyse the partially completed image to

determine whether or not to render complete objects

Object-space methods• Provide methods for determining if sections of the

model need rendering due to what can be seen in the view volume

A very active topic of research in last 5 years, so there are many, many techniques

Page 10: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

10

Image-Based Occlusion

Occlusion maps• If you can order the polygons front to back,

then the image on the screen tells you areas which are obscured

• If, e.g. we find that one quarter of the screen is covered then we need not render anything in that quarter

• The problem devolves to finding good occluders, and occludees

Page 11: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

11

Testing for Occlusion If the box surrounding 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

occluder

Page 12: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

12

In Image Space

Render some set of objects as normal (foreground)

Read the image back

For other objects• Find bounding box• Test if those pixels

covered yet or not

Page 13: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

13

In Practice

Reading back the image is very slow with current graphics hardware

Fortunately recent graphics hardware can do occlusion queries for you• Instead of rendering it tells you whether or not any

pixels would be drawn

Of course have to make sure that doing the occlusion test is no more expensive that rendering the actual object!

Page 14: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

14

Cells and Portals(Teller and Sequin, SIGGRAPH 91)

Decompose space into convex cells For each cell, identify its boundary

edges into two sets: opaque or portal Precompute visibility among cells During viewing (eg, walkthrough

phase), use the precomputed potentially visible polygon set (PVS) of each cell to speed-up rendering

Page 15: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

15

Determining Adjacency Information

Page 16: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

16

For Each Cell Find Stabbing Tree

Page 17: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

17

Compute Cell Visible From Each Cell

S•L 0, L LS•R 0, R RLinear programming problem:

Find_Visible_Cells(cell C, portal sequence P, visible cell set V) V=V C for each neighbor N of C for each portal p connecting C and N orient p from C to N P’ = P concatenate p if Stabbing_Line(P’) exists then Find_Visible_Cells (N, P’, V)

Page 18: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

18

Eye-to-Cell Visibility

A cell is visible if• cell is in VV• all cells along stab tree

are in VV• all portals along stab

tree are in VV• sightline within VV

exists through portals

The eye-to-cell visibility of any observer is a subset of the cell-to-cell visibility for the cell containing the observer

Page 19: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

19

Image Space Cells and Portals (Luebke and Georges, I3D 95)

Instead of pre-processing all the PVS calculation, it is possible to use image-space portals to

make the computation easier

Can be used in a dynamic setting

Page 20: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

20

Top View Showing the Recursive Clipping of the View Volume

Page 21: 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004

21

Summary

Faster hardware encourages big models Real-time is maintained by visibility culling, level

of detail, image-based rendering Occlusion, part of visibility culling relies on

either• Being able to identify good occluders (image-based

occlusion)• Being able to structure the model to allow analytic

solutions (object-based occlusion)