1 The Method of Precomputing Triangle Clusters for Quick BVH Builder and Accelerated Ray Tracing Kirill Garanzha Department of Software for Computers Bauman.

Slides:



Advertisements
Similar presentations
Sven Woop Computer Graphics Lab Saarland University
Advertisements

Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Surface Simplification Using Quadric Error Metrics Speaker: Fengwei Zhang September
Restart Trail for Stackless BVH Traversal Samuli Laine NVIDIA Research.
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Physically Based Real-time Ray Tracing Ryan Overbeck.
Collision Detection CSCE /60 What is Collision Detection?  Given two geometric objects, determine if they overlap.  Typically, at least one of.
Ray Tracing Ray Tracing 1 Basic algorithm Overview of pbrt Ray-surface intersection (triangles, …) Ray Tracing 2 Brute force: Acceleration data structures.
IIIT Hyderabad Hybrid Ray Tracing and Path Tracing of Bezier Surfaces using a mixed hierarchy Rohit Nigam, P. J. Narayanan CVIT, IIIT Hyderabad, Hyderabad,
Computer graphics & visualization Collisions. computer graphics & visualization Simulation and Animation – SS07 Jens Krüger – Computer Graphics and Visualization.
Zhao Dong 1, Jan Kautz 2, Christian Theobalt 3 Hans-Peter Seidel 1 Interactive Global Illumination Using Implicit Visibility 1 MPI Informatik Germany 2.
Ray Tracing CMSC 635. Basic idea How many intersections?  Pixels  ~10 3 to ~10 7  Rays per Pixel  1 to ~10  Primitives  ~10 to ~10 7  Every ray.
Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.
Experiences with Streaming Construction of SAH KD Trees Stefan Popov, Johannes Günther, Hans-Peter Seidel, Philipp Slusallek.
Afrigraph 2004 Interactive Ray-Tracing of Free-Form Surfaces Carsten Benthin Ingo Wald Philipp Slusallek Computer Graphics Lab Saarland University, Germany.
RT 08 Efficient Clustered BVH Update Algorithm for Highly-Dynamic Models Symposium on Interactive Ray Tracing 2008 Los Angeles, California Kirill Garanzha.
Computer Graphics (Fall 2005) COMS 4160, Lecture 21: Ray Tracing
Ray Tracing Dynamic Scenes using Selective Restructuring Sung-eui Yoon Sean Curtis Dinesh Manocha Univ. of North Carolina at Chapel Hill Lawrence Livermore.
reconstruction process, RANSAC, primitive shapes, alpha-shapes
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
RT08, August ‘08 Large Ray Packets for Real-time Whitted Ray Tracing Ryan Overbeck Columbia University Ravi Ramamoorthi Columbia University William R.
Zoltan Szego †*, Yoshihiro Kanamori ‡, Tomoyuki Nishita † † The University of Tokyo, *Google Japan Inc., ‡ University of Tsukuba.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Interactive Ray Tracing: From bad joke to old news David Luebke University of Virginia.
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
Surface Simplification Using Quadric Error Metrics Michael Garland Paul S. Heckbert.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
Dynamic Meshing Using Adaptively Sampled Distance Fields
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Stefan PopovHigh Performance GPU Ray Tracing Real-time Ray Tracing on GPU with BVH-based Packet Traversal Stefan Popov, Johannes Günther, Hans- Peter Seidel,
On a Few Ray Tracing like Algorithms and Structures. -Ravi Prakash Kammaje -Swansea University.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
By Mahmoud Moustafa Zidan Basic Sciences Department Faculty of Computer and Information Sciences Ain Shams University Under Supervision of Prof. Dr. Taymoor.
An Evaluation of Existing BVH Traversal Algorithms for Efficient Multi-Hit Ray Tracing Jefferson Amstutz (SURVICE) Johannes Guenther (Intel) Ingo Wald.
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
Collaborative Visual Computing Lab Department of Computer Science University of Cape Town Graphics Topics in VR By Shaun Nirenstein.
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
Saarland University, Germany B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes Sven Woop Gerd Marmitt Philipp Slusallek.
Click to edit Master title style HCCMeshes: Hierarchical-Culling oriented Compact Meshes Tae-Joon Kim 1, Yongyoung Byun 1, Yongjin Kim 2, Bochang Moon.
Interactive Rendering With Coherent Ray Tracing Eurogaphics 2001 Wald, Slusallek, Benthin, Wagner Comp 238, UNC-CH, September 10, 2001 Joshua Stough.
Fast BVH Construction on GPUs (Eurographics 2009) Park, Soonchan KAIST (Korea Advanced Institute of Science and Technology)
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Hierarchical Penumbra Casting Samuli Laine Timo Aila Helsinki University of Technology Hybrid Graphics, Ltd.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
Memory Management and Parallelization Paul Arthur Navrátil The University of Texas at Austin.
Ray Tracing Animated Scenes using Motion Decomposition Johannes Günther, Heiko Friedrich, Ingo Wald, Hans-Peter Seidel, and Philipp Slusallek.
Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Ray Tracing II. HW1 Part A due October 10 Camera module Object module –Read from a file –Sphere and Light only Ray tracer module: –No shading. No reflection.
3D Object Representations 2011, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
Virtual Light Field Group University College London Ray Tracing with the VLF (VLF-RT) Jesper Mortensen
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
Global Illumination (3) Photon Mapping (1). Overview Light Transport Notation Path Tracing Photon Mapping –Photon Tracing –The Photon Map.
RENDERING : Global Illumination
Ray Tracing Acceleration (5). Ray Tracing Acceleration Techniques Too Slow! Uniform grids Spatial hierarchies K-D Octtree BSP Hierarchical grids Hierarchical.
11/16/04© University of Wisconsin, CS559 Fall 2004 Last Time Texture Anti-Aliasing Texture boundaries Modeling introduction.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Path/Ray Tracing Examples. Path/Ray Tracing Rendering algorithms that trace photon rays Trace from eye – Where does this photon come from? Trace from.
3D Object Representations 2009, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
3D Rendering 2016, Fall.
POLYGON MESH Advance Computer Graphics
STBVH: A Spatial-Temporal BVH for Efficient Multi-Segment Motion Blur
Real-Time Ray Tracing Stefan Popov.
Ray Tracing Acceleration Techniques
3D Object Representations
Hybrid Ray Tracing of Massive Models
Accelerated Single Ray Tracing for Wide Vector Units
CMSC 635 Ray Tracing.
Presentation transcript:

