Lecture 19: All Together with Refraction

Similar documents
Reflection and Refraction

Reflection and Refraction

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

1. What is the law of reflection?

Turn on the Lights: Reflectance

Ray-Tracing. Misha Kazhdan

Lecture 10: Ray tracing

Outline The Refraction of Light Forming Images with a Plane Mirror 26-3 Spherical Mirror 26-4 Ray Tracing and the Mirror Equation

Algebra Based Physics

Reflection & refraction

Overview: Ray Tracing & The Perspective Projection Pipeline

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

Supplement to Lecture 16

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

Physics 1C. Lecture 25B. "There are two ways of spreading light: to be the candle or the mirror that reflects it." --Edith Wharton

Lighting and Shading

Chapter 26 Geometrical Optics

COMP371 COMPUTER GRAPHICS

Chapter 18 Ray Optics

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

Lecture 7 Notes: 07 / 11. Reflection and refraction

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

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

CS 325 Computer Graphics

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

COMP30019 Graphics and Interaction Ray Tracing

11.2 Refraction. December 10, Wednesday, 11 December, 13

Lecture 14: Refraction

Photorealism: Ray Tracing

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

Physics 1C, Summer 2011 (Session 1) Practice Midterm 2 (50+4 points) Solutions

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

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

Illumination. Courtesy of Adam Finkelstein, Princeton University

General Physics II. Mirrors & Lenses

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

PHYSICS. Chapter 34 Lecture FOR SCIENTISTS AND ENGINEERS A STRATEGIC APPROACH 4/E RANDALL D. KNIGHT

Chapter 26 Geometrical Optics

Today s Topic: Refraction / Snell s Law

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

Chapter 12 Notes: Optics

Optics: Laser Light Show Student Advanced Version

REFLECTION & REFRACTION

Experiment 7 Geometric Optics

Reflections. I feel pretty, oh so pretty

Reflection and Refraction

Recall: Basic Ray Tracer

Physics 102: Lecture 17 Reflection and Refraction of Light

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

Chapter 5 Mirrors and Lenses

Light: Geometric Optics

Home Lab 7 Refraction, Ray Tracing, and Snell s Law

Optics Course (Phys 311) Geometrical Optics Refraction through Lenses

Comp 410/510 Computer Graphics. Spring Shading

Dispersion (23.5) Neil Alberding (SFU Physics) Physics 121: Optics, Electricity & Magnetism Spring / 17

Lecture 11: Ray tracing (cont.)

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

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

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

Refraction of Light. c = m / s. n = c v. The index of refraction is never less than 1. Some common indices of refraction are listed below.

Light and the Properties of Reflection & Refraction

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

LECTURE 25 Spherical Refracting Surfaces. Geometric Optics

Chapter 3. Physical phenomena: plane parallel plate. This chapter provides an explanation about how rays of light physically behave when

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

Optics INTRODUCTION DISCUSSION OF PRINCIPLES. Reflection by a Plane Mirror

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

Ray Tracing. Kjetil Babington

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Lighting and Reflectance COS 426

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

When light strikes an object there are different ways it can be affected. Light can be

Light: Geometric Optics (Chapter 23)

CS 6620 Shading. Steve Parker Peter Shirley

P H Y L A B 1 : G E O M E T R I C O P T I C S

Lab 10 - GEOMETRICAL OPTICS

Physics 1C. Lecture 22A. "There are two ways of spreading light: to be the candle or the mirror that reflects it." --Edith Wharton

CS5620 Intro to Computer Graphics

speed of light in vacuum = speed of light in the material

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

Physics 102: Lecture 17 Reflection and Refraction of Light

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

Light and Lenses Notes

L. R. & S. M. VISSANJI ACADEMY SECONDARY SECTION PHYSICS - GRADE: VIII REFRACTION OF LIGHT

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

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

Lighting affects appearance

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

Unit 9 Light & Optics

Homework Set 3 Due Thursday, 07/14

