visibility culling

Download Visibility Culling

Post on 22-Feb-2016

33 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

Visibility Culling. David Luebke Computer Science Department University of Virginia . Motivation. Like most other rendering acceleration techniques, the goal is to avoid rendering redundant geometry The basic idea: don’t render what can’t be seen - PowerPoint PPT Presentation

TRANSCRIPT

  • Visibility CullingDavid LuebkeComputer Science DepartmentUniversity of Virginia

  • MotivationLike most other rendering acceleration techniques, the goal is to avoid rendering redundant geometryThe basic idea: dont render what cant be seenOff-screen: view-frustum cullingOccluded by other objects: occlusion culling

  • MotivationThe obvious question: why bother?Off-screen geometry: solved by clippingOccluded geometry: solved by Z-bufferThe (obvious) answer: efficiencyClipping and Z-buffering take time linear to the number of primitives

  • The GoalOur goal: quickly eliminate large portions of the scene which will not be visible in the final imageNot the exact visibility solution, but a quick-and-dirty conservative estimate of which primitives might be visibleZ-buffer& clip this for the exact solutionThis conservative estimate is called the potentially visible set or PVS

  • Visibility CullingThe remainder of this talk will cover:View-frustum culling (briefly)Occlusion culling in architectural environments General occlusion culling

  • View-Frustum CullingAn old idea (Clark 76):Organize primitives into clumpsBefore rendering the primitives in a clump, test a bounding volume against the view frustumIf the clump is entirely outside the view frustum, dont render any of the primitivesIf the clump intersects the view frustum, add to PVS and render normally

  • Efficient View-Frustum CullingHow big should the clumps be?Choose minimum size so: cost testing bounding volume
  • Efficient View-Frustum CullingWhat shape should bounding volumes be?Spheres and axis-aligned bounding boxes: simple to calculate, cheap to testOriented bounding boxes converge asymptotically faster in theoryLots of other volumes have been proposedCapsules, ellipsoids, k-DOPsbut most use spheres or AABBs.

  • Cells & PortalsGoal: walk through architectural models (buildings, cities, catacombs)These divide naturally into cellsRooms, alcoves, corridors Transparent portals connect cellsDoorways, entrances, windows

    Notice: cells only see other cells through portals

  • Cells & PortalsAn example:

  • Cells & PortalsIdea: Cells form the basic unit of PVSCreate an adjacency graph of cellsStarting with cell containing eyepoint, traverse graph, rendering visible cells A cell is only visible if it can be seen through a sequence of portalsSo cell visibility reduces to testing portal sequences for a line of sight

  • Cells & PortalsADHFCBEGHBCDFGEA

  • Cells & PortalsADHFCBEGHBCDFGEA

  • Cells & PortalsADHFCBEGHBCDFGEA

  • Cells & PortalsADHFCBEGHBCDFGEA

  • Cells & PortalsADHFCBEGHBCDFGEA

  • Cells & PortalsADHFCBEGHBCDFGEA??

  • Cells & PortalsADHFCBEGHBCDFGEAXX

  • Cells & PortalsView-independent solution: find all cells a particular cell could possibly see:

    C can only see A, D, E, and HADHE

  • Cells & PortalsView-independent solution: find all cells a particular cell could possibly see:

    H will never see FADCBEG

  • Cells and PortalsQuestions:How can we detect whether a given cell is visible from a given viewpoint?How can we detect view-independent visibility between cells?The key insight: These problems reduce to eye-portal and portal-portal visibility

  • Cells and PortalsAirey (1990): view-independent onlyPortal-portal visibility determined by ray-casting Non-conservative portal-portal test resulted in occasional errors in PVSSlow preprocessOrder-of-magnitude speedups

  • Cells and PortalsTeller (1993): view-independent + view-dependentPortal-portal visibility calculated by line stabbing using linear programCell-cell visibility stored in stab trees View-dependent eye-portal visibility stage further refines PVS at run timeSlow preprocessElegant, exact scheme

  • Cells and PortalsLuebke (1995): view-dependent onlyEye-portal visibility determined by intersecting portal cull boxesNo preprocess (integrate w/ modeling)Quick, simple hackPublic-domain library: pfPortals

  • pfPortals AlgorithmDepth-first adjacency graph traversalRender cell containing viewerTreat portals as special polygonsIf portal is visible, render adjacent cellBut clip to boundaries of portal!Recursively check portals in that cell against new clip boundaries (and render) Each visible portal sequence amounts to a series of nested portal boundaries Kept implicitly on recursion stack

Recommended

View more >