Ray Tracing. Last Time? Reading for Today. Reading for Today

Similar documents
Ray Tracing. Quiz Discussion. Announcements: Final Projects. Last Time? Durer s Ray Casting Machine. Today

Ray Tracing. Last Time? Today. Ray Casting. Durer s Ray Casting Machine. Reading for Today

Ray Tracing. Announcements: Quiz. Last Time? Today. Durer s Ray Casting Machine. Ray Casting

Last Time? Ray Casting. Administrivia: Lab & Office Hours. Notes on Assignments. Ray Casting. Overview of Today

Advanced Ray Tracing

Lecture 10: Ray tracing

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

Local vs. Global Illumination & Radiosity

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

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

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

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

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

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

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

Photorealism: Ray Tracing

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

Computer Graphics. Ray Tracing. Based on slides by Dianna Xu, Bryn Mawr College

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

CS-184: Computer Graphics. Administrative

CS 428: Fall Introduction to. Raytracing. Andrew Nealen, Rutgers, /18/2009 1

Sung-Eui Yoon ( 윤성의 )

Lecture 11: Ray tracing (cont.)

Implementation Issues

Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required: Watt, sections , (handout) Further reading:

Ray tracing Tutorial. Lukas Herzberger

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

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

MIT Ray Tracing Ray Tracing

Supplement to Lecture 16

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

Homework 2 Questions? Animation, Motion Capture, & Inverse Kinematics. Velocity Interpolation. Handing Free Surface with MAC

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

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

Ray Tracing. Outline. Ray Tracing: History

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

Reading. Ray Tracing. Eye vs. light ray tracing. Geometric optics. Required:

Geometric optics. The University of Texas at Austin CS384G Computer Graphics Don Fussell

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

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

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

Distributed Ray Tracing

Ray-Tracing. Misha Kazhdan

3D Rendering and Ray Casting

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

EECS 487: Interactive Computer Graphics

Lighting and Shading

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

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

3D Rendering and Ray Casting

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

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Shading, Advanced Rendering. Week 7, Wed Feb 28

Distribution Ray Tracing

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

Photorealism. Photorealism: Ray Tracing. Ray Tracing

Questions??? Announcements Assignment 3 due today

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

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

Ray Tracing Basics I. Computer Graphics as Virtual Photography. camera (captures light) real scene. photo. Photographic print. Photography: processing

Computer Graphics. Shi-Min Hu. Tsinghua University

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

CS 431/636 Advanced Rendering Techniques

Introduction to Ray-tracing Objectives

A Little Background. Motivation. Motivation

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

Animation, Motion Capture, & Inverse Kinematics

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

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

Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

COMP 175 COMPUTER GRAPHICS. Lecture 11: Recursive Ray Tracer. COMP 175: Computer Graphics April 9, Erik Anderson 11 Recursive Ray Tracer

Anti-aliasing and Monte Carlo Path Tracing

Intro to Ray-Tracing & Ray-Surface Acceleration

Ray Tracing. CPSC 453 Fall 2018 Sonny Chan

CS5620 Intro to Computer Graphics

Ray tracing. EECS 487 March 19,

Raytracing CS148 AS3. Due :59pm PDT

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

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Ray Tracing COMP575/COMP770

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

Lighting and Reflectance COS 426

Animation, Motion Capture, & Inverse Kinematics. Announcements: Quiz

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

Recursive Ray Tracing. Ron Goldman Department of Computer Science Rice University

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

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

Ray-tracing Cont. Ray-tracing

CS384G Midterm Examination Spring 2008

