Recall: Basic Ray Tracer

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

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

Photorealism: Ray Tracing

Lighting and Shading

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

specular diffuse reflection.

Lecture 10: Ray tracing

Lecture 7 Notes: 07 / 11. Reflection and refraction

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

CS5620 Intro to Computer Graphics

All forms of EM waves travel at the speed of light in a vacuum = 3.00 x 10 8 m/s This speed is constant in air as well

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

Reflection and Shading

The Rendering Equation. Computer Graphics CMU /15-662

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

COMP371 COMPUTER GRAPHICS

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

Phys 102 Lecture 17 Introduction to ray optics

Raytracing. COSC 4328/5327 Scott A. King

CS 5625 Lec 2: Shading Models

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

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

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

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

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

Ray-Tracing. Misha Kazhdan

3 Interactions of Light Waves

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Ray Tracing. Kjetil Babington

Ch. 22 Properties of Light HW# 1, 5, 7, 9, 11, 15, 19, 22, 29, 37, 38

At the interface between two materials, where light can be reflected or refracted. Within a material, where the light can be scattered or absorbed.

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

Fresnel Reflection. angle of transmission. Snell s law relates these according to the

GG450 4/5/2010. Today s material comes from p and in the text book. Please read and understand all of this material!

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

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

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

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

dq dt I = Irradiance or Light Intensity is Flux Φ per area A (W/m 2 ) Φ =

Light and Electromagnetic Waves. Honors Physics

Reflection & refraction

Ray Tracing. Brian Curless CSEP 557 Fall 2016

What is it? How does it work? How do we use it?

Physics 202, Lecture 23

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

CS 325 Computer Graphics

Radiometry (From Intro to Optics, Pedrotti 1-4) Radiometry is measurement of Emag radiation (light) Consider a small spherical source Assume a black

Exp No.(9) Polarization by reflection

Assignment 6: Ray Tracing

Lecture Ray Model of Light. Physics Help Q&A: tutor.leiacademy.org

SNC2D PHYSICS 5/20/2013. LIGHT & GEOMETRIC OPTICS L Total Internal Reflection (TIR) (P ) Total Internal Reflection (TIR)

Chapter 26 Geometrical Optics

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

1. Particle Scattering. Cogito ergo sum, i.e. Je pense, donc je suis. - René Descartes

Raytracing CS148 AS3. Due :59pm PDT

Chapter 35. The Nature of Light and the Laws of Geometric Optics

dq dt I = Irradiance or Light Intensity is Flux Φ per area A (W/m 2 ) Φ =

Lecture 19: All Together with Refraction

Representing and Computing Polarized Light in a Ray Tracer

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

The Rendering Equation. Computer Graphics CMU /15-662, Fall 2016

INTRODUCTION REFLECTION AND REFRACTION AT BOUNDARIES. Introduction. Reflection and refraction at boundaries. Reflection at a single surface

HW Chapter 20 Q 2,3,4,5,6,10,13 P 1,2,3. Chapter 20. Classic and Modern Optics. Dr. Armen Kocharian

Ray Tracing: shading

PHY 112: Light, Color and Vision. Lecture 11. Prof. Clark McGrew Physics D 134. Review for Exam. Lecture 11 PHY 112 Lecture 1

Ray Tracer Due date: April 27, 2011

Intro to Ray-Tracing & Ray-Surface Acceleration

REFLECTION & REFRACTION

Ray Optics. Ray model Reflection Refraction, total internal reflection Color dispersion Lenses Image formation Magnification Spherical mirrors

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

SESSION 5: INVESTIGATING LIGHT. Key Concepts. X-planation. Physical Sciences Grade In this session we:

Rules for Deviation of Light Rays During Refraction

Physics 10. Lecture 28A. "If Dracula can t see his reflection in the mirror, how come his hair is always so neatly combed?

Reflection, Refraction and Polarization of Light Physics 246

Chapter 22. Reflection and Refraction of Light

MITOCW MIT6_172_F10_lec18_300k-mp4

SCIENCE 8 WORKBOOK. Chapter 5 Light Optics (Section 1) Ms. Jamieson This workbook belongs to:

L 32 Light and Optics [3]

CS 6620 Shading. Steve Parker Peter Shirley

Conceptual Physics Fundamentals

Reflection and Refraction of Light

Light: Geometric Optics

Reflection, Refraction and Polarization of Light

Wavefronts and Rays. When light or other electromagnetic waves interact with systems much larger than the wavelength, it s a good approximation to

Global Illumination. COMP 575/770 Spring 2013

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

Office Hours. Scattering and Polarization

Ray Tracing: Special Topics CSCI 4239/5239 Advanced Computer Graphics Spring 2018

1.! Questions about reflected intensity. [Use the formulas on p. 8 of Light.] , no matter

Lecture 18: Primer on Ray Tracing Techniques

Purpose: To determine the index of refraction of glass, plastic and water.

