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

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

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

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

Lecture 10: Ray tracing

Local vs. Global Illumination & Radiosity

Advanced Ray Tracing

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

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

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

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

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

Supplement to Lecture 16

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

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

Sung-Eui Yoon ( 윤성의 )

Photorealism: Ray Tracing

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

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

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

Lecture 11: Ray tracing (cont.)

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

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

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

Ray-Tracing. Misha Kazhdan

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

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

Ray tracing Tutorial. Lukas Herzberger

Implementation Issues

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

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

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

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

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

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

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: Watt, sections , (handout) Further reading:

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

CS-184: Computer Graphics. Administrative

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

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

Parallelization. Memory coherency helps when distributing rays to various threads/processors

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

Ray Tracing. Outline. Ray Tracing: History

MIT Ray Tracing 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

CS5620 Intro to Computer Graphics

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

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

Ray Tracing. Local Illumination. Object Space: Global Illumination. Image Space: Backward Ray Tracing. First idea: Forward Ray Tracing

Lighting and Reflectance COS 426

Lighting and Shading

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

Distributed Ray Tracing

Shading, Advanced Rendering. Week 7, Wed Feb 28

COMP371 COMPUTER GRAPHICS

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

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

3D Rendering and Ray Casting

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

CS 431/636 Advanced Rendering Techniques

Computer Graphics. Ray Tracing. Copyright Gotsman, Elber, Barequet, Karni, Sheffer. Page 1. Ray-Tracing. Illumination Models

Computer Graphics. Shi-Min Hu. Tsinghua University

3D Rendering and Ray Casting

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

Intro to Ray-Tracing & Ray-Surface Acceleration

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

Lecture 19: All Together with Refraction

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

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

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

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

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

Indirect Illumination

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

CPSC GLOBAL ILLUMINATION

Illumination. Thomas Funkhouser Princeton University C0S 426, Fall 2000

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

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

Distribution Ray Tracing

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

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

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

Raytracing. COSC 4328/5327 Scott A. King

Ray casting. Ray casting/ray tracing

Anti-aliasing and Monte Carlo Path Tracing

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

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Lecture 18: Primer on Ray Tracing Techniques

CS 6620 Shading. Steve Parker Peter Shirley

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

Comp 410/510 Computer Graphics. Spring Shading

Modeling Transformations

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

Raytracing CS148 AS3. Due :59pm PDT

CS 4204 Computer Graphics

Illumination. Courtesy of Adam Finkelstein, Princeton University

Ray Tracing. Kjetil Babington

A Little Background. Motivation. Motivation

Indirect Illumination

Transcription:

Last Time? a Tracing Keframing Procedural nimation Phsicall-Based nimation Forward and Inverse Kinematics Motion Capture Two solutions Toda eading for Toda a Casting "n improved illumination model for shaded displa" Turner Whitted, 1980. a-plane Intersection a-sphere Intersection Point in Polgon a Tracing ecursive a Tracing Distribution a Tracing Durer s a Casting Machine a Casting lbrecht Durer, 16th centur For ever piel Construct a ra from the ee For ever object in the scene Finding the intersection and normal is the central part of ra casting Find intersection with the ra Keep if closest Shade depending on light and normal vector 1

ote on Local Shading a epresentation? Surface/Scene Characteristics: surface normal direction to light viewpoint Material Properties color/teture diffuse (matte) specular (shin) More later! L V Two vectors: Origin Direction (normalied is better) Parametric line (eplicit representation) P(t) = origin + t * direction P(t) direction origin Diffuse sphere Specular spheres 3D Plane epresentation? Plane defined b P o = (,,) n = (,B,C) Implicit plane equation H(P) = +B+C+D = 0 = n P + D = 0 Point-Plane distance? If n is normalied, distance to plane, d = H(P) d is the signed distance! H(p) = d > 0 P normal P o H P' H(p) = d < 0 Eplicit vs. Implicit? a equation is eplicit P(t) = o + t * d Parametric Generates points Harder to verif that a point is on the ra 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 a-plane Intersection dditional Housekeeping Intersection means both are satisfied So, insert eplicit equation of ra into implicit equation of plane & solve for t P(t) P(t) = o + t * d H(P) = n P + D = 0 n ( o + t * d ) + D = 0 t = -(D + n o ) / n d Verif that intersection is closer than previous P(t) < t current Verif that it is not out of range (behind ee) P(t) > t min P(t) 2

ormal eeded for shading diffuse: dot product between light and normal ormal of a plane is constant! normal a-triangle Intersection Use barcentric coordinates: P(α, β, γ) = αa + βb + γc with α + β + γ =1 If 0 < α < 1 & 0 < β < 1 & 0 < γ < 1 then the point is inside the triangle! c P d o a b How Do We Compute α, β, γ? atio of opposite sub-triangle area to total area α = a / β = b / γ = c / Use signed areas for points outside the triangle a P α > 0 c a b a But how do I know if the point is outside the triangle? That s what I was tring to determine! P α < 0 c b a Using Cramer s ule Used to solve for one variable at a time in sstem of equations β = t = o o o d d d γ = o o o o o o denotes the determinant Can be copied mechanicall into code d d d Sphere epresentation? Implicit sphere equation ssume centered at origin (eas to translate) H(P) = P P - r 2 = 0 a-sphere Intersection Insert eplicit equation of ra into implicit equation of sphere & solve for t P(t) = o + t* d H(P) = P P - r 2 = 0 ( o + t d ) ( o + t d ) - r 2 = 0 d d t 2 + 2 d o t + o o - r 2 = 0 d o d o 3

