A Model to Evaluate Ray Tracing Hierarchies

Similar documents
Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Accelerating Ray Tracing

Spatial Data Structures

Spatial Data Structures

Ray Tracing Acceleration Data Structures

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Spatial Data Structures

Spatial Data Structures

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Computer Graphics. Bing-Yu Chen National Taiwan University

Spatial Data Structures

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Accelerated Raytracing

Acceleration Data Structures

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Intersection Acceleration

Accelerating Geometric Queries. Computer Graphics CMU /15-662, Fall 2016

VIII. Visibility algorithms (II)

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

Hidden Surface Elimination: BSP trees

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Ray Intersection Acceleration

Ray Tracing: Intersection

More Hidden Surface Removal

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Bounding Volume Hierarchies. CS 6965 Fall 2011

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Ray Casting. Outline in Code. Outline. Finding Ray Direction. Heckbert s Business Card Ray Tracer. Foundations of Computer Graphics (Fall 2012)

Parallel Physically Based Path-tracing and Shading Part 3 of 2. CIS565 Fall 2012 University of Pennsylvania by Yining Karl Li

Solid Modeling. Ron Goldman Department of Computer Science Rice University

Ray Casting. COS 426, Spring 2015 Princeton University

CPSC / Sonny Chan - University of Calgary. Collision Detection II

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

