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

Post on 23-Dec-2015

213 views 0 download

Tags:

Transcript of 1 Occlusion Culling ©Yiorgos Chrysanthou, 1999-2001, Anthony Steed, 2004.

1

Occlusion Culling

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

2

Overview

Graphics Pipeline Problems• Speed up techniques

Occlusion Culling• Image-based• Object-based

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

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

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

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)

7

Visibility Culling

8

View Volume Culling

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

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

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

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

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

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!

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

15

Determining Adjacency Information

16

For Each Cell Find Stabbing Tree

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)

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

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

20

Top View Showing the Recursive Clipping of the View Volume

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)