a-sphere Intersection Quadratic: at 2 + bt + c = 0 a = 1 (remember, d = 1) b = 2 d o c = o o r 2 Questions? with discriminant and solutions What does it mean if there are no solutions, 1 solution, or 2 solutions? depth normals local shading Toda a Casting a Tracing Shadows eflection efraction ecursive a Tracing Distribution a Tracing How Can We dd Shadows? Find the point to be shaded For ever light, Construct ra from point to light For ever object find intersection of ra with object If no objects between point and light dd contribution from light Mirror eflection eflection Cast ra smmetric with respect to the normal Multipl b reflection coefficient (color) eflection angle = view angle = V 2 (V ) V θ V θ V V V 4

Transparenc Qualitative efraction Cast ra in refracted direction Multipl b transparenc coefficient (color) From Color and Light in ature b Lnch and Livingston efraction efraction & the Sidedness of Objects η i η T I = cos Ө i M sin Ө i Make sure ou know whether ou re entering or leaving M sin Ө M = ( cos Ө i I) / sin Ө i i I Ө i - cos Ө i Ө T T Snell-Descartes Law: η i sin Ө i = η T sin Ө T sin Ө T η = i = ηr sin Ө i η T M T = cos Ө T + M sin Ө T = cos Ө T + ( cos Ө i I) sin Ө T / sin Ө i = cos Ө T + ( cos Ө i I) η r = [ η r cos Ө i cos Ө T ] η r I = [ η r cos Ө i 1 sin 2 Ө T ] η r I = [ η r cos Ө i 1 η r 2 sin 2 Ө i ] η r I = [ η r cos Ө i 1 η r 2 (1 cos 2 Ө i ) ] η r I = [ η r ( I) 1 η r 2 (1 ( I) 2 ) ] η r I Total internal reflection when the square root is imaginar Don t forget to normalie! the transmissive material: I η i =1 η T = material inde T η i = material inde η T = 1 What about intersecting transparent objects? I T Total Internal eflection Questions? From Color and Light in ature b Lnch and Livingston 5

eading for Toda Toda "Distributed a Tracing", Cook, Porter, & Carpenter, SIGGPH 1984. a Casting a Tracing ecursive a Tracing Distribution a Tracing a Tracing The a Tree trace ra Intersect all objects color = ambient term For ever light cast shadow ra color += local shading term If mirror color += color refl * trace reflected ra If transparent color += color trans * trace transmitted ra Does it ever end? Stopping criteria: ecursion depth Stop after a number of bounces a contribution Stop if reflected / transmitted contribution becomes too small T 3 2 2 T 1 3 1 3 L 2 1 L 3 L 1 i surface normal i reflected ra L i shadow ra Ee T i transmitted (refracted) ra 2 Ee L 1 1 T 1 L 2 3 Compleit? T 3 L 3 a Debugging Toda Visualie the ra tree for single image piel incoming reflected ra shadow ra transmitted (refracted) ra a Casting a Tracing ecursive a Tracing Distribution a Tracing Soft shadows ntialiasing (getting rid of jaggies) Gloss reflection Motion blur Depth of field (focus) 6

Shadows Shadows & Light Sources one shadow ra per intersection per point light source no shadow ras http://www.davidfa.com/inde.php one shadow ra http://3media.initialied.org/photos/2000-10-18/inde_gall.htm clear bulb frosted bulb http://www.pa.uk.edu/~sciworks/light/preview/bulb2.htm Soft Shadows ntialiasing Supersampling multiple shadow ras to sample area light source multiple ras per piel jaggies w/ antialiasing one shadow ra point light lots of shadow ras area light eflection one reflection ra per intersection Gloss eflection multiple reflection ras Justin Legakis θ θ perfect mirror θ θ polished surface 7

Motion Blur Depth of Field Sample objects temporall multiple ras per piel ob Cook a Tracing lgorithm nalsis a casting Lots of primitives ecursive Distributed a Tracing Effects Soft shadows nti-aliasing Gloss reflection Motion blur Depth of field cost height * width * num primitives * intersection cost * sie of recursive ra tree * num shadow ras * num supersamples * num gloss ras * num temporal samples * num focal samples *... can we reduce this? these can serve double dut film focal length Justin Legakis atracing & Epsilon intersects light @ t = 25.2 intersects sphere1 @ t = -0.01 intersects sphere1 @ t = 10.6 intersects light @ t = 26.9 intersects sphere2 @ t = 0.01 intersects sphere2 @ t = 14.3 ee Image from Zachar Lnn Solution: advance the ra start position epsilon distance along the ra direction O ignore all intersections < epsilon (rather than < 0) What s a good value for epsilon? Depends on hardware precision & scene dimensions eading for Frida 3/8: Goral, Torrance, Greenberg & Battaile Modeling the Interaction of Light Between Diffuse Surfaces, SIGGPH '84 8