900 likes | 918 Views
Visibility Driven Out-of-Core HLOD Rendering. Patrick Cozzi The University of Pennsylvania. 00000000 of 01010110. Project History. Procedurally generated model of Pompeii: ~1.4 billion polygons. Image from [Mueller06]. 00000001 of 01010110. Project History.
E N D
Visibility Driven Out-of-Core HLOD Rendering Patrick Cozzi The University of Pennsylvania 00000000 of 01010110
Project History Procedurally generated model of Pompeii: ~1.4 billion polygons. Image from [Mueller06] 00000001 of 01010110
Project History Boeing 777 model: ~350 million polygons. Image from http://graphics.cs.uni-sb.de/MassiveRT/boeing777.html 00000010 of 01010110
Contents • Previous Work • View Frustum and Occlusion Culling • Hardware Occlusion Queries (HOQ) • Level of Detail (LOD) • Hierarchical Level of Detail (HLOD) • Out-of-Core Rendering (OOC) 00000011 of 01010110
Contents Continued • Implementation Work • Vertex Clustering [Rossignac93] • HLOD Tree Creation • Primary Contribution: OOC Rendering • Results • Future Work • Demos throughout 00000100 of 01010110
culled culled culled View Frustum Culling • Can be slower than brute force. When? rendered rendered rendered 00000101 of 01010110
3 4 5 1 0 2 0 1 3 4 2 5 View Frustum Culling 00000110 of 01010110
3 4 5 1 0 2 0 1 3 4 2 5 View Frustum Culling 00000111 of 01010110
View Frustum Culling • Demo 00001000 of 01010110
culled Occlusion Culling • Effective in scenes with high depth complexity 0001001 of 01010110
Occlusion Culling • From-region or from-point • Most are conservative • Occluder Fusion • Difficult for general scenes with arbitrary occluders. So make simplifying assumptions: • [Wonka00] – urban environments • [Ohlarik08] – planets and satellites 00001010 of 01010110
Hardware Occlusion Queries • From-point visibility that handles general scenes with arbitrary occluders and occluder fusion • How? • Use the GPU 00001011 of 01010110
Hardware Occlusion Queries • Disable color and depth write Color Buffer Depth Buffer 00001100 of 01010110
Hardware Occlusion Queries • Disable color and depth write • Render BV using HOQ 00001101 of 01010110
Hardware Occlusion Queries • Disable color and depth write • Render BV using HOQ • Enable color and depth writes Color Buffer Depth Buffer 0001110 of 01010110
Hardware Occlusion Queries • Disable color and depth write • Render BV using HOQ • Enable color and depth writes • Render object based on HOQ results 00001111 of 01010110
Hardware Occlusion Queries class IQueryOcclusion { public: virtualvoid Begin() = 0; virtualvoid End() = 0; virtualbool IsResultAvailable() = 0; virtualunsignedint NumberOfSamplesPassed() = 0; virtualunsignedint NumberOfFragmentsPassed() = 0; }; 00010000 of 01010110
Hardware Occlusion Queries class IQueryOcclusion { public: virtualvoid Begin() = 0; virtualvoid End() = 0; virtualbool IsResultAvailable() = 0; virtualunsignedint NumberOfSamplesPassed() = 0; virtualunsignedint NumberOfFragmentsPassed() = 0; }; 00010000 of 01010110
Hardware Occlusion Queries class IQueryOcclusion { public: virtualvoid Begin() = 0; virtualvoid End() = 0; virtualbool IsResultAvailable() = 0; virtualunsignedint NumberOfSamplesPassed() = 0; virtualunsignedint NumberOfFragmentsPassed() = 0; }; 00001000 of 01010110
CPU Drawo1 Drawo2 Drawo3 GPU Drawo1 Drawo2 Drawo3 CPU Queryo1 -- stall -- Drawo1 GPU Queryo1 -- starve -- Drawo1 Hardware Occlusion Queries • CPU stalls and GPU starvation 00010001 of 01010110
Is Culling Enough? 00010010 of 01010110
Is Culling Enough? Now what? 0001011 of 01010110
Is Culling Enough? • Demo 00010100 of 01010110
Level of Detail • Generation: less triangles, simpler shader • Selection: distance, pixel size • Switching: avoid popping • Discrete, Continuous, Hierarchical 00010101 of 01010110
Discrete LOD 3,086 Triangles 52,375 Triangles 69,541 Triangles 00010110 of 01010110
Discrete LOD • Demo 00010111 of 01010110
Discrete LOD Not enough detail up close Too much detail in the distance 00011000 of 01010110
Continuous LOD edge collapse Image from [Luebke01] vertex split 00011001 of 01010110
Hierarchical LOD 1 Node 3,086 Triangles 4 Nodes 9,421 Triangles 16 Nodes 77,097 Triangles 00011010 of 01010110
Hierarchical LOD 1 Node 3,086 Triangles 4 Nodes 9,421 Triangles 16 Nodes 77,097 Triangles 00011011 of 01010110
Node Refinement Hierarchical LOD visit(node) { if (computeSSE(node) < pixel tolerance) { render(node); } else { foreach (child in node.children) visit(child); } } 00011100 of 01010110
Hierarchical LOD 00011101 of 01010110
Hierarchical LOD • New Problem: Cracks 00011110 of 01010110
Hierarchical LOD • Demo 00011111 of 01010110
HLOD + Culling visit(node) { if (node overlaps view frustum) { // ... } } 00100000 of 01010110
HLOD + Culling visit(node) { if (node overlaps view frustum) { render node’s BV with HOQ if (query.NumberOfFragmentsPassed() > 0) { // ... } } } Render front to back! 00100001 of 01010110
HLOD + Culling + VMSSE visit(node) { if (node overlaps view frustum) { render node’s BV with HOQ if (query.NumberOfFragmentsPassed() > 0) { if (computeVMSSE(node, query) < tolerance) { render(node); } else { // ... } } } } 00100010 of 01010110
VMSSE • VMSEE: Virtual Multiresolution SSE • Relative Visibility = # pixels visible / # possible pixels visible • VMSSE = f(SSE, Relative Visibility) 00100011 of 01010110
Optimized HLOD Refinement Driven by HOQs [Charalambos07] • Exploit spatial and temporal coherence for scheduling HOQs. • Predict refinement based on node’s relative visibility from previous frame • VMSSEiest = SSEi * biasi-1 00100100 of 01010110
Optimized HLOD Refinement Driven by HOQs [Charalambos07] • Example prediction • Refinement stopped for this node in previous frame • VMSSEiest < threshold ? Stop : Refine • Stop: • Issue query • Render without checking query 00100101 of 01010110
Implementation Work • 3 HLOD algorithms including [Charalambos07] • Vertex Clustering • HLOD Tree Creation • OOC Rendering • Load/Unload Rules • Rendering • Replacement Policy • Multithreading 00100110 of 01010110
Vertex Clustering [Rossignac93] • Fast: expected O(n) • Robustness: arbitrary topology • Capable of drastic simplification • “Easy to code” • OOC extensions [Lindstrom00] 00100111 of 01010110
0.8 1. Compute per-vertex weights 2. Assign vertices to clusters 3. Identify highest weighted vertex in each cluster 0.5 0.5 1 1 Vertex Clustering [Rossignac93] 00100111 of 01010110
Vertex Clustering [Rossignac93] 0.8 1. Compute per-vertex weights 2. Assign vertices to clusters 3. Identify highest weighted vertex in each cluster 4. Collapse and remove degenerate triangles 1 1 00101000 of 01010110
Vertex Clustering [Rossignac93] 3,086 Triangles 52,375 Triangles 69,541 Triangles 00101001 of 01010110
Vertex Clustering [Rossignac93] • Questionable Fidelity • Hard to control output • Conservative Error Metric 00101010 of 01010110
HLOD Tree Creation • Input • Model (.ply, .obj) • Target triangles per leaf node • Maximum tree depth • Output • 1 file per node • Normals computed at runtime 00101011 of 01010110
HLOD Tree Creation • Top-down • Root node: Full AABB Lowest Detail 00101100 of 01010110
HLOD Tree Creation • Splitting Planes 2 Planes 3 Planes 00101101 of 01010110
HLOD Tree Creation • Splitting Planes 00101110 of 01010110