Ray-Tracing. Misha Kazhdan

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

Indirect Illumination

Illumination. Courtesy of Adam Finkelstein, Princeton University

Indirect Illumination

Lighting and Reflectance COS 426

3D Rendering and Ray Casting

Global Illumination. Connelly Barnes CS 4810: Graphics

3D Rendering and Ray Casting

Illumination. Thomas Funkhouser Princeton University C0S 426, Fall 2000

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

Raytracing. COSC 4328/5327 Scott A. King

CS5620 Intro to Computer Graphics

Ray Tracing. Kjetil Babington

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

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

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

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

Photorealism: Ray Tracing

Lighting and Shading

Illumination Models & Shading

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

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

Shading I Computer Graphics I, Fall 2008

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

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

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

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

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

COMP30019 Graphics and Interaction Ray Tracing

Ray Casting. Connelly Barnes CS 4810: Graphics

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

Reflection and Shading

Today. Part 1: Ray casting Part 2: Lighting Part 3: Recursive Ray tracing Part 4: Acceleration Techniques

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Simple Lighting/Illumination Models

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

Modeling Transformations

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

Illumination & Shading

Visualisatie BMT. Rendering. Arjan Kok

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

Comp 410/510 Computer Graphics. Spring Shading

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

LIGHT. Speed of light Law of Reflection Refraction Snell s Law Mirrors Lenses

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

Assignment 2 Ray Tracing

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

COMP371 COMPUTER GRAPHICS

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

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

Illumination & Shading: Part 1

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

SAMPLING AND NOISE. Increasing the number of samples per pixel gives an anti-aliased image which better represents the actual scene.

Raycast Rendering Maya 2013

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

Virtual Reality for Human Computer Interaction

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

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

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

COMP environment mapping Mar. 12, r = 2n(n v) v

Lecture 19: All Together with Refraction

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

Lighting. Figure 10.1

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Lecture 10: Ray tracing

w Foley, Section16.1 Reading

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

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

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

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

Chapter 32 Light: Reflection and Refraction. Copyright 2009 Pearson Education, Inc.

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

Global Illumination. COMP 575/770 Spring 2013

Shading, Advanced Rendering. Week 7, Wed Feb 28

Modeling Transformations

Shading. Brian Curless CSE 557 Autumn 2017

Recursion and Data Structures in Computer Graphics. Ray Tracing

CS770/870 Spring 2017 Color and Shading

Supplement to Lecture 16

Turn on the Lights: Reflectance

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

Implementation Issues

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

CS 5625 Lec 2: Shading Models

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

Intro to Ray-Tracing & Ray-Surface Acceleration

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

03 RENDERING PART TWO

Lecture 18: Primer on Ray Tracing Techniques

Reflection and Refraction

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

Ray Optics. Lecture 23. Chapter 34. Physics II. Course website:

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information

Algebra Based Physics

Reflection and Refraction

EECS 487: Interactive Computer Graphics

Illumination and Shading

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

Transcription:

Ray-Tracing Misha Kazhdan

Ray-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles.

Goal: Ray-Tracing Take a collection of triangles representing a 3D scene and render a detailed image.

Physical Pinhole Camera The film sits behind the pinhole of the camera. Rays come in from the outside, pass through the pinhole, and hit the film plane. Photograph is upside down Film Plane Pinhole

Virtual Camera The film sits in front of the pinhole of the camera. Rays come in from the outside, pass through the film plane, and hit the pinhole. Photograph is right side up Film Plane Pinhole Virtual Film Plane

Ray-Casting We invert the process of image generation by sending rays out from the pinhole. Pinhole Virtual Film Plane

Ray-Casting We invert the process of image generation by sending rays out from the pinhole. For each pixel in the virtual file plane, we: Compute the ray: pinhole pixel Figure out what object in the scene is hit first Set the pixel to the color of the object Pinhole Film Plane

Ray-Casting Image RayCast( Camera camera, Scene scene, int width, int height ) { Image image = new Image( width, height ); for( int i=0 ; i<width ; i++ ) for ( int j=0 ; j<height ; j++ ) { Ray ray = ConstructRayThroughPixel( camera, i, j ); Intersection hit = FindIntersection( ray, scene ); image[i][j] = GetColor( hit ); } return image; }

Ray-Casting If we ignore the color computation, we get the silhouettes of the scene:

Ray-Tracing Overview Direct Illumination Global Illumination Outline

