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

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

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

Ray Tracing Acceleration. CS 4620 Lecture 20

Ray Tracing Acceleration. CS 4620 Lecture 22

Specular reflection. Lighting II. Snell s Law. Refraction at boundary of media

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

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

improving raytracing speed

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

Acceleration Data Structures

Accelerated Raytracing

Sung-Eui Yoon ( 윤성의 )

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

Accelerating Ray Tracing

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

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

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

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

Spatial Data Structures

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

CS 431/636 Advanced Rendering Techniques

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

Spatial Data Structures

CPSC GLOBAL ILLUMINATION

Ray Tracing Acceleration Data Structures

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

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

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

Spatial Data Structures

Spatial Data Structures

COMP 175: Computer Graphics April 11, 2018

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

Spatial Data Structures

Intersection Acceleration

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

Advanced Ray Tracing

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

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

Ray Intersection Acceleration

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

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

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

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

Computer Graphics Ray Casting. Matthias Teschner

Accelerating Ray-Tracing

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

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

Distribution Ray Tracing

Acceleration Structures. CS 6965 Fall 2011

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

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

Ray Intersection Acceleration

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

The Traditional Graphics Pipeline

CS 465 Program 5: Ray II

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

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

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

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

Anti-aliasing and Monte Carlo Path Tracing

Recursion and Data Structures in Computer Graphics. Ray Tracing

EECS 487: Interactive Computer Graphics

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

Ray Tracing Foley & Van Dam, Chapters 15 and 16

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

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

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

Distributed Ray Tracing

The Traditional Graphics Pipeline

The exam begins at 2:40pm and ends at 4:00pm. You must turn your exam in when time is announced or risk not having it accepted.

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

Lecture 11. More Ray Casting/Tracing

CS535 Fall Department of Computer Science Purdue University

distribution ray tracing

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

CS 4620 Program 4: Ray II

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

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

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

Ray tracing. EECS 487 March 19,

Bounding Volume Hierarchies. CS 6965 Fall 2011

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

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

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

Ray Tracing Part 2. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar

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

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

Distributed Ray Tracing

Recall: Inside Triangle Test

Lecture 2 - Acceleration Structures

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

Physically Realistic Ray Tracing

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

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

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

distribution ray-tracing

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Global Illumination The Game of Light Transport. Jian Huang

Transcription:

CS4620/5620: Lecture 37 Ray Tracing 1 Announcements Review session Tuesday 7-9, Phillips 101 Posted notes on slerp and perspective-correct texturing Prelim on Thu in B17 at 7:30pm 2

Basic ray tracing Basic ray tracer: one sample for everything one ray per pixel one shadow ray for every point light one reflection ray per intersection one refraction ray (if necessary) per intersection Many advanced methods build on the basic ray tracing paradigm 3 Soft shadows 4

Creating soft shadows 5 Glossy reflection [Lafortune et al. 97] 6

Cause of glossy reflection smooth surfaces produce sharp reflections 7 Cause of glossy reflection rough surfaces produce soft (glossy) reflections 8

Creating glossy reflections Jitter the reflected rays Not exactly in mirror direction; add a random offset Can work out math to match Phong exactly Can do this by jittering the normal if you want 9 Creating glossy reflections 10

Depth of field 11 Cause of focusing effects point aperture produces always-sharp focus 12

Cause of focusing effects what lenses do (roughly) 13 Cause of focusing effects finite aperture produces limited depth of field 14

Depth of field Make eye rays start at random points on aperture always going toward a point on the focus plane 15 Motion blur [Cook, Porter, Carpenter 1984] 16

Cause of motion blur 17 Motion blur Caused by finite shutter times Introduce time as a variable throughout the system object are hit by rays according to their position at a given time Then generate rays with times distributed over shutter interval 18

Generating a full ray tracer A complicated question in general Basic idea: start with random points in a square Monte Carlo methods see 600-level graphics courses 19 20

21 How to make ray tracing fast? Ray tracing is typically slow Ray tracers spend most of their time in ray-surface intersection methods Ways to improve speed Make intersection methods more efficient Yes, good idea. But only gets you so far Call intersection methods fewer times Intersecting every ray with every object is wasteful Basic strategy: efficiently find big chunks of geometry that definitely do not intersect a ray 22

Bounding volumes Quick way to avoid intersections: bound object with a simple volume Object is fully contained in the volume If it doesn t hit the volume, it doesn t hit the object So test bvol first, then test object if it hits [Glassner 89, Fig 4.5] 23 Implementing bounding volume Just add new Surface subclass, BoundedSurface Contains a bounding volume and a reference to a surface Intersection method: Intersect with bvol, return false for miss Return surface.intersect(ray) Like transformations, common to merge with group This change is transparent to the renderer (only it might run faster) Note that all Surfaces will need to be able to supply bounding volumes for themselves 24

Bounding volumes Cost: more for hits and near misses, less for far misses Worth doing? It depends: Cost of bvol intersection test should be small Therefore use simple shapes (spheres, boxes, ) Cost of object intersect test should be large Bvols most useful for complex objects Tightness of fit should be good Loose fit leads to extra object intersections Tradeoff between tightness and bvol intersection cost 25 If it s worth doing, it s worth doing hierarchically! Bvols around objects may help Bvols around groups of objects will help Bvols around parts of complex objects will help Leads to the idea of using bounding volumes all the way from the whole scene down to groups of a few objects 26

Implementing a bvol hierarchy A BoundedSurface can contain a list of Surfaces Some of those Surfaces might be more BoundedSurfaces Voilà! A bounding volume hierarchy And it s all still transparent to the renderer 27 BVH construction example 28

BVH ray-tracing example Trace rays with root node If intersection, trace rays with ALL children (If no intersection, eliminate tests with all children) 29 Choice of bounding volumes Spheres -- easy to intersect, not always so tight Axis-aligned bounding boxes (AABBs) -- easy to intersect, often tighter (esp. for axis-aligned models) Oriented bounding boxes (OBBs) -- easy to intersect (but cost of transformation), tighter for arbitrary objects Computing the bvols For primitives -- generally pretty easy For groups -- not so easy for OBBs (to do well) For transformed surfaces -- not so easy for spheres 30

Axis aligned bounding boxes Probably easiest to implement Computing for primitives Cube: duh! Sphere, cylinder, etc.: pretty obvious Groups or meshes: min/max of component parts How to intersect them Treat them as an intersection of slabs (see Shirley) 31 Building a hierarchy Can do it top down or bottom up Top down Make bbox for whole scene, then split into parts Recurse on parts Stop when there are just a few objects in your box Or if you are too deep (say max depth = 24) 32

Building a hierarchy How to partition? Practical: partition along axis Center partition Simple Unbalanced tree Median partition More expensive More balanced tree Objects that cross the median partition Pick one of the sides to put the object on Expand the bbox to cover that object 33 Construction Possibility 1 34

Construction Possibility 2 35 Hierarchical Data Structures From O(N) to O(log N) Cluster objects hierarchically Single intersection might eliminate cluster Bounding volume hierarchy Space subdivision Octree Kd-tree Uniform 36

Regular space subdivision An entirely different approach: uniform grid of cells 37 Non-regular space subdivision k-d Tree subdivides space, like grid adaptive, like BVH 38

Implementing acceleration structures Conceptually simple to build acceleration structure into scene structure Better engineering decision to separate them 39