On a Few Ray Tracing like Algorithms and Structures. -Ravi Prakash Kammaje -Swansea University.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

Sven Woop Computer Graphics Lab Saarland University
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Lecture 38: Chapter 7: Multiprocessors Today’s topic –Vector processors –GPUs –An example 1.
CSE 681 Bounding Volumes. CSE 681 Bounding Volumes Use simple volume enclose object(s) tradeoff for rays where there is extra intersection test for object.
Computer graphics & visualization Collisions. computer graphics & visualization Simulation and Animation – SS07 Jens Krüger – Computer Graphics and Visualization.
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.
A Coherent Grid Traversal Algorithm for Volume Rendering Ioannis Makris Supervisors: Philipp Slusallek*, Céline Loscos *Computer Graphics Lab, Universität.
GPGPU Introduction Alan Gray EPCC The University of Edinburgh.
Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.
Visibility Culling. Back face culling View-frustrum culling Detail culling Occlusion culling.
Visibility Culling using Hierarchical Occlusion Maps Hansong Zhang, Dinesh Manocha, Tom Hudson, Kenneth E. Hoff III Presented by: Chris Wassenius.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
RT06 conferenceVlastimil Havran On the Fast Construction of Spatial Hierarchies for Ray Tracing Vlastimil Havran 1,2 Robert Herzog 1 Hans-Peter Seidel.
Cost-based Workload Balancing for Ray Tracing on a Heterogeneous Platform Mario Rincón-Nigro PhD Showcase Feb 17 th, 2012.
Experiences with Streaming Construction of SAH KD Trees Stefan Popov, Johannes Günther, Hans-Peter Seidel, Philipp Slusallek.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Fast Agglomerative Clustering for Rendering Bruce Walter, Kavita Bala, Cornell University Milind Kulkarni, Keshav Pingali University of Texas, Austin.
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.
Hidden Surface Removal
GPGPU platforms GP - General Purpose computation using GPU
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Ray Tracing and Photon Mapping on GPUs Tim PurcellStanford / NVIDIA.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
Shared memory systems. What is a shared memory system Single memory space accessible to the programmer Processor communicate through the network to the.
BY: ALI AJORIAN ISFAHAN UNIVERSITY OF TECHNOLOGY 2012 GPU Architecture 1.
1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004.
GPUs and Accelerators Jonathan Coens Lawrence Tan Yanlin Li.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
Computer Graphics 2 Lecture 8: Visibility Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
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,
Programming Concepts in GPU Computing Dušan Gajić, University of Niš Programming Concepts in GPU Computing Dušan B. Gajić CIITLab, Dept. of Computer Science.
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.
Visible-Surface Detection Jehee Lee Seoul National University.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Using BSP for CD Ref: BSP in deBerg et al ’ s book (url)url.
Saarland University, Germany B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes Sven Woop Gerd Marmitt Philipp Slusallek.
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)
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
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.
Interactive Ray Tracing of Dynamic Scenes Tomáš DAVIDOVIČ Czech Technical University.
Maximizing Parallelism in the Construction of BVHs, Octrees, and k-d Trees Tero Karras NVIDIA Research.
Maths & Technologies for Games Spatial Partitioning 2
Compact, Fast and Robust Grids for Ray Tracing Ares Lagae & Philip Dutré 19 th Eurographics Symposium on Rendering EGSR 2008Wednesday, June 25th.
Compact, Fast and Robust Grids for Ray Tracing
Honours Graphics 2008 Session 5. Today’s focus Rasterization Visibility determination Coarse / fine visibility determination.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
AUTO-GC: Automatic Translation of Data Mining Applications to GPU Clusters Wenjing Ma Gagan Agrawal The Ohio State University.
Hierarchical Occlusion Map Zhang et al SIGGRAPH 98.
Ray Tracing by GPU Ming Ouhyoung. Outline Introduction Graphics Hardware Streaming Ray Tracing Discussion.
BSP Tree Supplement Jyun-Ming Chen. Fall Kd-Tree and BSP tree kd-tree is a special kind of bsp tree.
Ray Tracing Optimizations
David Luebke 3/5/2016 Advanced Computer Graphics Lecture 4: Faster Ray Tracing David Luebke
Ray Tracing Acceleration (5). Ray Tracing Acceleration Techniques Too Slow! Uniform grids Spatial hierarchies K-D Octtree BSP Hierarchical grids Hierarchical.
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.
Institute of Software,Chinese Academy of Sciences An Insightful and Quantitative Performance Optimization Chain for GPUs Jia Haipeng.
Hierarchical Data Structure in Game Programming Yanci Zhang Game Programming Practice.
Heterogeneous Processing KYLE ADAMSKI. Overview What is heterogeneous processing? Why it is necessary Issues with heterogeneity CPU’s vs. GPU’s Heterogeneous.
Hybrid Ray Tracing and Path Tracing of Bezier Surfaces using a mixed hierarchy Rohit Nigam, P. J. Narayanan CVIT, IIIT Hyderabad, Hyderabad, India.
Modeliranje kompleksnih modelov
Real-Time Ray Tracing Stefan Popov.
Ray Tracing, Part 1 Dinesh Manocha COMP 575/770.
Accelerated Single Ray Tracing for Wide Vector Units
Degree-aware Hybrid Graph Traversal on FPGA-HMC Platform
Ray Tracing on Programmable Graphics Hardware
Modeliranje kompleksnih modelov
Presentation transcript:

