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

Similar documents
Photorealism: Ray Tracing

Lecture 10: Ray tracing

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

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

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

CPSC GLOBAL ILLUMINATION

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

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

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

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

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

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

Ray Tracing. Kjetil Babington

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

Lighting and Shading

Supplement to Lecture 16

CS 325 Computer Graphics

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

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

Rendering Part I (Basics & Ray tracing) Lecture 25 December 1, 2015

CS-184: Computer Graphics. Administrative

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

CS559 Computer Graphics Fall 2015

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

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

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

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

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

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

Shadows. COMP 575/770 Spring 2013

Lecture 18: Primer on Ray Tracing Techniques

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

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

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

Ray-Tracing. Misha Kazhdan

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

COMP371 COMPUTER GRAPHICS

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

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

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

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

Illumination Algorithms

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Lecture 19: All Together with Refraction

03 RENDERING PART TWO

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

CS5620 Intro to Computer Graphics

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

Reflection and Shading

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

Raytracing CS148 AS3. Due :59pm PDT

Sung-Eui Yoon ( 윤성의 )

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

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

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

Shading, Advanced Rendering. Week 7, Wed Feb 28

Raytracing. COSC 4328/5327 Scott A. King

Assignment 6: Ray Tracing

Introduction to Ray-tracing Objectives

Ray Tracing. Brian Curless CSEP 557 Fall 2016

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

Recall: Basic Ray Tracer

CS 130 Exam I. Fall 2015

The Rendering Equation & Monte Carlo Ray Tracing

Images in Plane Mirrors. Monday, May 23, 16

Global Illumination. COMP 575/770 Spring 2013

Ray Tracing COMP575/COMP770

Introduction to Computer Graphics 7. Shading

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Assignment 3: Path tracing

Local vs. Global Illumination & Radiosity

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

Intro to Ray-Tracing & Ray-Surface Acceleration

A Little Background. Motivation. Motivation

CS230 : Computer Graphics Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

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

Lecture 11: Ray tracing (cont.)

CSE 681 Illumination and Phong Shading

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

CPSC / Illumination and Shading

Implementation Issues

Shading, lighting, & BRDF Theory. Cliff Lindsay, PHD

Global Illumination. Why Global Illumination. Pros/Cons and Applications. What s Global Illumination

Shading I Computer Graphics I, Fall 2008

Light: Geometric Optics

Assignment 2 Ray Tracing

Reflection and Refraction

The Ray model of Light. Reflection. Class 18

Introduction to Visualization and Computer Graphics

Interactive Real-Time Raycasting

Reflection and Refraction

Programming projects. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing

Algebra Based Physics

Simple Lighting/Illumination Models

Computer Graphics. Illumination and Shading

Transcription:

CS 428: Fall 2009 Introduction to Computer Graphics Raytracing 11/18/2009 1

Forward ray tracing From the light sources Simulate light transport one ray at a time Rays start from lights + bounce around the scene Some hit the camera (extremely few!) Very expensive to compute Under-sampling! So: nobody does this 11/18/2009 2

Backward ray tracing From the eye Use ray casting from camera to scene Much faster (all rays say something about image) An approximation Use known lighting models (diffuse, specular, etc) No caustics, inter-object reflection (Can be fixed/combined with other techniques ) 11/18/2009 3

Raytracing Albrecht Dürer Der zeichner des liegenden weibes, 1538 Impression of Velo von Alberti (1404 1472) Sorry, but thanks to an extremely antiquated and lame attitude w.r.t. male/female nudity, this part of the image is not shown. 11/18/2009 4

Recursive raytracing Turner Whitted 1979: Model for Integrating Reflection Refraction Visibility Shadows (Basic) raytracing simulates the light transport and adheres to the rules of ideal reflection and refraction 11/18/2009 5

Point light sources Materials Recursive raytracing Assumptions Diffuse mit specular component (Phong model) Light transport Occluding objects (Umbras, but no penumbras) No light attenuation Only specular light transport between surfaces (Rays are only followed along directions of ideal reflection) 11/18/2009 6

Recursive raytracing Turner Whitted [1979] 11/18/2009 7

Recursive raytracing Examples Raytracing ist extremely suitable for scenes with many mirroring and transparent (refracting) surfaces 11/18/2009 8

Recursive raytracing Synthetic camera Defined by an eye point and image (view) plane in world coordinates The image plane is an array of pixels, with the same resolution as the resulting image 11/18/2009 9