Light: Geometric Optics

Physics Experiment 13

Chapter 5 Mirror and Lenses

Experiment 9. Law of reflection and refraction of light

FLAP P6.2 Rays and geometrical optics COPYRIGHT 1998 THE OPEN UNIVERSITY S570 V1.1

Light. Form of Electromagnetic Energy Only part of Electromagnetic Spectrum that we can really see

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.

Ray Tracing. CS116B Chris Pollett Apr 20, 2004.

Introduction to Visualization and Computer Graphics

The Question. What are the 4 types of interactions that waves can have when they encounter an object?

Transcription:

Lecture 19: All Together with Refraction December 1, 2016 12/1/16 CSU CS410 Fall 2016, Ross Beveridge & Bruce Draper 1

How about Interreflections? Note reflections Granite tabletop Visible on base Also on handle This is a featured picture on the English language Wikipedia (Featured pictures) and is considered one of the finest images. (October 2012) 12/1/16 Bruce Draper & J. Ross Beveridge 2

Rationale for Interreflections Not all the light striking a surface comes directly from a light source. Some reflects off one surface onto another. We ignore diffuse reflected light: Because its small, and we can get away with it Because it is very expensive to compute Specular reflection much more sensitive Just consider reflections in previous image. 12/1/16 Bruce Draper & J. Ross Beveridge 3

Interreflections v L In the case of mirrors or shiny objects, this can have a major impact 12/1/16 Bruce Draper & J. Ross Beveridge 4

Illustrating Recursive Ray Tracing V R L L L N L N poi V V R L R L V R R L R L poi 12/1/16 Bruce Draper & J. Ross Beveridge 5

You have a full working illustration! 12/1/16 CSU CS410 Fall 2016, Ross Beveridge & Bruce Draper 6

In 3D locate Focal Point Image Plane Objects Light 1 Light 2 3D Scene Layout 12/1/16 CSU CS410 Fall 2016, Ross Beveridge & Bruce Draper 7

Rays of Reflection To add reflections, we need the light hitting the surface from the reflected viewing ray. R V L T N T R L V C q q S Multiply reflected illumination by k r and add to total illumination. 12/1/16 Bruce Draper & J. Ross Beveridge 8

Computing V R R V = 2(V N)N-V Just like R L, but V replaces L To be more detailed N T V N V = (V N)N T V = N V V = (V N)N V R V = V + 2T V = 2(V N)N-V R V S V 12/1/16 Bruce Draper & J. Ross Beveridge 9

The Same Thing in Code From the notebook refr = make_unit((2*np.dot(n,uinv)*n)-uinv) Includes: Function to make result unit length The numpy dot product function The surface normal The ray pointing back the way the original ray came into the surface namely U inverse 12/1/16 CSU CS410 Fall 2016, Ross Beveridge & Bruce Draper 10

Example Code with Recursion There is a lot more going on in this code, study it and play with it until you understand each line; Why is it there? What does it do? 12/1/16 Bruce Draper & J. Ross Beveridge 11