Modeling Surface Reflectance Surface color is determined by the lights and the way different surfaces reflect the light. Ideally, we would model the surface reflectance properties at p: R p (θ, φ, λ, γ, ψ) R p is the fraction of incident light: arriving from direction (γ, ψ) with wavelength λ leaving in direction (θ, φ) Too much storage Difficult in practice λ (γ, ψ) Surface (θ, φ)

Simple Reflectance Model Simple model: diffuse reflection + specular reflection + emission + ambient Based on model proposed by Phong Surface

Simple Reflectance Model Simple model: diffuse reflection + specular reflection + emission + ambient Based on Phong model proposed illumination by model Phong Surface

Diffuse Reflection Assume surface reflects equally in all directions Examples: chalk, clay Surface

Diffuse Reflection How much light is reflected? Depends on angle of incident light q Surface

Diffuse Reflection How much light is reflected? Depends on angle of incident light q 1 Think of a flashlight! Τ 1 cos θ Surface Physically motivated: (Surface color) = (Light color) * cos θ * (Diffuse)

Diffuse Reflection Assume surface reflects equally in all directions Examples: chalk, clay

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Surface

Specular Reflection Reflection is strongest near mirror angle Examples: metals, shiny apples Specular

Specular Reflection How much light is seen? Depends on: angle of incident light angle to viewer Viewer a q q Works well in practice: (Surface color) = (Light color) * cos k α * (Specular)

Specular Reflection Reflection is strongest near mirror angle Examples: metals, shiny apples

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Surface

Emission Represents light emanating directly from polygon Emission 0

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Surface

Ambient Term Represents accumulation of indirect illumination Locations that are not directly illuminated are still not black because of indirect illumination.

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Surface

Simple Reflectance Model Simple analytic model: diffuse reflection + specular reflection + emission + ambient Surface

Surface Illumination Calculation Single light source: Viewer a q q I = K E + K A + cos θ K D + cos k α K S I L

Surface Illumination Calculation Multiple light sources: Viewer I = K E + K A + cos θ L K D + cos k α L K S I L L Lights

Ray-Tracing Overview Direct Illumination Global Illumination Outline

Shadows Shadow term tells if light sources are blocked Cast ray towards each light. If the ray is blocked, ignore the light s contribution.

Shadows Shadow term tells if light sources are blocked Cast ray towards each light. S i = 0 if ray is blocked, S i = 1 otherwise L 1 Shadow Term L 0 I = K E + K A + cos θ L K D + cos k α L K S I L S L L Lights

Shadows Shadow term tells if light sources are blocked Cast ray towards each light. S i = 0 if ray is blocked, S i = 1 otherwise L 1 S 0 = 1: L 0 contributes Shadow Term L 0 I = K E + K A + cos θ L K D + cos k α L K S I L S L L Lights

Shadows Shadow term tells if light sources are blocked Cast ray towards each light. S i = 0 if ray is blocked, S i = 1 otherwise L 1 S 0 = 1: L 0 contributes S 1 = 0: L 1 does not contribute Shadow Term L 0 I = K E + K A + cos θ L K D + cos k α L K S I L S L L Lights

Ray Casting Trace primary rays from camera Direct illumination from unblocked lights only

Recursive Ray Tracing Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays L 1 L 0 Contribution from mirror reflection ray I = K E + K A + cos θ L K D + cos k α L K S I L S L + K S R L Lights

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays L 1 L 0 Contribution from mirror reflection ray I = K E + K A + cos θ L K D + cos k α L K S I L S L + K S R L Lights

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays L 1 L 0 Contribution from mirror reflection ray I = K E + K A + cos θ L K D + cos k α L K S I L S L + K S R L Lights

Mirror Reflections Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays

Transparency Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays L 1 Contribution from refraction ray L 0 I = K E + K A + cos θ L K D + cos k α L K S I L S L + K S R + K T T L Lights

Transparency Also trace secondary rays from hit surfaces Consider contributions from: 1. Reflected Rays 2. Refracted Rays

Refraction (Snell s Law) Light bends as it passes through a transparent object (q i q r ). q i T q r

Refraction (Snell s Law) Light bends as it passes through a transparent object (q i q r ). L 1 L 0 Contribution from refraction ray I = K E + K A + cos θ L K D + cos k α L K S I L S L + K S R + K T T L Lights

Refraction (Snell s Law) Light bends as it passes through a transparent object (q i q r ).

Summary Pixar

Discussion How do we make ray-tracing fast? What does this model fail to capture?