improving raytracing speed

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

Intersection Acceleration

Accelerating Ray Tracing

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

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

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

Ray Tracing II. Improving Raytracing Speed. Improving Computational Complexity. Raytracing Computational Complexity

Ray Tracing Acceleration. CS 4620 Lecture 20

Spatial Data Structures

Ray Tracing Acceleration Data Structures

Spatial Data Structures

Acceleration Data Structures

Accelerated Raytracing

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

Ray Tracing Acceleration. CS 4620 Lecture 22

Spatial Data Structures

MSBVH: An Efficient Acceleration Data Structure for Ray Traced Motion Blur

Collision Detection. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

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

Spatial Data Structures

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

CS535 Fall Department of Computer Science Purdue University

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

Spatial Data Structures

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

COMP 175: Computer Graphics April 11, 2018

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

Homework 1: Implicit Surfaces, Collision Detection, & Volumetric Data Structures. Loop Subdivision. Loop Subdivision. Questions/Comments?

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

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

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

Ray Intersection Acceleration

Using Bounding Volume Hierarchies Efficient Collision Detection for Several Hundreds of Objects

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Collision and Proximity Queries

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

CS 431/636 Advanced Rendering Techniques

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

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

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

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

11 - Spatial Data Structures

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

Bounding Volume Hierarchies. CS 6965 Fall 2011

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

Collision Detection based on Spatial Partitioning

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

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

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

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

Acceleration Data Structures for Ray Tracing

Geometry proxies (in 2D): a Convex Polygon

Ray Genealogy. Raytracing: Performance. Bounding Volumes. Bounding Volume. Acceleration Classification. Acceleration Classification

Ray Intersection Acceleration

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

Hidden Surface Elimination: BSP trees

Lecture 2 - Acceleration Structures

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

Advanced 3D-Data Structures

CPSC GLOBAL ILLUMINATION

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

CS 465 Program 5: Ray II

Collision handling: detection and response

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

More Hidden Surface Removal

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

Row Tracing with Hierarchical Occlusion Maps

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Universiteit Leiden Computer Science

Accelerating Ray-Tracing

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

Graphics 2009/2010, period 1. Lecture 8: ray tracing

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

Computer Graphics. Bing-Yu Chen National Taiwan University

Acceleration Structures. CS 6965 Fall 2011

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Computer Graphics Ray Casting. Matthias Teschner

CS 4620 Program 4: Ray II

Lecture 4 - Real-time Ray Tracing

Geometric Modeling in Graphics

Recall: Inside Triangle Test

Collision Detection II. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

Collision Detection. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

VIII. Visibility algorithms (II)

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

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

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

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

Geometric Algorithms. Geometric search: overview. 1D Range Search. 1D Range Search Implementations

Spatial Data Structures for Computer Graphics

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

Computer Graphics. - Rasterization - Philipp Slusallek

Spatial Data Structures and Acceleration Algorithms

Lecture 11: Ray tracing (cont.)

Motivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling

Topic 10: Scene Management, Particle Systems and Normal Mapping. CITS4242: Game Design and Multimedia

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

Transcription:

ray tracing II computer graphics ray tracing II 2006 fabio pellacini 1 improving raytracing speed computer graphics ray tracing II 2006 fabio pellacini 2

raytracing computational complexity ray-scene intersection is expensive improve by low-level optimizations important but does not provide scalability improve by reducing computational complexity computer graphics ray tracing II 2006 fabio pellacini 3 improving computational complexity ray-scene intersection is an O(n) algorithm, where n is the number of objects loop over each object, check intersection note that it is fundamentally a search algorithm use divide and conquer to turn it to O(log n) similar principles of search algorithms divide objects into sets discard sets of objects quickly test inside set only when necessary not as easy since data structures become complicated which data structures to use? computer graphics ray tracing II 2006 fabio pellacini 4

acceleration structures examples [Shirley original from Demarle] computer graphics ray tracing II 2006 fabio pellacini 5 bounding volumes wrap groups of objects in bounding volumes all points on the objects are inside the bounding vol. if ray does not hit volume, than it does hit the object if ray hits the volume, test the object [Shirley] computer graphics ray tracing II 2006 fabio pellacini 6

bounding volumes worth if volume hit-testing cheaper than obejct s e.g. polygon mesh inside a bounding sphere need to know if intersection exists, not where speed up by removing computation use only simple primitives sphere, axis-aligned boxes (AABB), oriented boxes (OBB) choose based on tightness of fit vs. intersection speed increasing tightness: spheres, AABBs, OOBBs increasing speed: OOBBs, AABBs, spheres computer graphics ray tracing II 2006 fabio pellacini 7 axis-aligned bounding boxes most commonly used intersection with multiple infinite slabs [Shirley] computer graphics ray tracing II 2006 fabio pellacini 8