Complications that Arise Is the reflection `colored by the material Notebook example uses K r Other systems may use the diffuse coeficients. Is anything lost through bounces? Does bouncing light from surface to surface take away energy? (Yes). So in code there should be an attenuation term. This is set to 0.9 in all the Notebook examples. 12/1/16 CSU CS410 Fall 2016, Ross Beveridge & Bruce Draper 12

Translucence Some light passes through the material. Typically, passed through light gets the diffuse reflection properties of the surface, unless object is 100% translucent (i.e. transparent) Speed of light is a function of the medium This causes light to bend at boundaries example: looking at the bottom of a pool 12/1/16 Bruce Draper & J. Ross Beveridge 13

Refraction - With Trigonomety Key is Snell s law sin( θ t )= η i sin θ i η t θ i angle of incidence θ r angle of refraction η i index of refraction material #1 η t index of refraction material #2 ( ) W θ i N θ i R The refraction ray is: " T = η i $ cos θ i # η t ( ) cos( θ t ) % 'N η i W & η t θ t T 12/1/16 Bruce Draper & J. Ross Beveridge 14

Practical Refraction: Solids When light enters a solid glass object? h air = 1.0 h glass = 1.5 N W Theta i Sin mu Theta r 0 0.00 0.67 0.00 10 0.17 0.67 6.67 20 0.34 0.67 13.33 30 0.50 0.67 20.00 40 0.64 0.67 26.67 50 0.77 0.67 33.33 60 0.87 0.67 40.00 70 0.94 0.67 46.67 80 0.98 0.67 53.33 90 1.00 0.67 60.00 " θ r = sin 1 η $ i sin θ i # η r ( ) % ' = sin 1 & ( 0.67 sin( θ i )) 12/1/16 Bruce Draper & J. Ross Beveridge 15

More Recursion This changes ray tracing from tail-recursion to double-recursion light1 light2 N N camera This is the recursive Refraction ray light3 12/1/16 Bruce Draper & J. Ross Beveridge 16

Practical Refraction: Surfaces What happens as it passes through a solid or surface? sinθ 1 = η i η r sinθ i sinθ i = η r η i sinθ 2 sinθ 1 = η i η r η r η i sinθ 2 = sinθ 2 Ø Overall effect: displacement of the incident vector Note: this assumes the two surfaces of the solid are coplanar! 12/1/16 Bruce Draper & J. Ross Beveridge 17

Refraction - No Trigonometry. First Constraint: Snells Law T = αw + βn sin( θ i ) 2 µ 2 = sin( θ t ) 2 µ = µ i µ t ( 1 cos( θ i ) 2 ) µ 2 =1 cos( θ t ) 2 W θ i N θ i R ( 1 ( W N) 2 ) µ 2 =1 ( N T ) 2 ( 1 ( W N) 2 ) µ 2 =1 N ( αw + βn) ( ) 2 -N θ t T 12/1/16 Bruce Draper & J. Ross Beveridge 18

Refraction - No Trigonometry Second Constraint: Refraction ray is unit length. T T = αw + βn ( ) αw + βn ( ) =1 = α 2 + 2αβ W N ( ) + β 2 =1 Two quadratic equations in two unknowns. Solving is a bit involved, next slide & writeup. Here is the answer. α = µ β = µ ( W N) 1 µ 2 + µ 2 ( W N) 2 12/1/16 Bruce Draper & J. Ross Beveridge 19

A Wonderful Real Example https://physicsb-2009-10.wikispaces.com Yes, refraction typically makes everthing upside down and backwards. 12/1/16 Bruce Draper & J. Ross Beveridge 20

Refraction and Polygons It is entirely possible to implement refraction through complex solid models defined by polygons. But! Doing so requires the following: Models must be complete: no holes! All faces (triangles) must be tagged to a solid. Needed to find where refraction ray exits the solid. There is a simpler special case Thin faces with parallel sides (next slide). 12/1/16 CSU CS410 Fall 2016, Ross Beveridge & Bruce Draper 21

Special Case: Thin Faces Consider entrance and exit The are parallel (see picture) Refraction vectors Pass through at a shifted angle But exit in the same direction Result is an offset only Offset depends on index of refraction Offset depends on the thickness of the face 12/1/16 Bruce Draper & J. Ross Beveridge 22

Double Recursion With refraction, ray tracing changes from tail-recursion to double recursion light1 light2 N N camera light3 This is the recursive refraction ray 12/1/16 Bruce Draper & J. Ross Beveridge 23

12/1/16 CSU CS410 Fall 2016, Ross Beveridge & Bruce Draper 24

Semester Wrap Up If you understand every line of code in the Sage Notebook creating this image you have covered a good portion of what is needed to have succeeded in CS 410 12/1/16 CSU CS410 Fall 2016, Ross Beveridge & Bruce Draper 25