Recursive raytracing Rays are cast into the scene from the eye point through the pixels 11/18/2009 10

Recursive raytracing If the ray intersects with more than one object, then the nearest intersection is drawn Otherwise, draw the background color 11/18/2009 11

Recursive raytracing If a ray intersects with an object, then additional rays are cast from the point of intersection to all light sources 11/18/2009 12

Recursive raytracing If these shadow feelers intersect with an object, then the first intersection point is in shadow 11/18/2009 13

Recursive raytracing If the object is reflective, a reflected ray (about the surface normal) is cast into the scene 11/18/2009 14

Recursive raytracing If the object is transparent, a refracted ray (about the surface normal) is cast into the scene 11/18/2009 15

Recursive raytracing New rays are generated for reflection, transmission (refraction) and shadow feelers Rays are parameters of a recursive function Detects all visible surfaces intersected by rays, shades them, and returns the result (= color) eye S pixel S S S 11/18/2009 16

Lighting model Lighting on a surface is combined of Ambient + Diffuse + Specular (highlights and reflection) + Transmitted (refracted) Equivalent to the Phong-model plus contributions from reflected and refracted rays 11/18/2009 17

Lighting model L sum = L Phong + r r L r + r t L t L r is the luminance of the reflected ray L t is the luminance of the transmitted ray r r is the reflectance (in [0,1]) for ideal reflection r t is the reflectance (in [0,1]) for ideal transmission R = -E+2(N E)N 11/18/2009 18

Rays Data structure Point of origin p+ direction d Parametric equation If dis normalized, t is distance from pto p+td 11/18/2009 19

Camera setup 11/18/2009 20

Camera setup Aspect ratio r = W/H Determine W and H from θand r N n 11/18/2009 21

Intersecting rays with objects Object representation? Implicit equations make intersections easier Surface is a set of points that satisfy F(x,y,z) = 0 Example: sphere at the origin with radius 1 F(x,y,z) = x 2 + y 2 + z 2-1 As opposed to its explicit representation 11/18/2009 22

Intersecting rays with objects Normal vector to an implicit surface For the previous example of a sphere F(x,y,z) = x 2 + y 2 + z 2-1 n(x,y,z) = [2x, 2y, 2z] T 11/18/2009 23

Intersecting rays with objects Given a ray (p,d) Intersection points found by solving F(p+td) = 0 for t Quadratic in t for F(x,y,z) = x 2 + y 2 + z 2-1 http://en.wikipedia.org/wiki/quadratic_equation 11/18/2009 24

What if object is not at origin? Implicit equation becomes more complex although sphere is still fairly easy Transform the ray with M -1 11/18/2009 25

What if object is not at origin? Implicit equation becomes more complex although sphere is still fairly easy Transform the ray with M -1 Transform back the intersection point(s) t is the same in both (don t normalize M -1 d) In other words, solve F(M -1 p + t(m -1 d)) = 0 11/18/2009 26

Transforming intersection Point Normal 11/18/2009 27

Transforming intersection Why (M -1 ) T for normals? Given a vector v o in the tangent plane then n o v o = 0 (orthogonal) n ot v o = 0 n ot (M -1 M)v o = 0 ((M -1 ) T n o ) T M v o = 0 n T w v w = 0 11/18/2009 28

Lighting recap 11/18/2009 29

Shadows Check if anything is between light and intersection point (ip) that would block light Send a ray from ipto each light to check if light illuminates ip Light blocked, tint = 0, otherwise tint = 1 Will modify later for transparency 11/18/2009 30

Shadows Ray cannot start at ipdue to rounding errors When finding intersections, use a minimum acceptable value of t to be some eps> 0 11/18/2009 31

Ideal reflection Mirror reflection by law of reflection The incident and reflected ray form the same angle with the surface normal The incident and reflected ray and surface normal all lie in the same plane In polar coordinates: θ = θ and φ = φ + π Forview ray land (normalized) normal n r r = -l + 2 (l n) n i r i 11/18/2009 32

Ideal reflection Geometry of Reflection law Geometry of refraction law l n r θ 1 Medium 1 θ i θ r Medium 2 θ 2 11/18/2009 33

Ideal reflection Total reflection Transition from optically dense to less dense material n 2 < n 1 Rays refracted away from the surface normal There exists an incident angle θ T with refraction angle of 90º Once θ T is exceeded All light reflected on the boundary between media Total reflection = 2 1 n sin θ T. n Medium 1 Medium 2 θ T 11/18/2009 34