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

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

Accelerated Raytracing

Spatial Data Structures

Spatial Data Structures

Spatial Data Structures

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

Spatial Data Structures

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

Spatial Data Structures

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

Anti-aliasing and Monte Carlo Path Tracing

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

Ray Tracing Acceleration. CS 4620 Lecture 20

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

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

Ray Intersection Acceleration

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

Acceleration Data Structures

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

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

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

Accelerating Ray-Tracing

Ray Tracing Acceleration. CS 4620 Lecture 22

Sung-Eui Yoon ( 윤성의 )

Ray Tracing: Intersection

Ray Intersection Acceleration

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

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

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

CS 431/636 Advanced Rendering Techniques

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

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

Intersection Acceleration

Computer Graphics. Bing-Yu Chen National Taiwan University

Ray Tracing Acceleration Data Structures

Advanced Ray Tracing

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

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

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

Acceleration Structures. CS 6965 Fall 2011

VIII. Visibility algorithms (II)

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

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

improving raytracing speed

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

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

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

Ray Tracing. Outline. Ray Tracing: History

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

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

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

The Traditional Graphics Pipeline

A Model to Evaluate Ray Tracing Hierarchies

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

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

Lecture 2 - Acceleration Structures

Lecture 11: Ray tracing (cont.)

Distribution Ray Tracing

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

Bounding Volume Hierarchies. CS 6965 Fall 2011

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

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline

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

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

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

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

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

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. 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

Collision and Proximity Queries

CPSC GLOBAL ILLUMINATION

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

Row Tracing with Hierarchical Occlusion Maps

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

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

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

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

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

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

Ray Tracing Foley & Van Dam, Chapters 15 and 16

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

CS 4620 Program 4: Ray II

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

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

11 - Spatial Data Structures

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

Ray Casting of Trimmed NURBS Surfaces on the GPU

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

CS 465 Program 5: Ray II

Ray Casting. COS 426, Spring 2015 Princeton University

Lecture 11. More Ray Casting/Tracing

Overview of 3D Object Representations

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Point based Rendering

Transcription:

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

eading! equired:! Watt, sections 12.5.3 12.5.4, 14.7! Further reading:! A. Glassner. An Introduction to ay 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

ay Tracing Acceleration Techniques Approaches Faster Intersection Fewer ays Generalized ays 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: edundant 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 partitioning 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! Non-partitioning approach! Hierarchical bounding volumes! Build similar to k-d tree build University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 19

Kd-tree - Build The University of Texas at Austin Department of Computer Science Don Fussell 20

Kd-tree L The University of Texas at Austin Department of Computer Science Don Fussell 21

Kd-tree L L The University of Texas at Austin Department of Computer Science Don Fussell 22

Kd-tree L L L The University of Texas at Austin Department of Computer Science Don Fussell 23

Kd-tree L LL L L L The University of Texas at Austin Department of Computer Science Don Fussell 24

Kd-tree L LL L L LLL LL L The University of Texas at Austin Department of Computer Science Don Fussell 25

Kd-tree L LL L L LLL LL L LLLL LLL The University of Texas at Austin Department of Computer Science Don Fussell 26

Kd-tree L LL L L LLL LL LL L L LLLL LLL The University of Texas at Austin Department of Computer Science Don Fussell 27

Kd-tree L LL L L LLL LL LL LL L L LLLL LLL LLL The University of Texas at Austin Department of Computer Science Don Fussell 28

Kd-tree L LL L L LLL LL LL LL L L LLLL LLL LLL LLL LL The University of Texas at Austin Department of Computer Science Don Fussell 29

Surface Area and ays! 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 30

Surface Area and ays! 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 31

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 32

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 33

ay Traversal Kernel Depth first traversal t max t * t * t min t max < t * t < t* < t min max t* < t * t min Intersect(L,tmin,tmax) Intersect(L,tmin,t*) Intersect(,t*,tmax) Intersect(,tmin,tmax) The University of Texas at Austin Department of Computer Science Don Fussell 34

Kd-tree - Traversal L Stack: LLL LL LL LL L L Current: oot LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 35

Kd-tree - Traversal L Stack: LLL LL LL LL L L Current: L LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 36

Kd-tree - Traversal L Stack: LLL LL LL LL L L Current: LL LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 37

Kd-tree - Traversal L Stack: LL, LLL LL LL LL L L Current: LLL LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 38

Kd-tree - Traversal L Stack: LL, LLL LL LL LL L L Current: LLL LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 39

Kd-tree - Traversal L Stack: LLL LL LL LL L L Current: LLL LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 40

Kd-tree - Traversal L Stack: LLL LL LL LL L L Current: LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 41

Kd-tree - Traversal L Stack: LLL LL LL LL L L Current: L LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 42

Kd-tree - Traversal L Stack: LLL LL LL LL L L Current: LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 43

Kd-tree - Traversal L Stack: LLL LL LL LL L L Current: LLLL LLL LLL LLL LL L LL L The University of Texas at Austin Department of Computer Science Don Fussell 44

Kd-tree - Traversal L LL L L LLL LL LL LL L L LLLL LLL LLL LLL LL The University of Texas at Austin Department of Computer Science Don Fussell 45

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

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 47