Binary Space Partition Trees. Overview. Binary Space Partitioning Trees (Fuchs, Kedem and Naylor `80)

CS770/870 Spring 2017 Ray Tracing Implementation

Lecture 2 - Acceleration Structures

9. Visible-Surface Detection Methods

Accelerating Ray-Scene Intersection Calculations

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

Ray-tracing Acceleration. Acceleration Data Structures for Ray Tracing. Shadows. Shadows & Light Sources. Antialiasing Supersampling.

Acceleration Data Structures. Michael Doggett Department of Computer Science Lund university

Row Tracing with Hierarchical Occlusion Maps

Advanced 3D-Data Structures

Advanced Algorithm Design and Analysis (Lecture 12) SW5 fall 2005 Simonas Šaltenis E1-215b

Computer Graphics. - Ray-Tracing II - Hendrik Lensch. Computer Graphics WS07/08 Ray Tracing II

improving raytracing speed

Algorithms for GIS:! Quadtrees

Orthogonal Range Search and its Relatives

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Accelerating Ray-Tracing

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Spatial Data Structures for Computer Graphics

Lecture 11: Ray tracing (cont.)

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Acceleration. Welcome!

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Two Optimization Methods for Raytracing. W. Sturzlinger and R. F. Tobler

Physically Based Rendering ( ) Intersection Acceleration

Point Cloud Filtering using Ray Casting by Eric Jensen 2012 The Basic Methodology

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

CS535 Fall Department of Computer Science Purdue University

Drawing the Visible Objects

Ray Intersection Acceleration

Collision Detection based on Spatial Partitioning

Trees. Q: Why study trees? A: Many advance ADTs are implemented using tree-based data structures.

Sung-Eui Yoon ( 윤성의 )

15.083J Integer Programming and Combinatorial Optimization Fall Enumerative Methods

Topics. Ray Tracing II. Intersecting transformed objects. Transforming objects

Spatial Data Structures and Speed-Up Techniques. Ulf Assarsson Department of Computer Science and Engineering Chalmers University of Technology

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

Spatial Data Structures. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Supplement to Lecture 16

EFFICIENT BVH CONSTRUCTION AGGLOMERATIVE CLUSTERING VIA APPROXIMATE. Yan Gu, Yong He, Kayvon Fatahalian, Guy Blelloch Carnegie Mellon University

Topics. Ray Tracing II. Transforming objects. Intersecting transformed objects

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

kd-trees Idea: Each level of the tree compares against 1 dimension. Let s us have only two children at each node (instead of 2 d )

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

would be included in is small: to be exact. Thus with probability1, the same partition n+1 n+1 would be produced regardless of whether p is in the inp

Geometric Structures 2. Quadtree, k-d stromy

Computational Geometry

Spatial Data Structures and Acceleration Algorithms

Advanced Ray Tracing

B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes

Acceleration Structures. CS 6965 Fall 2011

Logistics. CS 586/480 Computer Graphics II. Questions from Last Week? Slide Credits

Computational Geometry

Heuristics for ray tracing using space subdivision

Identifying those parts of a scene that are visible from a chosen viewing position, and only process (scan convert) those parts

EDAN30 Photorealistic Computer Graphics. Seminar 2, Bounding Volume Hierarchy. Magnus Andersson, PhD student

CS 563 Advanced Topics in Computer Graphics Culling and Acceleration Techniques Part 1 by Mark Vessella

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Questions from Last Week? Extra rays needed for these effects. Shadows Motivation

CS 431/636 Advanced Rendering Techniques

Tree traversals and binary trees

Transcription:

A Model to Evaluate Ray Tracing Hierarchies K. R. Subramanian Donald Fussell Department of Computer Sciences The University of Texas at Austin 1 Introduction In this article we develop a model to evaluate ray tracing hierarhies. This model gives us a better look at the way hierarchies work in making ray tracing a tractable rendering technique. Some of the most important ray tracing hierarchies including the octree, bsp, median-cut, bounding volume hierarchies and the 5D space hierarchy fit into this model. Such a unified model will be able to tell us the underlying parameters that influence the performance of any ray tracing method. It also opens up the possibility of designing the hierarchy to improve performance. 2 The Model Figure 0shows a two level hierarchy. The proposed cost model is as follows: Cost(T A ) = {Cost(A) + α A Cost(T B ) + β A Cost(T C ) + (1 α A β A ){γ A f 1 (Cost(T B ), Cost(T C ), P B ) + (1 γ A )f 2 (Cost(T B ), Cost(T C ), P C }}P A A 1

where T A = subtree of node A α A = probability that a ray segment is in the left region. β A = probability that a ray segment is in the right region. γ A = probability that a ray segment is in the right region. f 1, f 2 = terms that depend on the ray tracing hierarchy used. P A = probability that a ray intersects a primitive in A s subtree. n f = Bounding volume intersection cost. P I J = probability that a ray that enters node I given that it enters J. The proposed cost model computes the cost of a hierarchy recursively. It consists of three recursive terms and a non-recursive term. 2.1 Non-Recursive Term This term accounts for the work done by each ray segment at each node before dealing with its children. 2.2 Recursive Term This is a weighted sum of three terms, the weights(probabilities) being determined by the ray distribution. There are three possibilities; the ray segment might visit only the left child or the right child or both. α A, β A and (1 α A β A ) correspond to the respective probabilities. These probabilities respectively weight the costs of the left, right and both subtrees. Further, the coefficient of (1 α A β A ), representing the cost of rays crossing the partition is a weighted sum of two terms, distinguishing the region of origin of each ray. γ A and (1 γ A ) represent the probabilities that any ray originates in the left or right region. P B, P C are probabilities that a ray segment intersects a primitive in their subtrees and are needed in the cost computation. Lastly, the entire cost expression is multiplied by a conditional probability. At the root level, this is 1 since we are only considering rays that 2

intersect the bounding volume of the scene. This is not true at lower levels, for eg., the cost of T D must be multiplied by P B AL, which is the probability that rays enter the B given they entter A L, the left region of A. To illustrate this, the costs for T B and T C are as follows. Cost(T B ) = {Cost(B) + α B Cost(T D ) + β B Cost(T E ) + (1 α B β B ){γ B f 1 (Cost(T D ), Cost(T E ), P D ) + (1 γ B )f 2 (Cost(T D ), Cost(T E ), P E }}P B AL Cost(T C ) = {Cost(C) + α C Cost(T F ) + β C Cost(T G ) + (1 α C β C ){γ C f 1 (Cost(T F ), Cost(T G ), P F ) + (1 γ C )f 2 (Cost(T F ), Cost(T G ), P G }}P B AR We now proceed to apply this model to different ray tracing hierarchies. 3 Applying the Cost Model 3.1 Bounding Volume Hierarchies In bounding volume hierarchies, there are no separating planes chopping up space. To accommodate this in our model, we recognize that we visit both sides of the hierarchy when we compute the cost. In other words, α I = β I = 0 for any node I. Also, P I = 0 for any node I. There are no separating planes, so I L = I R = I. Cost(I) = n f, a bounding volume test. For a bounding volume hierarchy, f 1 (.,.,.,.) = Cost(T B ) + (1 P B )Cost(T C ) f 2 (.,.,.,.) = Cost(T C ) + (1 P C )Cost(T B ) 3

and Cost(T A ) = n f + Cost(T B ) + Cost(T C ) = n f + {n f + Cost(T D ) + Cost(T E )}P (B A) + {n f + Cost(T F ) + Cost(T G )}P (C A) 3.2 Octree, BSP Hierarchies The octree partitions space simultaneously along all three dimensions [Glassner 84]. The BSP tree hierarchy[kaplan] does essentially the same but is implemented as a binary tree, partitioning along X, Y and Z and in that order. So, for purposes of cost analysis, these two structures are identical and will result in the same cost. For a BSP or octree hierarchy, f 1 (.,.,.,.) = Cost(T B ) + (1 P B )(n f + Cost(T C )) f 2 (.,.,.,.) = Cost(T C ) + (1 P C )(n f + Cost(T B )) and Cost(T A ) = 1 cmp + α A Cost(T B ) + β A Cost(T C ) + (1 α A β A ){γ A (Cost(T B ) + (1 P B )(n f + Cost(T C ))) + (1 γ A )(Cost(T C ) + (1 P C )(n f + Cost(T B )))} All the non-recursive terms can be lumped into Cost(A) Cost(T A ) = {1 cmp + {γ A (1 P B )n f + (1 γ A )n f } int + α A Cost(T B ) + β A Cost(T C ) + (1 α A β A ){γ A (Cost(T B ) + (1 P B )(Cost(T C ))) + (1 γ A )(Cost(T C ) + (1 P C )(Cost(T B )))}}P (A A) 4

where Cost(A) = 1 cmp + {γ A (1 P B )n f + (1 γ A )n f } int The expression for T B is similar but has a conditional probability in addition. Cost(T B ) = {Cost(B) + α B Cost(T D ) + β B Cost(T E ) + (1 α B β B ){γ B (Cost(T D ) + (1 P D )(Cost(T E ))) + (1 γ A )(Cost(T E ) + (1 P E )(Cost(T D )))}}P (B A L ) and so on. 3.3 K d tree Hierarchy This is a binary hierarchy using separating planes orthogonal to the X,Y and Z axes but has important differences from the BSP hierarchy[kaplan]. The hierarchy is balanced on the number of objects and the planes are chosen to produce this kind of partitioning. The number of objects straddling the plane is also minimized. There is considerable flexibility in where a separating plane can be positioned and we have three dimensions to choose from. The traversal algorithm makes it unnecessary for the convex subsets that are produced by the space partitioning to be contiguous. In this scheme, a bounding volume test and a separating plane test is done before we investigate a node s children. So the node cost is Cost(A) = (1 + n f ) int and Cost(T A ) = {{1 + n f } int + α A Cost(T B ) + β A Cost(T C ) + (1 α A β A ){γ A (Cost(T B ) + (1 P B )(Cost(T C ))) + (1 γ A )(Cost(T C ) + (1 P C )(Cost(T B )))}}P (A A) 5

and Cost(T B ) = {Cost(B) + α B Cost(T D ) + β B Cost(T E ) + (1 α B β B ){γ B (Cost(T D ) + (1 P D )(Cost(T E ))) + (1 γ A )(Cost(T E ) + (1 P E )(Cost(T D )))}}P (B A L ) 3.4 Spatial Enumeration method - ARTS In this method, the partitioning is uniform along all 3 dimensions. Its identical to an octree or BSP partitioning except that the partitioning is not adaptive.thus the only difference in the form of the cost expression is the node cost, which will be replaced by the voxel hopping cost. As this method uses an extended Bresenham s line algorithm (3DDDA) in three dimensions, the cost will be much smaller since this is an incremental algorithm. 3.5 5D Space method - Arvo In this method, space is partitioned over the thrree dimensions just like the octree. In addition, the two directional dimensions of the ray is also partitioned creating beams in 5-space. The partitioning is again adaptive. The leaf nodes of the hierarchy are beams of hypercubes. A ray belongs to exactly one hypercube in the hierarchy. Thus, given a ray, we trace out a path from the top of the hierarchy down to a beam where an ordered search is conducted to determine the closest intersection. For our cost analysis of the 5-D hierarchy we can consider this structure as a binary tree with the partitioning going through X,Y,Z,U,V dimensions in sequence(the last two are the directional dimensions). However, we always go only on one side of the binary tree at any node. Thus, in our model, α I = 1, β I = 0, or α I = 0, β I = 1 for any node I. (1 α I β I ) = 0 so its coefficient is irrelevant in the cost expression. Node cost is just 1 compare and there are no bounding volume tests in the hierarchy. Thus the cost is Cost(T A ) = {{1 cmp + Cost(T B )}P (A A) 6

or Cost(T A ) = {{1 cmp + Cost(T C )}P (A A) and Cost(T B ) = {{1 cmp + Cost(T D )}P (B A L ) or Cost(T B ) = {{1 cmp + Cost(T E )}P (B A R ) 7