Philpot & Philipson: Remote Sensing Fundamentals Interactions 3.1 W.D. Philpot, Cornell University, Fall 12

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

Simple Lighting/Illumination Models

LECTURE 37: Ray model of light and Snell's law

Complex Shading Algorithms

Chapter 24. Wave Optics. Wave Optics. The wave nature of light is needed to explain various phenomena

GEOMETRIC OPTICS. LENSES refract light, so we need to know how light bends when entering and exiting a lens and how that interaction forms an image.

Transcription:

1

Recall: Ray Tracing Generate an image by backwards tracing the path of light through pixels on an image plane Simulate the interaction of light with objects

Recall: Basic Ray Tracer Trace a primary ray from the eye through each pixel and detect the first intersection point with the objects in the scene Trace secondary shadow rays from the intersection point towards light sources and sum the contributions from each (visible) light The lighting equation: sum all lights ambient diffuse specular 3

Embarrassingly Parallel Can easily implement on a GPU Can easily use all the cores on a CPU Can easily use many machines across a network, or on the cloud http://www.youtube.com/watch?v=-p28lkwtzri 4

5

Recursive Ray Tracing Light at a point may not just come directly from light sources: Light can bounce off other objects (reflection) Light can pass through objects (transparency/refraction) Trace more rays to look for more lighting information Send secondary rays from the intersection point Recursively compute the color for these secondary rays and sum them onto the primary ray Lighting equation becomes: standard direct illumination recursively computed reflection recursively computed refraction 6

Reflection/Transmission Adds Light Adding additional reflection/transmission terms adds more light to the object making it brighter Can offset this by dialing down the object color Can offset this by dialing down the reflection/transmission coefficients, k r /k t, but this can overly dim the reflections/transmissions Recommended approach: adjust the ratio between the object color and the reflected/transmitted light first to get the desired look, and then tune everything up and down to adjust brightness while maintaining this ratio 7

Ray Tree Each reflected or transmitted ray may spawn its own shadow, reflection, and refraction/transmission rays, which is a recursive process 8

Maximum Depth If a ray tree is too deep (too many rays), it gets too costly/slow N.B. be aware of the size of the recursion stack (which depends on the hardware) to avoid recursive stack overflow If each splitting in the tree has a direct lighting component, then rays deeper in the tree make a smaller and smaller contribution to the total light for a pixel So one can truncate when the contribution is below a threshold In some cases (mirrors, etc.), there may not be a direct lighting component and 100% of the light at a split comes from reflected/transmitted rays In this case premature pruning will adversely affect the image One typically carefully chooses a default color for the early termination point Often this default color is the background color of the scene (used when a ray does not hit anything in the scene) E.g., the background color could be blue if your scene is under the sky If a default color is not set, simply truncating the rays behaves as if a black color was set, i.e. multiplying the discarded rays by 0 9

Requires Minimal Implementation http://fabiensanglard.net/raytracing_back_of_business_card/ 10

11

Reflective Ray Given an incident ray R(t) = A+tD, the reflective ray Rref(t) = P + tf is computed as follows: P is the point where R(t) intersects the surface F is the reflected vector of D with respect to the surface normal N The incident angle θ i equals the reflection angle θ o 12

Spurious Self-Occlusion Add ε to the starting point of a reflected ray to avoid re-intersection with the original surface This often fails for grazing rays near the objects silhouette Or offset in the normal direction from the surface Just like shadow rays, except here we preserve the direction of the reflected ray Avoid placing the new starting point too close to or inside other nearby objects The perturbed point may still Be inside the object offset in the ray direction offset in the normal direction 13

Shade recursively Shading Reflections Treat reflected rays like primary rays from the camera Shade the reflected ray and return its color Multiply by the reflection coefficient k r Add the resulting color to the shading at the original point 14

Question 1 List 10 objects that can make use of reflected rays

16

Shading Transmission If the object is transparent, trace a transmitted ray Treat transmitted rays like primary rays Add ε to avoid self intersection, or offset in the negative normal direction (respecting collisions, other geometry, etc.) Shade the transmitted ray and return its color Multiply by the refraction coefficient k t Add the resulting color to the shading at the original point 17

Snell s Law The relationship between the angle of incidence and angle of refraction/transmission for light passing through a boundary between two different isotropic media is: θ 1 and θ 2 are incoming/outgoing angles v 1 and v 2 are the phase velocities in the two materials n 1 and n 2 are the indices of refraction in the two materials 18

Transmitted Ray D - incident ray direction N - unit surface normal T - unit surface tangent (in the plane of N and D) R - refracted ray direction (N, T, D, and R are all normalized) (Snell) 19

Transmitted Ray If the number under the square root is negative, there is no refracted/transmitted ray and all of the light is reflected (total internal reflection) This equation works regardless of which of n 1 or n 2 is larger 20

Question 2 List 10 objects that can make use of transmitted rays

22