1 The Method of Precomputing Triangle Clusters for Quick BVH Builder and Accelerated Ray Tracing Kirill Garanzha Department of Software for Computers Bauman Moscow State Technical University Tech. talk at University of Nizhniy Novgorod

2 Current Ray Tracing challenges Faster rendering in large dynamic scenes with complex motion (we do the step here) Better algorithmic time complexity for tracing incoherent GI rays ( now it is O(n), where n = # of rays ) Better algorithmic time complexity for tracing incoherent GI rays ( now it is O(n), where n = # of rays ) Shading computation should be coherent and fast Shading computation should be coherent and fast Important note: all proposed algorithms should be mapped efficiently on current or upcoming hardware

3 Problem with dynamic scenes ……… … Acceleration Structure (BVH, kd-tree, grid, …) for dynamic scene primitives (triangles, …) should be rebuilt in every frame of animation. The time complexity of AS builder is O(N log N) for hierarchies and O(N) for grids, where N – is usually the number of triangles. log N N – the number of objects being repartitioned High quality O(N log N) acceleration structure builder for N > 10 5 is not yet real-time on desktop PCs

4 Solution: triangle pre-clustering can be used for efficiency purposes [Garland et al 2001], [Sander et al 2001, 2007], [Lauterbach et al 2008]. Triangle clusters can be used for efficiency purposes [Garland et al 2001], [Sander et al 2001, 2007], [Lauterbach et al 2008]. groups of connected triangles remain connected throughout the course of animation. We assume that groups of connected triangles remain connected throughout the course of animation. once considering the geometry of the first animation frame (every cluster contains ~10 connected triangles). We precompute densely packed triangle clusters once considering the geometry of the first animation frame (every cluster contains ~10 connected triangles). to build the BVH quickly in every frame of animation (~10x faster than base ‘brute-force’ builder). We use the clusters’ AABBs to build the BVH quickly in every frame of animation (~10x faster than base ‘brute-force’ builder).. Exploding simulations can be supported. ( we utilize shallow SAH-BVHs, SIMD, Vertex Culling [Reshetov 2007] and constant connectivity within a cluster ). Packet ray tracing performance is not sacrificed ( we utilize shallow SAH-BVHs, SIMD, Vertex Culling [Reshetov 2007] and constant connectivity within a cluster ).

5 Clustering heuristic In order to build high-quality SAH-based BVH in every frame of animation 3 requirements are considered during cluster precomputation: The shape of the cluster should be similar to a sphere or disk The density of triangles’ connectivity within each cluster should be high Geometric size of a cluster should be limited

6 Sphere/disk shape requirement that an arbitrary ray intersects the convex spatial region Y assuming it intersects the convex region X: Geometric probability P(Y | X) that an arbitrary ray intersects the convex spatial region Y assuming it intersects the convex region X: where SA(X) is the surface area of X Arbitrary ray In a BVH region X corresponds to the AABB of the leaf-node Region Y corresponds to a primitive within the leaf The higher value of P(Y | X) corresponds to the better ray-hit probability within a leaf and early ray traversal termination For arbitrary oriented triangle in 3D-space:

7 Sphere/disk shape requirement It is beneficial to precompute the cluster with a sphere/disk- like shape as the value of P(Y | X) is higher for arbitrary oriented spheres or disks than for triangles or rectangles. For arbitrary oriented sphere or disk in 3D-space:

8 Density of connectivity requirement The density of triangles connectivity within a cluster should be as high as possible ( the value of VerticesCount / TrianglesCount should be lower ) This is done in order to reduce the probability of cluster shape disruption during the course of vertex animation ‘bad’ cluster ‘good’ cluster

9 Geometric size limitation requirement If the geometric size of a cluster is not limited during cluster generation then AABBs of ‘big’ and ‘small’ clusters may overlap significantly (ray tracing slowdown) If the geometric size of a cluster limited then the probability of such overlaps is reduced

10 Clustering heuristic formula The set of k of triangles is accepted to form a cluster if Acc(k) > 0: S(k) – bounding sphere for k triangles SA(X) is the surface area of X CountDistinctVertices(k) is the number of distinct vertex indices within the cluster AvgSA is the surface area for the average triangle within the 3D-model Heuristic parameters: MaxSize / MaxCount – the rough desired cluster size / the number of vertices within the cluster where n i is the normal for i-th triangle

11 Clustering: iterative contraction Dual-graph for the mesh of triangles is created [Garland et al 2001]: At every iteration step the dual- graph edge of max(Acc) is contracted For every dual-graph edge Acc(k1 + k2) is assigned. Acc evaluates the possible merging of k1 and k2 clusters Iterative contraction continues while Iterative contraction continues while max( Acc ) > 0

12 Clustering: iterative growing At every iteration step for the cluster of k-1 triangles a new triangle is added that corresponds to the max( Acc(k) ) Cluster growing continues while Acc(k) > 0 For some clusters there may be no available ‘building material’ that was occupied earlier. This method consumes less memory than iterative clustering with dual-graph.

13 Clustering example Triangles Iterative growing result Iterative contraction result

14 Clustering example ‘Easy’ model for clustering ‘Hard’ model (the sizes of triangles vary significantly)

15 Acceleration structure builder … Every cluster contains the list of densely packed triangles and the list of distinct vertex indices In every frame of animation for each cluster the AABB is computed based on new vertex 3D positions In every frame of animation the AABBs of all clusters are used as the input set of acceleration structure builder (BVH, [Wald 2007]) Every leaf may contain a few clusters if they are proximate or contain the sum of triangles that is less than some threshold (e.g. 32 triangles) No branches within the clusters For such shallow trees the packet ray tracer, SIMD instructions, Vertex Culling [Reshetov 2007] are used

16 Useful constant connectivity V0V0 V1V1 V2V2 V3V3 V4V4 V5V5 V6V6 V0V0 V1V1 V2V2 V3V3 V6V6 V4V4 V5V5 T0T0 T1T1 T2T2 T3T3 T4T4 T5T5 V0V0 V1V1 V2V2 T0T0 V1V1 V2V2 V3V3 T1T1 V2V2 V3V3 V5V5 T2T2 V2V2 V4V4 V5V5 T3T3 V2V2 V4V4 V6V6 T4T4 V0V0 V2V2 V6V6 T5T5 VP 0 VP 1 VP 2 VP 3 VP 4 VP 5 VP T0T0 123 T1T1 235 T2T2 245 T3T3 246 T4T T5T5 unsigned int * Triangles → unsigned char * TriCompressed → Old triangles storage: unsigned int * ClusterVertexGlobalIndices → VERTEX * VCache → Vertex 3D positions are gathered from the global array to the vertex cache based on vertex indices within the cluster The cluster of triangles with no more than 256 vertices CullC 0 CullC 1 CullC 2 CullC 3 CullC 4 CullC 5 CullC 6 int * VCullCodes → Bit-codes for amortized Vertex Frustum culling tests New triangles storage: Vertex prefetching: References to the Vertex Cache

17 UNC Exploding Dragon (252K triangles, 192K vertices): Image 1024 × 1024 (Core 2 Duo Heuristic parameters (each cluster size): MaxSize = MaxCount = X Ray Tracing time / the clusters produced

18 Utah Fairy Forest (174K triangles, 97K vertices): Image 1024 × 1024 (Core 2 Duo Heuristic parameters (each cluster size): MaxSize = MaxCount = X Ray Tracing time / the clusters produced

19 BVH-quality evaluation for animation frames Detailed comparison factors for the BVHs produced by using Acc(k) 0,0 (no clustering) and Acc(k) 50,50 (MaxSize = MaxCount = 50): Factor = (RT time for Acc(k) 0,0 ) / (RT time for Acc(k) 50,50 ) RT – 2-bounce reflections (everything is reflective) Factor > 1 denotes the higher quality of BVH produced by Acc(k) 50,50

20 Method advantages The method is applicable for scenes where triangles maintain the constant connectivity. Even exploding simulations can be programmed with this. The method is applicable for scenes where triangles maintain the constant connectivity. Even exploding simulations can be programmed with this. It is possible to precompute the ‘best’ possible set of clusters that are applicable for accelerated ray tracing in dynamic scenes It is possible to precompute the ‘best’ possible set of clusters that are applicable for accelerated ray tracing in dynamic scenes For the clusters of reasonable sizes ray tracing timings are not affected and the BVH-builder is accelerated For the clusters of reasonable sizes ray tracing timings are not affected and the BVH-builder is accelerated Constant connectivity within a cluster is useful for vertex prefetching and reduced ray-triangle intersection computations Constant connectivity within a cluster is useful for vertex prefetching and reduced ray-triangle intersection computations

21 Method limitations Explicit: this method is an overhead for 3D-models without connected triangles (where ) Explicit: this method is an overhead for 3D-models without connected triangles (where VerticesCount / TrianglesCount = 3) Implicit: the size and regularity of triangles within a cluster produced should remain reasonably coherent through out the course of animation. Implicit: the size and regularity of triangles within a cluster produced should remain reasonably coherent through out the course of animation. Ray tracing performance is likely to be affected if all the clusters undergo severe stretching Ray tracing performance is likely to be affected if all the clusters undergo severe stretching

22 Plans for future Probably: implementation of Oriented Bounding Boxes for BVH leaf-nodes and AABBs for inner-nodes Probably: implementation of Oriented Bounding Boxes for BVH leaf-nodes and AABBs for inner-nodes Probably: implementation of asynchronous repair for disrupted clusters Probably: implementation of asynchronous repair for disrupted clusters Support for smooth surface primitives Support for smooth surface primitives R&D in direction of packet based Path Tracing and other GI algorithms for dynamic scenes R&D in direction of packet based Path Tracing and other GI algorithms for dynamic scenes

23 Demo on Core 2 Quad 2.4GHz