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

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

Ray Tracing. Last Time? Today. Ray Casting. Durer s Ray Casting Machine. Reading for 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? Ray Casting. Administrivia: Lab & Office Hours. Notes on Assignments. Ray Casting. Overview of Today

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.

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

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

Supplement to Lecture 16

Sung-Eui Yoon ( 윤성의 )

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

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

Photorealism: Ray Tracing

Implementation Issues

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

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

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

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

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

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

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

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

Lecture 11: Ray tracing (cont.)

CS-184: Computer Graphics. Administrative

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

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

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

Ray-Tracing. Misha Kazhdan

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

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

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

Ray Tracing. Local Illumination. Object Space: Global Illumination. Image Space: Backward Ray Tracing. First idea: Forward 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

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

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

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

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

CS 431/636 Advanced Rendering Techniques

CS5620 Intro to Computer Graphics

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

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

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

Shading, Advanced Rendering. Week 7, Wed Feb 28

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

Distributed Ray Tracing

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

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

Ray tracing Tutorial. Lukas Herzberger

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

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

3D Rendering and Ray Casting

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

Distribution Ray Tracing

COMP371 COMPUTER GRAPHICS

MIT Ray Tracing Ray Tracing

Ray Tracing. Outline. Ray Tracing: History

Intro to Ray-Tracing & Ray-Surface Acceleration

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

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

3D Rendering and Ray Casting

Anti-aliasing and Monte Carlo Path Tracing

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

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

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

Lighting and Reflectance COS 426

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

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

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

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

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

Computer Graphics. Shi-Min Hu. Tsinghua University

Lighting and Shading

Today. The Graphics Pipeline: Projective Transformations. Last Week: Schedule. XForms Forms Library. Questions?

Ray casting. Ray casting/ray tracing

Ray tracing. EECS 487 March 19,

CPSC GLOBAL ILLUMINATION

Lecture 18: Primer on Ray Tracing Techniques

Homework 3: Shading, Raytracing, and Image Processing

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

CSCI-4530/6530 Advanced Computer Graphics

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

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

EECS 487: Interactive Computer Graphics

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

CS5620 Intro to Computer Graphics

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

CS384G Midterm Examination Spring 2008

Indirect Illumination

Lecture 19: All Together with Refraction

Homework #2. Shading, Ray Tracing, and Texture Mapping

Questions??? Announcements Assignment 3 due today

COMPUTER GRAPHICS AND INTERACTION

CS770/870 Spring 2017 Color and Shading

Modeling Transformations

Transcription:

Qui Discussion a Tracing Announcements: Final Projects Last Time? Everone should post one or more ideas for a final project on the discussion forum (it was our assignment over Spring Break) Connect with potential teammates (teams of 2 strongl recommended) Start reading background papers Proposal & summar of background research will be due in a couple weeks igid Bod Finite Element Method Toda Durer s a Casting Machine a Casting Albrecht Durer, 16th centur Stress/Strain Fracture Deformation Level of Detail Haptics a-plane Intersection a-sphere Intersection Point in Polgon a Tracing ecursive a Tracing Distribution a Tracing 1

a Casting A ote on Local Shading For ever piel Construct a ra from the ee For ever object in the scene Find intersection with the ra Keep if closest Finding the intersection and normal is the central part of ra casting Shade depending on light and normal vector Surface/Scene Characteristics: surface normal direction to light viewpoint Material Properties Diffuse (matte) Specular (shin) More later! L V Diffuse sphere Specular spheres a epresentation? Two vectors: Origin Direction (normalied is better) Parametric line (eplicit representation) P(t) = origin + t * direction P(t) direction origin 3D Plane epresentation? Plane defined b P o = (,,) n = (A,B,C) Implicit plane equation H(P) = A+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-plane Intersection 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 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 2

Additional Housekeeping 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 ormal For shading diffuse: dot product between light and normal ormal is constant normal P(t) 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 How Do We Compute α, β, γ? atio of opposite sub-triangle area to total area α = A a /A β = A b /A γ = A c /A Use signed areas for points outside the triangle c P A P A a d o a b a b Using Cramer s ule Used to solve for one variable at a time in sstem of equations β = o o o A d d d γ = A o o o d d d Sphere epresentation? Implicit sphere equation Assume centered at origin (eas to translate) H(P) = P P - r 2 = 0 t = A o o o denotes the determinant Can be copied mechanicall into code d o 3

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 a-sphere Intersection Quadratic: at 2 + bt + c = 0 a = 1 (remember, d = 1) b = 2 d o c = o o r 2 with discriminant and solutions d o What does it mean if there are no solutions, 1 solution, or 2 solutions? Questions? Toda a Casting a Tracing Shadows eflection efraction ecursive a Tracing Distribution a Tracing depth normals local shading How Can We Add 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 Add contribution from light Mirror eflection Cast ra smmetric with respect to the normal Multipl b reflection coefficient (color) 4

eflection eflection angle = view angle = V 2 (V ) Transparenc Cast ra in refracted direction Multipl b transparenc coefficient (color) V θ V θ V V V Qualitative efraction efraction M sin Ө i I = cos Ө i M sin Ө i M = ( cos Ө i I) / sin Ө i From Color and Light in ature b Lnch and Livingston η i η T 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! efraction & the Sidedness of Objects Make sure ou know whether ou re entering or leaving the transmissive material: Total Internal eflection I η i =1 η T = material inde T η T = 1 I η i = material inde T What about intersecting transparent objects? From Color and Light in ature b Lnch and Livingston 5

Questions? eadings for Toda: (read both) "An improved illumination model for shaded displa" Turner Whitted, 1980. "Distributed a Tracing", Cook, Porter, & Carpenter, SIGGAPH 1984. Toda a Casting a Tracing ecursive a Tracing Distribution a Tracing a Tracing 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 The a Tree a Debugging Ee Visualie the ra tree for single image piel T 3 2 2 T 1 1 3 3 L 1 L 2 1 T 1 1 L 3 L 1 L 2 L 3 i surface normal Ee 2 3 T 3 i reflected ra L i shadow ra T i transmitted (refracted) ra Compleit? incoming reflected ra shadow ra transmitted (refracted) ra 6

Toda a Casting a Tracing ecursive a Tracing Distribution a Tracing Soft shadows Antialiasing (getting rid of jaggies) Gloss reflection Motion blur Depth of field (focus) Shadows one shadow ra per intersection per point light source no shadow ras one shadow ra Shadows & Light Sources Soft Shadows multiple shadow ras to sample area light source one shadow ra http://www.davidfa.com/inde.php 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 lots of shadow ras Antialiasing Supersampling eflection multiple ras per piel jaggies w/ antialiasing one reflection ra per intersection point light area light θ θ perfect mirror 7

Gloss eflection multiple reflection ras Motion Blur Sample objects temporall Justin Legakis θ θ polished surface ob Cook Depth of Field a Tracing Algorithm Analsis film multiple ras per piel focal length Justin Legakis a casting Lots of primitives ecursive Distributed a Tracing Effects Soft shadows Anti-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 eading for Frida 3/19: Goral, Torrance, Greenberg & Battaile Modeling the Interaction of Light Between Diffuse Surfaces, SIGGAPH '84 Post a comment or question on the LMS discussion b 10am on Frida 2/29 8