axis-aligned boxes in 2D compute t for each plane [Shirley] computer graphics ray tracing II 2006 fabio pellacini 9 axis-aligned boxes in 2D [Shirley] computer graphics ray tracing II 2006 fabio pellacini 10

axis-aligned boxes extend to other quadrants by redefining intersections avoid division by zero as in Shirley 10.9 extend to 3D by including two new planes computer graphics ray tracing II 2006 fabio pellacini 11 hierarchical bounding volumes group bounding volumes hierarchically this is what gives us the expected O(log n) not provable, strongly depends on input data volumes bound all surfaces inside them not a perfect split: siblings volumes can overlap hierarchical intersection testing if parent does not intersect, then no intersection else intersect all children and pick the closest intersection (if any) computer graphics ray tracing II 2006 fabio pellacini 12

creating bounding hierarchies effective space partitioning is necessary following transform hierarchy is not always efficient basic greedy algorithm for binary trees pick a direction, say along x axis split objects into two groups, and bound them continue splitting each group change axis at each iteration: x,y,z,x,y,z goal 1: balanced number of children in subtrees split for same number of primitive in each group goal 2: equal space for each subtree split the parent bounding box in the middle spatially computer graphics ray tracing II 2006 fabio pellacini 13 binary space partitioning (BSP) trees conceptually similar to bounding hier. creation node defined by splitting plane often pick a plane orthogonal to x, then y, then z, call kd tree in this case children contain objects in one of two half spaces objects intersecting plane are in each child computer graphics ray tracing II 2006 fabio pellacini 14

intersecting BSP trees starts at the top and determine which of case 1: test only Left case 2: test Left; if no intersections test Right case 3: test Right; if no intersections test Left case 4: test only Right [Shirley] computer graphics ray tracing II 2006 fabio pellacini 15 regular space subdivision non hierarchical acceleration structure uniformly split scene in a volume grid same object can be in multiple grid cell but a point can only be in one cell at a time intersect by walking the grid incrementally [Shirley] computer graphics ray tracing II 2006 fabio pellacini 16

hierarchical regular space subdivision at each cell of a regular grid, store a regular grid normally 2-3 levels deep O(kn) behavior, with k << 1 expect to skip a constant fraction of all objects very fast incremental walk easy to update not efficient for scenes with big holes in them computer graphics ray tracing II 2006 fabio pellacini 17 acceleration structures which one is the winner? depends on type of input and if we need to update for animation start with a kd tree computer graphics ray tracing II 2006 fabio pellacini 18

software engineering considerations acceleration structs are subclasses of Surface high-level raytracing code should not know about them can switch data structures can combine data structures hierarchical grids as grids of grids hierarchical bounding volumes as volumes of surfaces hierarchical boxes with a grid per box in the leaves regular grid: stores Surface[n][n][n] bounding volume: stores Surface[n] often binary for simplicity BSP node: stores Surface[2] computer graphics ray tracing II 2006 fabio pellacini 19 texture mapping for raytracing computer graphics ray tracing II 2006 fabio pellacini 20

texture mapping considerations especially efficient in raytracing since ray-object intersection is very expensive trivial support for texture and bump mapping unclear how to efficiently do displacement maps makes us loose raytracing nice properties mapping function: object-intersection code returns uv parameters computer graphics ray tracing II 2006 fabio pellacini 21 determining mapping function sphere: given intersection point P, return angles from spherical coordinates triangle: change intersection code to use baricentric coordinates Shirley, Ch. 10.3.2 computer graphics ray tracing II 2006 fabio pellacini 22

filtering textures compute average of texture subtended by pixel in general quite hard for reflection/refraction ray differentials new and elegant discovery: Igehy, SIGGRAPH 1999 propagate differentials together with rays [Igehy, 1999] computer graphics ray tracing II 2006 fabio pellacini 23 filtering texture comparison no filtering [Igehy, 1999] bad for view rays computer graphics ray tracing II 2006 fabio pellacini 24

filtering texture comparison mip-map filtering based on distance [Igehy, 1999] ok for view ray, bad for reflection/refractions computer graphics ray tracing II 2006 fabio pellacini 25 filtering texture comparison mip-map filtering based on ray differentials [Igehy, 1999] ok in most cases, just a bit of overblur computer graphics ray tracing II 2006 fabio pellacini 26

filtering texture comparison accurate filtering based on ray differentials [Igehy, 1999] works great computer graphics ray tracing II 2006 fabio pellacini 27