Culling Techniques - PowerPoint PPT Presentation

About This Presentation
Title:

Culling Techniques

Description:

... it is possible to use image-space portals to make the computation easier Can be used in a ... then we re done, don t need to render or traverse ... – PowerPoint PPT presentation

Number of Views:71
Avg rating:3.0/5.0
Slides: 41
Provided by: TomasM3
Category:

less

Transcript and Presenter's Notes

Title: Culling Techniques


1
Culling Techniques
  • To cull means to select from group
  • In graphics context do not process data that
    will not contribute to the final image
  • The group is the entire scene, and the
    selection is a subset of the scene that we do not
    consider to contribute

2
Culling Overview
  • Backface culling
  • Hierarchical view-frustum culling
  • Portal culling
  • Detail culling
  • Occlusion culling

3
Culling examples
4
Backface Culling
  • Simple technique to discard polygons that faces
    away from the viewer
  • Can be used for
  • closed surface (example sphere)
  • or whenever we know that the backfaces never
    should be seen (example walls in a room)
  • Two methods (screen space, eye space)
  • Which stages benefits? Rasterizer, but also
    Geometry (where test is done)

5
Backface culling (contd)
  • Often implemented for you in the API
  • OpenGL glCullFace(GL_BACK)
  • How to determine what faces away?
  • First, must have consistently oriented polygons,
    e.g., counterclockwise

2
2
0
1
0
front facing
back facing
1
6
How to cull backfaces
1
2
back
2
eye
1
front
0
0
front
back
screen space
eye space
7
View-Frustum Culling
  • Bound every natural group of primitives by a
    simple volume (e.g., sphere, box)
  • If a bounding volume (BV) is outside the view
    frustum, then the entire contents of that BV is
    also outside (not visible)
  • Avoid further processing of such BVs and their
    containing geometry

8
Can we accelerate VF culling further?
  • Do what we always do in graphics
  • Use a hierarchical approach, e.g, the
    scene graph
  • Which stages benefits?
  • Geometry and Rasterizer
  • Bus between CPU and Geometry

9
Example of Hierarchical View Frustum Culling
camera
10
Culling examples
11
Cells and Portals
  • Airey90, Teller91, Luebke95

12
Cells and Portals
  • For each cell, create a list (set) of potentially
    visible objects (or PVS) from any viewpoint in
    the cell.
  • During run-time
  • Determine cell of the current eye-point and gets
    its PVS.
  • Cull down this list by clipping to the viewing
    frustum.
  • Render this set.

13
Determining the PVS
  • Two options
  • Static (preprocessing stage)
  • Cell-to-cell visibility
  • Cell-to-region visibility
  • Cell-to-object visibility
  • Leads to very large and complicated data
    structures.
  • Dynamic (dependent on the viewing frustum)
  • Eye-to-cell
  • Eye-to-region
  • Eye-object

14
Cells and Portals(Teller and Sequin, SIG 91)
  • Decompose space into convex cells
  • For each cell, identify its boundary edges into
    two sets opaque or portal
  • Pre-compute visibility among cells
  • During viewing (e.g., walkthrough phase), use the
    pre-computed potentially visible polygon set
    (PVS) of each cell to speed-up rendering

15
Determining Adjacent Information
16
Cell-to-Cell Visibility
  • For Each Cell Find Stabbing Tree

17
Compute Cells Visible From Each Cell
Linear programming problem
18
Cell-to-Region Visibility
  • The cell-to-region visibility is a subset of the
    cell-to-cell visibility for the current cell.
  • 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

19
Cell-to-Region Visibility
  • The cell-to-object visibility is a list of those
    objects that are in the visible regions.

20
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

21
Top View Showing the Recursive Clipping of the
View Volume
22
Portal Culling
Images courtesy of David P. Luebke and Chris
Georges
  • Average culled 20-50 of the polys in view
  • Speedup from slightly better to 10 times

23
Portal culling example
  • In a building from above
  • Circles are objects to be rendered

24
Portal Culling Algorithm
  • Divide into cells with portals (build graph)
  • For each frame
  • Locate cell of viewer and init 2D AABB to whole
    screen
  • Render current cell with VF cull w.r.t. AABB
  • Traverse to closest cells (through portals)
  • Intersection of AABB AABB of traversed portal
  • Goto

25
Portal overestimation
  • To simplify

actual portal
overestimated portal
26
Portal Culling Algorithm
  • When to exit
  • When the current AABB is empty
  • When we do not have enough time to render a cell
    (far away from the viewer)
  • Also mark rendered objects
  • Which stages benefits?
  • Geometry, Rasterizer, and Bus
  • Source (for Performer-based pfPortal)
    http//www.cs.virginia.edu/luebke/

27
Replacing Geometry with Images
  • Algorithm
  • Select subset of model
  • Create image of the subset
  • Cull subset and replace with image
  • Why?
  • Image displayed in (approx.) constant time
  • Image reused for several frames

28
Portal Images
  • Aliaga97

29
Simple Example
30
Simple Example
31
Simple Example
32
Creating Portal Images
Ideal portal image would be one sampled from the
current eye position
portal
eye
33
Creating Portal Images
Reference COPs
Display one of a large number of pre-computed
images (120)
34
Creating Portal Images
Reference COPs
or Warp one of a much smaller number of
reference images
portal
35
Example Rendering
Geometry

Final Scene
Image
36
Discussion on Object Space
  • Visibility culling with large occluders
  • good for outdoor urban scenes where occluders are
    large and depth complexity can be very high
  • not good for general scenes with small occluders
  • Cells and portals
  • gives excellent results IF you can find the cells
    and portals
  • good for interior scenes
  • identifying cells and portals is often done by
    hand

37
VISUALIZE fxs Occlusion Culling Algorithm
  • Algorithm (extension to OpenGL)
  • Scan convert faces of object, typically bounding
    box of complex object, but do not write Z
  • Get boolean which says if there was a Z-value
    from scan conversion that was closer than that of
    the Z-buffer (NVIDIA get pixels seen count)
  • If seen, render complex object

38
VISUALIZE fxs Occlusion Culling Algorithm
(contd)
  • Implications
  • If an object is occluded, then we gain
    (hopefully) a lot of performance since we only
    scan convert one Bounding Box (BB) instead of the
    entire object
  • If BB is not occluded, then we have to render the
    object, and we lose a little performance
  • Drawing order matters drawing front-to-back
    gives more occlusion

39
Real-Time Rendering?
  • In computer graphics, real-time is used in a
    soft way say gt30 fps for most frames
  • In other contexts, its a tougher requirement
    the framerate must never be lt30 fps, i.e.,
    constant framerate
  • What can we do?
  • Reactive LOD algorithm
  • Reactive detail culling
  • Reactive visual quality

40
Resources and Pointers
  • http//www.realtimerendering.com
  • Journal of Graphics Tools
  • http//www.acm.org/jgt/
  • source for projected screen area of box
  • intersection test routines
  • occlusion culling
  • http//www.magic-software.com
Write a Comment
User Comments (0)
About PowerShow.com