840 likes | 1.05k Vues
使用分散式可視性裁切法之複雜場景顯像環境設計 A Fast Walkthrough System based on Distributed Visibility Culling Techniques. 盧天麒 國立嘉義大學資訊工程系 tclu@mail.ncyu.edu.tw http://web.ncyu.edu.tw/~tclu. Outline. Introduction Classification of Occlusion C ulling Instant Visibility Cell Arrangement Policy
E N D
使用分散式可視性裁切法之複雜場景顯像環境設計A Fast Walkthrough System based on Distributed Visibility CullingTechniques 盧天麒 國立嘉義大學資訊工程系 tclu@mail.ncyu.edu.tw http://web.ncyu.edu.tw/~tclu
Outline • Introduction • Classification of Occlusion Culling • Instant Visibility • Cell Arrangement Policy • Distributed Rendering Environment • Experimental Results • Conclusions • Future Works • System Demo
Introduction (1/11) • Walkthrough of large-scale models • Simulators, games, CAD/CAM, urban planning • Animation 1 (Level of Detail) • Animation 2 (Collision Detection) • Animation 3 (Physics) • Millions of polygons • Not real-time with current graphics hardware • To reduce the loads for the graphics hardware Solution Visibility Culling
Introduction (2/11) • 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 • Off-screen: view-frustum culling • Invisible parts: back-face culling • Occluded by other objects: occlusion culling
View-Frustum Culling Back-Face Culling Occlusion Culling Introduction (3/11) • Visibility culling algorithm • View-frustum culling • Back-face culling • Occlusion culling visible View Frustum
Introduction (4/11) • View-frustum culling • An old idea (Clark 76): • Organize primitives into clumps • Before rendering the primitives in a clump, test a bounding volume against the view frustum • If the clump is entirely outside the view frustum, don’t render any of the primitives • If the clump intersects the view frustum, add to PVS and render normally • Organize clumps into a hierarchy of bounding volumes for more efficient testing • If a clump is entirely outside or entirely inside view frustum, no need to test its children
Introduction (5/11) • Example of Hierarchical View Frustum Culling root camera
1 1 0 2 0 2 1 5 2 3 3 4 0 Introduction (6/11) • Back-face culling • Compute normal of polygon in 2D screen space. • Normal will be cross product of two vectors that share an origin • Use vertices for simplicity:
Introduction (7/11) • Back-face culling • Simple technique to discard polygons that faces away from the viewer • First, must have consistently oriented polygons, e.g., counterclockwise 2 2 0 1 0 front facing back facing 1
Introduction (8/11) • Back-face culling • Create vector from eye point to each polygon • Compute dot product of vector and normal at a vertex. • If dot product is negative, angle between vectors is greater than 90 degrees 1 2 back 2 eye 1 front 0 0 front back screen space eye space
Introduction (9/11) • Occlusion culling • Main idea: Objects that lies completely “behind” another set of objects can be culled • Process from front to back Use some kind of occlusion representation OR for each object g do: if( not Occluded(OR ,g)) render(g); update(OR ,g); end; end;
Introduction (10/11) • Occlusion culling • Occluders versus occludees: Blue parts: occluders Red parts: occludees
View X Point Y Z Introduction (11/11) • Occlusion culling • Depth versus overlap: Depth + Overlap = Occlusion
Classification of Occlusion Culling (1/4) • Online point-basedvs. Preprocessing region-based View Point View Cell [Greene 93, Coorg 96, Zhang 97, Luebke 95, etc.] [Teller 91, Airey 91, Cohen-Or 98, etc.]
Classification of Occlusion Culling (2/4) • Online point-based algorithm • They have to be executed for each frame • Renderer cannot proceed until a PVS is available • Preprocessing region-based algorithm • PVS is calculated at preprocessing stage • Large memory consumption • Long precalculation time
Classification of Occlusion Culling (3/4) • Occluders vs.Portals visible occluder hidden portal [Greene 93, Coorg 96, Zhang 97, Cohen-Or 98, etc.] [Teller 91, Airey 91, Luebke 95, etc.]
Classification of Occlusion Culling (4/4) • Object space vs.Image space [Teller 91, Airey 91, Coorg 96, Hudson 97, Cohen-Or 98, etc.] [Greene 93, Zhang 97, etc.]
Binary Space Partitioning Tree (1/2) • Partition space by dividing into two parts at each level • A terminal node represents a region that is not further subdivided
Binary Space Partitioning Tree (2/2) • Subdivide a scene into numerous spatial cells
Our demand • Short preprocessing time • Calculate PVS at the run-time stage • High-speed frame rate • Reduce the number of rendering polygons • Decrease the calculating time of PVS • Provide a high-quality scene with high-speed frame rate
Our solution (1/4) • Short preprocessing time • Only find the occluders set of each cell • High-speed frame rate • Reduce the number of rendering polygons • Decrease the calculating time of PVS • Provide a high-quality scene with high-speed frame rate
Our solution (2/4) • Short preprocessing time • Only find the occluders set of each cell • High-speed frame rate • Perform run-time occlusion culling • Decrease the calculating time of PVS • Provide a high-quality scene with high-speed frame rate
Our solution (3/4) • Short preprocessing time • Only find the occluders set of each cell • High-speed frame rate • Perform occlusion culling • Calculate visibility in parallel to the traditional rendering pipeline (Instant Visibility) • Provide a high-quality scene with high-speed frame rate
Our solution (4/4) • Instant Visibility
Instant Visibility (1/7) • The traditional rendering pipeline
Instant Visibility (2/7) • The new visibility pipeline
Instant Visibility (3/7) • Adjust view frustum
Instant Visibility (4/7) • tε = 2 tvis – tframe • ε = tε vmax • Where vmax is the max. velocity • φ = tε ωε • Where ωε is the max, rotation speed
Instant Visibility (5/7) • The umbra difference of ε - Neighborhood
Instant Visibility (6/7) • Occluder Shrinking
Instant Visibility (7/7) PVS Info Drawing resource Calculating resource View Position Info
Performance ? A cluster of the proposed architecture Calculating resources Drawing resource
Our approach Drawing resource Calculating resources Online point-based / Preprocessing region-based PVS Occluders / Portals Object space / Image space
Cell Arrangement Policy (1/5) • The definition of machine type • (Ti, μi, ψi) • Ti : machine type • μi : throughput • ψi : the amount
Cell Arrangement Policy (2/5) • The definition of task class • (Ci, wi, li, λi) • Ci : task class • wi : service demand • li : code length • λi : arrival rate
Cell Arrangement Policy (3/5) • The definition of workload of a machine Pi • Ki : the set of tasks residing in Pi
Cell Arrangement Policy (4/5) • tvis = tcal + 2 tcomm • tvis : the time which DM obtains PVS • tcal : the time which CM calculates PVS • tcomm : one-way communication time between CM and DM • If the network is strongly connected tvis ≒ tcal ≒
Cell Arrangement Policy (5/5) • The weight Wk of a machine Pk • The same machinewill not be assignedadjacent cells
Distributed Rendering Environment • Two executing stage • Preprocessing stage • On-the-fly stage
Preprocessing Stage • Perform spatial subdivision • BSP tree (binary space partitioning tree ) • Establish an adjacency tree • Compute the complexity weight of each cell • The weight is the number of polygons of the cell • Determine the occluders set of each cell • Determined it according to projection area of each occluder
On-the-fly Stage (1/5) • Add a new CM • Increase a computing resource • MA arranges cells again
On-the-fly Stage (2/5) • Add a new DM • Join a displaying client
On-the-fly Stage (3/5) • Calculating and rendering • A major operation
On-the-fly Stage (4/5) • Remove an existing or crashed CM • Decrease a computing resource • MA arranges cells again
On-the-fly Stage (5/5) • Remove an existing DM • Cancel a displaying client
Calculating and Rendering • Calculating step of CM • step1: adjust the view frustum • step2: perform view-frustum culling • step3: perform occlusion culling