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

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

Accelerated Raytracing

Spatial Data Structures

Spatial Data Structures

Spatial Data Structures

Spatial Data Structures

Spatial Data Structures

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

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 457 Autumn 2017

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

Accelerating Ray Tracing

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017

Ray Intersection Acceleration

Anti-aliasing and Monte Carlo Path Tracing

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

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

Ray Tracing Acceleration. CS 4620 Lecture 20

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

Acceleration Data Structures

Accelerating Ray-Tracing

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

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

A Model to Evaluate Ray Tracing Hierarchies

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

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

Ray Tracing Acceleration. CS 4620 Lecture 22

Ray Intersection Acceleration

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

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

CS 431/636 Advanced Rendering Techniques

Advanced Ray Tracing

Ray Tracing Acceleration Data Structures

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

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

Ray Tracing: Intersection

Sung-Eui Yoon ( 윤성의 )

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

Acceleration Structures. CS 6965 Fall 2011

VIII. Visibility algorithms (II)

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

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

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

Intersection Acceleration

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Today. Acceleration Data Structures for Ray Tracing. Cool results from Assignment 2. Last Week: Questions? Schedule

improving raytracing speed

Lecture 2 - Acceleration Structures

CS559: Computer Graphics. Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008

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

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

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

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

The Traditional Graphics Pipeline

Bounding Volume Hierarchies. CS 6965 Fall 2011

Reading Ray Intersection Chapter 2: Geometry and Transformations Acceleration Covers basic math and PBRT implementation: read on your own

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

Lecture 11: Ray tracing (cont.)

Distribution Ray Tracing

Advanced 3D-Data Structures

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

Ray Tracing. Outline. Ray Tracing: History

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

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

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

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Collision and Proximity Queries

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Row Tracing with Hierarchical Occlusion Maps

Acceleration. Digital Image Synthesis Yung-Yu Chuang 10/11/2007. with slides by Mario Costa Sousa, Gordon Stoll and Pat Hanrahan

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

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

Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

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

Ray Casting. 3D Rendering. Ray Casting. Ray Casting. Ray Casting. Ray Casting

CPSC GLOBAL ILLUMINATION

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

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

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

CSG obj. oper3. obj1 obj2 obj3. obj5. obj4

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

Computer Graphics. - Rasterization - Philipp Slusallek

11 - Spatial Data Structures

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

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

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

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Collision Detection. Pu Jiantao.

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

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Distribution Ray-Tracing. Programação 3D Simulação e Jogos

Ray Casting. COS 426, Spring 2015 Princeton University

CS 465 Program 5: Ray II

Lecture 11. More Ray Casting/Tracing

Visible-Surface Detection Methods. Chapter? Intro. to Computer Graphics Spring 2008, Y. G. Shin

Transcription:

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

Reading Required: Watt, sections 12.5.3 12.5.4, 14.7 Further reading: A. Glassner. An Introduction to Ray Tracing. Academic Press, 1989. [In the lab.] University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 2

Aliasing in rendering One of the most common rendering artifacts is the jaggies. Consider rendering a white polygon against a black background: We would instead like to get a smoother transition: University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 3

Anti-aliasing Q: How do we avoid aliasing artifacts? 1. Sampling: 2. Pre-filtering: 3. Combination: Example - polygon: University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 4

Polygon anti-aliasing University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 5

Antialiasing in a ray tracer We would like to compute the average intensity in the neighborhood of each pixel. When casting one ray per pixel, we are likely to have aliasing artifacts. To improve matters, we can cast more than one ray per pixel and average the result. A.k.a., super-sampling and averaging down. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 6

Speeding it up Vanilla ray tracing is really slow! Consider: m x m pixels, k x k supersampling, and n primitives, average ray path length of d, with 2 rays cast recursively per intersection. Complexity = For m=1,000,000, k = 5, n = 100,000, d=8 very expensive!! In practice, some acceleration technique is almost always used. We ve already looked at reducing d with adaptive ray termination. Now we look at reducing the effect of the k and n terms. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 7