Total Internal Reflection When light goes from a material with a higher refraction index (n 2 ) to a material with a lower refraction index (n 1 ), there is no refraction/transmission when the incident angle exceeds a critical angle (in this case, all the light reflects) when θ 2 < θ 2,max, both refraction/transmission and reflection when θ 2 > θ 2,max, only reflection 23

Critical Angle Compute the critical angle using Snell s Law: Assume, then 24

Total Internal Reflection Responsible for much of the rich appearance of glass and water 25

Snell s Window 26

Snell s Window 27 http://en.wikipedia.org/wiki/snell s_window

28

Reflection vs. Transmission The proportion of reflection versus transmission gradually increases as the viewing angle goes from perpendicular to a parallel (grazing) Perpendicular view: high transmission, low reflection Parallel (grazing) view: high reflection, low transmission 29

Reflection vs. Transmission Reflection similarly increases for non-transparent (opaque) objects as the viewing direction becomes more parallel/grazing Notice the increase in reflectivity of the table from left to right [Lafortune et al. 1997] 30

Fresnel Equations Light can be polarized into 2 parts based on whether the plane containing the incident, reflected, and refracted rays is parallel or perpendicular to the electric field of the light We denote the light as p-polarized if it is parallel and by s-polarized if it is perpendicular (to the electric field) The Fresnel equations give the fraction of light reflected off the interface between two materials as: It is assumed that any light which is not reflected is instead transmitted through the interface from one material to the other, so: For unpolarized light (a typical assumption in ray tracing), the overall reflection and transmission coefficients are assumed to be: 31

Fresnel Equations Light entering a denser material, e.g. from air into water Light leaving a denser material, e.g. from water into air 32

33

Conductors vs. Dielectrics Conductors Objects that conduct electricity (e.g. metal) Have reflection and absorption, but no transmission Dielectrics Objects that don t conduct electricity (e.g. glass) Have both reflection and transmission Conductor Dielectric http://renderman.pixar.com/resources/current/rms/tutorialraytracing.html 34

Conductors Conductors don t transmit light Most of the incident light is reflected, and some of it is absorbed The reflection term changes relatively slowly with the incident angle (as compared to dielectric materials) E.g., for aluminum, the reflection changes from about 90% to 100% as the incident angle changes from 0 o to 90 o Can typically treat k r as a constant independent of viewing direction (and k t = 0) Ray traced conductors http://download.autodesk.com http://www.raytracing.co.uk/ 35

List 5 conductors Question 3

Dielectrics Strongly depend on the Fresnel equations to get the proper reflection vs. transmission of light based on viewing angle 37

Schlick s Approximation Approximates the reflection term in the Fresnel Equation as: where R 0 controls the Fresnel reflections of different materials R 0 ranges from 0 to 1 Reference values are available for many real-world materials Same equation can be used for both dielectrics and conductors R(θi) part of light is reflected 1-R(θi) part of light is refracted or absorbed 38

Schlick s Approximation Schlick s approximation (dotted lines) compared to the Fresnel equations (solid lines) 39

List 5 dielectrics Question 4

41

Attenuation Light is attenuated as it travels through media The attenuation effect from the media is stronger over longer distances Different colors attenuate with different rates Shallow water is clear (almost no attenuation) Deeper water attenuates all the red light and looks blue-green Even deeper water also attenuates all the green light and looks blue Eventually all the light attenuates, and the color ranges from blackish-blue to black 42

Beer s Law If the media is homogeneous, the attenuation along the ray can be described using Beer s Law: where I is the light intensity, x is the distance along the ray, and c is the attenuation constant (which varies based on color/wavelength) Solving this Ordinary Differential Equation (ODE) with the initial value results in: 43

Beer s Law The color of a transparent object can be described by three independent attenuation components for the three color channels (R, G, B) 44

Question 5 List 5 objects that attenuate light

46

Atmospheric Refraction Light is bent into a curved path when it passes through the atmosphere Happens continuously, not just at an interface This is due to the continuous variations in air density, and thus continuous variations in the refractive index Inferior mirage - the mirage is located under the real object Superior mirage - the mirage is located above the real object 47 http://science-at-home.org/mirages/

Inferior Mirage 48 Credit: Brocken Inaglory

Superior Mirage 49 Credit: Timpaananen

Ray Tracing Mirages Bend the rays as they go through varying air densities Change the light direction between every interval in the vertical direction or along the ray direction 50

Ray Tracing Mirages 51 by Itai Katz and Pankhudi

Ray Tracing Curved Paths http://www.wired.com/2014/10/astrophysics-interstellar-black-hole/ http://news.discovery.com/space/interstellar-black-hole-is-best-black-hole-in-sci-fi-141029.htm 52

Extra Credit List two distinct causes for the bending of light

54

Iridescence Color of light changes with the viewing direction 55

Iridescence Various light waves are emitted in the same direction giving constructive and destructive interference http://www.glassner.com/wp-content/uploads/2014/04/cg-cga-pdf-00-11-soap-bubbles-2-nov00.pdf 56

Take Home Extra Credit List 10 iridescent objects