Agenda. Ray(tracing(algorithm( Code(structure( Ray(intersec;ons Sphere Triangle Hints Transforma;ons Debugging How(to(start

COMP371 COMPUTER GRAPHICS

Comp 410/510 Computer Graphics. Spring Shading

Review for Ray-tracing Algorithm and Hardware

Homework 3: Shading, Raytracing, and Image Processing

Transcription:

Last Time? Ray Tracing Keyframing Procedural Animation Physically-Based Animation Forward and Inverse Kinematics Motion Capture Two solutions Reading for Today Artist-Directed Dynamics for 2D Animation, Bai, Kaufman, Liu, & Popović, SIGGRAPH 2016 Reading for Today Articulated Swimming Creatures Jie Tan, Yuting Gu, Greg Turk, and C. Karen Liu, SIGGRAPH 2011 http://www.cc.gatech.edu/~jtan34/project/articulatedswimmingcreatures.html

Reading for Today Today Ray Casting Flexible Muscle-Based Locomotion for Bipedal Creatures, Geijtenbeek, van de Panne, van der Stappen, SIGGRAPH Asia 2013 Ray-Plane Intersection Ray-Sphere Intersection Point in Polygon Ray Tracing Recursive Ray Tracing Distribution Ray Tracing Durer s Ray Casting Machine Ray Casting Albrecht Durer, 16th century For every pixel Finding the intersection and normal is the central part of ray casting For every object in the scene Construct a ray from the eye Find intersection with the ray Keep if closest Shade depending on light and normal vector

A Note on Local Shading Ray Representation? Surface/Scene Characteristics: Two vectors: N surface normal direction to light viewpoint L Origin Direction (normalized is better) V Parametric line (explicit representation) Material Properties P(t) = origin + t * direction color/texture diffuse (matte) specular (shiny) P(t) direction More later! Diffuse sphere Specular spheres 3D Plane Representation? Plane defined by Po = (x,y,z) n = (A,B,C) H(p) = d > 0 P Implicit plane equation H(P) = Ax+By+Cz+D = 0 = n P + D = 0 Point-Plane distance? If n is normalized, distance to plane, d = H(P) d is the signed distance! origin Explicit vs. Implicit? Ray equation is explicit normal Po H P' H(p) = d < 0 P(t) = Ro + t * Rd Parametric Generates points Harder to verify that a point is on the ray Plane equation is implicit H(P) = n P + D = 0 Solution of an equation Does not generate points Verifies that a point is on the plane

Ray-Plane Intersection Additional Housekeeping Intersection means both are satisfied So, insert explicit equation of ray into implicit equation of plane & solve for t Verify that intersection is closer than previous P(t) < tcurrent Verify that it is not out of range (behind eye) P(t) = Ro + t * Rd P(t) > tmin H(P) = n P + D = 0 n (Ro + t * Rd) + D = 0 t = -(D + n Ro) / n Rd P(t) P(t) Normal at Surface Intersection Ray-Triangle Intersection Needed for shading Intersect with the plane Then use barycentric coordinates: diffuse: dot product between light and normal Normal of a plane is constant! normal P(α, β, γ) = αa + βb + γc with α + β + γ =1 If 0 < α < 1 & 0 < β < 1 & 0 < γ < 1 then the point is inside the triangle! c P Rd a b Ro

How Do We Compute α, β, γ? Using Cramer s Rule Ratio of opposite sub-triangle area to total area Used to solve for one variable at a time in system of equations α = Aa/A β = Ab/A γ = Ac/A Use signed areas for points outside the triangle c c Aa Aa A A P P a α>0 a b α<0 denotes the determinant Can be copied mechanically into code b But how do I know if the point is outside the triangle? That s what I was trying to determine! Sphere Representation? Ray-Sphere Intersection Implicit sphere equation Insert explicit equation of ray into implicit equation of sphere & solve for t Assume centered at origin (easy to translate) H(P) = P P - r2 = 0 P(t) = Ro + t*rd H(P) = P P - r2 = 0 (Ro + trd) (Ro + trd) - r2 = 0 Rd Rdt2 + 2Rd Rot + Ro Ro - r2 = 0 Rd Ro Rd Ro

Ray-Sphere Intersection Questions? Quadratic: at2 + bt + c = 0 a = 1 (remember, Rd = 1) b = 2Rd Ro c = Ro Ro r2 with discriminant and solutions What does it mean if there are no solutions, 1 solution, or 2 solutions? depth Reading for Next Friday Today "An improved illumination model for shaded display" Turner Whitted, 1980. Ray Casting Ray Tracing normals Shadows Reflection Refraction Recursive Ray Tracing Distribution Ray Tracing local shading

How Can We Add Shadows? Mirror Reflection Find the point to be shaded For every light, Construct ray from point to light For every object find intersection of ray with object If no objects between point and light Add contribution from light Cast ray symmetric with respect to the normal Multiply by reflection coefficient (color) Reflection Transparency Reflection angle = view angle R = V 2 (V N) N Cast ray in refracted direction Multiply by transparency coefficient (color) N V R θv θr V N N V N N V

Qualitative Refraction Refraction I M sin Өi ηi ηt I N M = (N cos Өi I) / sin Өi Өi N cos Өi T = N cos ӨT + M sin ӨT M = N cos ӨT + (N cos Өi I) sin ӨT / sin Өi = N cos ӨT + (N cos Өi I) ηr ӨT -N = N cos Өi M sin Өi Note: The math works the same tracing the ray either forwards or backwards, but it s really easy to get confused and have get a sign error in the direction. T = [ ηr cos Өi cos ӨT ] N ηr I = [ ηr cos Өi (1 sin2 ӨT )] N ηr I = [ ηr cos Өi (1 ηr2 sin2 Өi )] N ηr I = [ ηr cos Өi (1 ηr2 (1 cos2 Өi ) )] N ηr I = [ ηr (N I) (1 ηr2 (1 (N I)2 ))] N ηr I Total internal reflection when the square root is imaginary Don t forget to normalize! From Color and Light in Nature by Lynch and Livingston Refraction & the Sidedness of Objects Total Internal Reflection Make sure you know whether you re entering or leaving the transmissive material: N I I ηi = material index ηi=1 ηt = material index ηt= 1 T T N What about intersecting transparent objects? From Color and Light in Nature by Lynch and Livingston

Questions? Today Ray Tracing trace ray Intersect all objects color = ambient term For every light cast shadow ray Stopping criteria: color += local shading term Recursion depth If mirror color += colorrefl * Stop after a number trace reflected ray of bounces If transparent Ray contribution color += colortrans * Stop if reflected / trace transmitted ray transmitted contribution Does it ever end? becomes too small Ray Casting Ray Tracing Recursive Ray Tracing Distribution Ray Tracing The Ray Tree Eye T3 R2 N2 T1 R1 L2 R3 L1 N3 N1 L1 R1 L3 T1 L2 Eye Ni surface normal Ri reflected ray Li shadow ray Ti transmitted (refracted) ray R2 L3 R3 Complexity? T3

Ray Debugging Other Reading for Next Friday Visualize the ray tree for single image pixel "Distributed Ray Tracing", Cook, Porter, & Carpenter, SIGGRAPH 1984. incoming reflected ray shadow ray transmitted (refracted) ray Today Shadows one shadow ray per intersection per point light source Ray Casting Ray Tracing Recursive Ray Tracing Distribution Ray Tracing no shadow rays Soft shadows Antialiasing (getting rid of jaggies) Glossy reflection Motion blur Depth of field (focus) one shadow ray

Shadows & Light Sources Soft Shadows multiple shadow rays to sample area light source one shadow ray http://www.davidfay.com/index.php clear bulb http://3media.initialized.org/photos/2000-10-18/index_gall.htm frosted bulb http://www.pa.uky.edu/~sciworks/light/preview/bulb2.htm lots of shadow rays Antialiasing Supersampling multiple rays per pixel jaggies w/ antialiasing Reflection one reflection ray per intersection point light area light θ θ perfect mirror

Glossy Reflection Motion Blur multiple reflection rays Sample objects temporally Justin Legakis θ θ polished surface Rob Cook Depth of Field Ray Tracing Algorithm Analysis multiple rays per pixel film focal length Justin Legakis Ray casting Lots of primitives Recursive Distributed Ray Tracing Effects Soft shadows Anti-aliasing Glossy reflection Motion blur Depth of field cost height * width * num primitives * intersection cost * size of recursive ray tree * num shadow rays * num supersamples * num glossy rays * num temporal samples * num focal samples *... can we reduce this? these can serve double duty