Antialiasing by adaptive sampling Casting many rays per pixel can be unnecessarily costly. For example, if there are no rapid changes in intensity at the pixel, maybe only a few samples are needed. Solution: adaptive sampling. Q: When do we decide to cast more rays in a particular area? University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 8

Faster ray-polyhedron intersection Let s say you were intersecting a ray with a polyhedron: Straightforward method intersect the ray with each triangle return the intersection with the smallest t-value. Q: How might you speed this up? University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 9

Ray Tracing Acceleration Techniques Approaches Faster Intersection Fewer Rays Generalized Rays N 1 Uniform grids Spatial hierarchies k-d, oct-tree, bsp hierarchical grids Hierarchical bounding volumes (HBV) Tighter bounds Faster intersector Early ray termination Adaptive sampling Beam tracing Cone tracing Pencil tracing University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 10

Uniform spatial subdivision Another approach is uniform spatial subdivision. Idea: Partition space into cells (voxels) Associate each primitive with the cells it overlaps Trace ray through voxel array using fast incremental arithmetic to step from cell to cell University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 11

Uniform Grids Preprocess scene Find bounding box University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 12

Uniform Grids Preprocess scene Find bounding box Determine resolution n = n n n! n v x y z o max( n, n, n ) = d n 3 x y z o University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 13

Uniform Grids Preprocess scene Find bounding box Determine resolution Place object in cell, if object overlaps cell max( n, n, n ) = d n 3 x y z o University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 14

Uniform Grids Preprocess scene Find bounding box Determine resolution Place object in cell, if object overlaps cell Check that object intersects cell max( n, n, n ) = d n 3 x y z o University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 15

Uniform Grids Preprocess scene Traverse grid 3D line 3D-DDA 6-connected line University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 16

Caveat: Overlap Optimize for objects that overlap multiple cells Traverse until tmin(cell) > tmax(ray) Problem: Redundant intersection tests: Solution: Mailboxes Assign each ray an increasing number Primitive intersection cache (mailbox) Store last ray number tested in mailbox Only intersect if ray number is greater University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 17

Non-uniform spatial subdivision Still another approach is non-uniform spatial subdivision. Other variants include k-d trees and BSP trees. Various combinations of these ray intersections techniques are also possible. See Glassner and pointers at bottom of project web page for more. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 18

Non-uniform spatial subdivision Best approach - k-d trees or perhaps BSP trees More adaptive to actual scene structure BSP vs. k-d tradeoff between speed from simplicity and better adaptability 1 0 2 3 4 5 6 7 8 University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 19

Spatial Hierarchies A A Letters correspond to planes (A) Point Location by recursive search University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 20

Spatial Hierarchies A B B A Letters correspond to planes (A, B) Point Location by recursive search University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 21

Spatial Hierarchies A D B B C C D A Letters correspond to planes (A, B, C, D) Point Location by recursive search University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 22

Variations kd-tree oct-tree bsp-tree University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 23

Ray Traversal Algorithms Recursive inorder traversal [Kaplan, Arvo, Jansen] t t * max t * t min t * t max < t * t < t* < t min max t* < t min Intersect(L,tmin,tmax) Intersect(L,tmin,t*) Intersect(R,tmin,tmax) Intersect(R,t*,tmax) University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 24

Build Hierarchy Top-Down? Choose splitting plane Midpoint Median cut Surface area heuristic University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 25

Surface Area and Rays Number of rays in a given direction that hit an object is proportional to its projected area A The total number of rays hitting an object is Crofton s Theorem: S For a convex body A = For example: sphere 4 4! A S = 4! r 2 A = A =! r 2 University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 26

Surface Area and Rays The probability of a ray hitting a convex shape that is completely inside a convex cell equals S c S o S Pr[ r! S r! S ] = o o c S c University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 27

Surface Area Heuristic Intersection time t i Traversal time t t a b t i = 80t t C = t + p N t + p N t t a a i b b i University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 28

Surface Area Heuristic 2n splits a b p a S = a p = b b S S S University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 29

Hierarchical bounding volumes We can generalize the idea of bounding volume acceleration with hierarchical bounding volumes. Key: build balanced trees with tight bounding volumes. Many different kinds of bounding volumes. Note that bounding volumes can overlap. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 30