On a Few Ray Tracing like Algorithms and Structures. -Ravi Prakash Kammaje -Swansea University

Ray Tracing Naïve method – Intersect every ray against every triangle – O (rays * trs) Need better methods

Data Structures BSP TeesUniform Grid Octree Bounding Volume (Box) Hierarchy

Kd-trees A specialised BSP Tree Axes restricted to X, Y and Z axes Among most widely used for ray tracing – SAH Heuristic to build trees suitable for Ray Tracing – Cheap Traversal

RBSP Trees Form of BSP tree – Space partitioning – Binary – 2 children at each node Predetermined axes – Number of axes, m – Axes Construction and Traversal – Similar to kd-trees – Heuristics from kd-tree borrowed

RBSP Trees - Example kd-treeRBSP tree, 24 axes

RBSP Trees - Construction Predetermine Axis Methods to predetermine m axes Evenly spaced points on Sphere Find evenly spaced points on unit sphere Use vector from centre to points as axes Advantage Has an even distribution of axes Disadvantage Axes are not customised to scene

Construction Recursive process Find bounding volume At each node Find a split plane Use a heuristic Classify triangles Continue until very few triangles are in node A maximum depth is reached Split Plane Selection Use SAH over all axes Select plane with minimum cost

RBSP Trees - Traversal Standard slabs method Over m planes Find intersection of ray and plane Precomputes divides Number of divide operations = m If m is large, divide operations cause slowdowns Use SSE to perform 4 divides Accelerates ray tracing

RBSP Trees - Results Makes RBSP trees faster than kd-trees A structure that shows Ray tracing potential Better than kd-trees for models with non-axis aligned scenes Needs better heuristics to predetermine axes

Row Tracing Combines rasterization and ray tracing concepts A form of Packet ray tracing – Packets of rays spanning an entire row Row can be – A 2D plane Simpler traversal Easy row / triangle intersection – per-pixel cost less than ray / triangle intersections A 1D line – Simplifies clipping, occlusion testing and frustum testing

Row Tracing - Algorithm High level algorithm – Traverse row-plane through kd-tree or octree – Rasterize leaf node triangles with scanline algorithm Very similar to Ray tracing Early ray termination not possible Use 1D Hierarchical Occlusion Maps to achieve this

Row Tracing – Hierarchical Occlusion Maps Important optimization – Indicates already occluded parts of a Row 1D version of HOM by Zhang, et al. (1997) Lowest level – 1 pixel Each upper level – 2 bits of lower level For a row with 1024 pixels, lowest level – 128 chars Entire HOM – 256 chars

Row Tracing – Hierarchical Occlusion Maps Initialize prior to traversal – Set all bits to zero – The entire row is unoccluded Updating the HOM – Triangles rasterization – Corresponding lowest level bits are set to 1 – Upper levels updated if necessary Testing for Occlusion – Skip occluded nodes – Optimize rasterization

Packet Row Tracing Row-Packet / Node intersection – Case 1 – All rows in packet hit the node – Case 2 – Row packet misses node – Case 3 – Divergence nodes – Trace individual rows from these nodes Occlusion testing – Test each row individually Leaf node – All rows are rasterized with leaf node’s triangles Easily multi threadable

Row Tracing – vs Packet Ray Tracing

Row Tracing – vs OpenGL

GPUs Very Powerful Highly Parallel Example – Nvidia GeForce GTX cores 648 MHz Graphics Clock 1476 MHz Processor Clock 1 GB GDDR3 SDRAM General Purpose on graphics hardware is getting popular

GPU based Algorithms GPUs are much faster at doing parallel tasks However, simple tasks require special algorithms to effectively utilise this Example – Scan of an array – Find sum of all previous elements in the array – Input : {3,7,1,5,8,2,8,1,8,6,2,8} – Output : {3,10,11,16,24,26,34,35,43,49,51,59}

GPU based Algorithms On CPU for(i=1; i < num; ++i) arr[i] = arr[i]+arr[i-1]; On GPU – Use parallel scanning algorithm – Make use of several threads – Each element finds sum of itself and element at an offset

GPU Algorithm – Parallel sum Same number of threads as number of elements in array Offset = 1 => Each thread finds sum of itself and it’s neighbouring element Double the offset Iterate until offset < number of elements Can be optimised further by using blocks of threads and intermediate results

Fast ray sorting and breadth-first Packet Traversal for GPU ray tracing - Garanzha and Loop Sort rays on the GPU – Generate a hash code for each ray based on Direction of ray Origin of ray – If rays have same hash code Considered coherent – Sorted into bins Each bin has < maxSize rays – Compression, Sorting, Decompression scheme Utilises GPU efficiently Create frustum for each bin Breadth first traverse a BVH of triangles

OpenCL Based on C Framework for developing heterogenous applications – In theory Some parts can be run on GPU Some on CPU Initially developed by Apple

OpenCL

OpenCL – early impressions Still very early – Complex code – Runs on both CPUs and GPUs Potentially easier to debug on CPUs prior to porting to GPUs Can allocate work based on suitability Runs on NVIDIA and AMD / ATI cards CUDA – much easier to program – Much cleaner code – Not cross platform – Only on NVIDIA GPUs

Conclusion A few ray tracing like structures and algorithms – RBSP Trees – Row Tracing Brief summary of GPU Algorithms – Parallel scan – Ray tracing by ray sorting – Garanzha and Loop – OpenCL