Optimized Subdivisions for Preprocessed Visibility Oliver Mattausch, Jiří Bittner, Peter Wonka, Michael Wimmer Institute of Computer Graphics and Algorithms Vienna University of Technology
Set of objects Object space subdivision Set of view cells View space subdivision For each view cell: Compute potentially visible set (PVS) Runtime Locate view cell Render PVS Oliver Mattausch 1 Visibility Preprocessing That’s what we are optimizing
2 objects3 objects4 objects Example: Object Space Subdivision Oliver Mattausch 2 Result: Set of objectsStart: 1 object (=scene) OBJ 1 OBJ 2 OBJ 3 OBJ 4
Oliver Mattausch 3 Example: View Space Subdivison VC3 View space VC1VC2 VC4 Result: Set of view cells Occluder
Oliver Mattausch 4 Object / View Space Subdivision City scene Object space subdivision View space subdivision
First subdivide object space Then subdivide view space Oliver Mattausch 5 Previous Approach VC1 VC3 VC2 VC4 View Space Occluder Triangle soup
Object space subdivision Bounding volume hierarchy (BVH) Surface area heuristic (SAH) View space subdivision kD-Tree Visibility-Driven View Space Construction [Mattausch06] Oliver Mattausch Previous Approach BVH Parent bounding box 6
Oliver Mattausch 7 Visibility-Based View Space Construction BSP [Teller 92]Visibility-Based LowHigh Render cost
Motivation Focus of previous work either on Object space subdivision View space subdivison But the problem is interconnected! Oliver Mattausch 8 VC3 VC1VC2 VC4
Object space subdivision too shallow Oliver Mattausch 9 Motivation: Previous approach VC1VC2 VC4 View Space High render cost VC3 Triangles per view cell: 4.5 Objects per view cell: 1
Object space subdivision too deep + High render cost (setup cost per object!) Oliver Mattausch 10 Motivation: Previous approach VC1 VC3 VC2 VC4 View Space High storage cost Triangles per view cell: 2.25 Objects per view cell: 2.25
Object space subdivision optimal Oliver Mattausch 11 Motivation: Previous approach VC1 VC3 VC2 VC4 View Space Low render + storage cost Triangles per view cell: 2.25 Objects per view cell: 1
Motivation Previous approach Object space subdivision: Can be too shallow / too deep View space subdivision cannot fix this! Our approach Interleave view and object space splits
Oliver Mattausch 13 Our Approach: Interleaved Subdivisions We search optimal combined subdivisions for a given memory budget Very complex problem greedy algorithm Treat view / object space splits equally Apply next best split Either view or object space
Oliver Mattausch 14 Example: Sphere through hole LowHigh Render cost Sphere View space - algorithm subdivides high render cost regions - algorithm subdivides only visible front Sphere can be seen only through hole
Oliver Mattausch 15 Our Approach: Outline Visibility sampling Estimate render cost 2. Interleaved subdivisions Interleave view and object space splits
Oliver Mattausch 16 Visibility Sampling Fast stochastic sampling Casts rays from viewpoints towards scene objects Coarse estimate of visibility View space = scene bounding box View space = distant region
Oliver Mattausch 17 Render Time Heuristics Minimize expected rendering time S = set of view cells p = probability of view point inside a view cell (~volume of view cell) r = render time estimate [Wimmer03] c = expected rendering time (cost to minimize)
Objects seen from both parts Memory cost increase Compute render cost decrease due to split Oliver Mattausch 18 View Space Split: Evaluation Left PVS: 6 objectsRight PVS: 6 objects View cell Visibility sampling Split plane Obj PVS: 8 objects Occluder
Oliver Mattausch 19 Object Space Split: Evaluation Dual to view space split View cells which see only one side of the split: Reduction of # triangles in PVS
Oliver Mattausch 20 Interleaved Subdivisions Each split (view / object) induces Render cost decrease Memory cost increase Leaves of view or object space hierarchy: Compute local split plane Candidates for the next split View space hierarchyObject space hierarchy Split candidates
Oliver Mattausch 21 Interleaved Subdivisions Decrease render cost until memory budget is reached Related to knapsack problem Items: Candidates for next split Benefit: Render time decrease Cost: Memory cost increase
Object space Priority queue of candidates for a split Priority p = dR / dM dR = render time decrease dM = memory cost increase Apply next best split: Oliver Mattausch 22 Interleaved Subdivisions Render cost Memory Object space split View space split View space Limit
Oliver Mattausch 23 Interleaved Subdivisions: Complexity Each split affects other candidates for a split Full reevaluation would be very costly We use some optimizations Object space split - affects all view cells which see this object
Oliver Mattausch 24 Optimized Algorithm 1.Start with very coarse object space subdivision Use surface area heurisic Alternatively, split by materials, size 2.Choose next best split (view or object) 3.Apply batch of splits From either view or object space 4.For split candidates affected by previous splits Reevaluate some random candidates
Oliver Mattausch 25 Results Our method vs. previous approach Previous approach: Sequential subdivision (SEQ-n) First object space (n objects) Then view space [Mattausch et al. EGSR06] Our method: Interleaved subdivisions ( INT) All methods: Subdivide until memory budget is reached
Oliver Mattausch 26 Results Arena 1.5M triangles Coarse visibility: 5M visibility samples 30 MB memory budget Evaluation: We use the full visibility solution
Oliver Mattausch 27 Results Arena Render cost Memory cost (MB) Speedup of 2.72 – 4.45
Oliver Mattausch 28 Results Arena: Timings MethodTime [min] SEQ-1K10.3 SEQ-30K10.8 SEQ-60K11.0 INT30.3
Oliver Mattausch 29 Conclusions View and object space subdivisions interconnected Interleave subdivisions Greedy algorithm for solving complex problem Coarse estimate of visibility Good results with 5M samples or more Further investigate required sample density Adaptive version
Funded by GameTools Project Leading edge 3D research Geometry/Plants, Visibility, Illumination C++ & Direct3D 9/OpenGL Free for European companies Oliver Mattausch 30
Oliver Mattausch 31 Optimized Subdivisions Thank you for your attention!
Oliver Mattausch 32 Results Arena Ratio view / object space splits # Splits
Object Space Split: Evaluation View cells seeing object View cells see both parts View cells see left part View cells see right part Visibility samplingSplit plane Object 33 Oliver Mattausch Occluder
Oliver Mattausch 34 Results Arena (Parameter set 1) Render cost Memory cost (MB) Speedup of 1.22 – 3.08
Oliver Mattausch 35 Results Arena Ratio view / object space splits # Splits
Oliver Mattausch 36 Results Arena: Statistics MethodTime [min]View cellsObjects SEQ-1K SEQ-30K SEQ-60K INT
Oliver Mattausch 37 Visibility-Based Object Splits Use visibility-based heuristics for local split Place split plane with respect to minimal cost Sweep algorithm for finding split plane
Render Time Heuristics Render time estimate Plug in any suitable model E.g., a simple model: max (a * # triangles, b * # objects, c * # pixels) Fit parameters to requirements of the engine Oliver Mattausch 38
Objects seen from both parts Memory cost increase Compute render cost decrease due to split Oliver Mattausch 39 View Space Split: Evaluation Left PVS: 6 objectsRight PVS: 6 objects View cell Visibility sampling Split plane Obj PVS: 8 objects Occluder