Reflection and Transmission

Similar documents
Real-time Graphics 6. Reflections, Refractions

Supplement to Lecture 16

Real-Time Rendering (Echtzeitgraphik) Dr. Michael Wimmer

Chromatic Aberration. CEDEC 2001 Tokyo, Japan

COMP371 COMPUTER GRAPHICS

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Shading II. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Shading I Computer Graphics I, Fall 2008

Introduction to Computer Graphics with WebGL

Computer Graphics (CS 543) Lecture 8c: Environment Mapping (Reflections and Refractions)

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

Introduction to Computer Graphics 7. Shading

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Light. Electromagnetic wave with wave-like nature Refraction Interference Diffraction

Physics 202, Lecture 23

Lighting and Shading

Illumination. Courtesy of Adam Finkelstein, Princeton University

Lab 9 - Metal and Glass

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

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

Complex Shading Algorithms

The Rendering Equation. Computer Graphics CMU /15-662

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

Ray Tracing. Local Illumination. Object Space: Global Illumination. Image Space: Backward Ray Tracing. First idea: Forward Ray Tracing

Reflection and Refraction

Illumination & Shading

13. Brewster angle measurement

Reflection and Refraction

CG Programming: 3D Texturing

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

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

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

Lighting and Reflectance COS 426

Lecture 10: Ray tracing

Reflection and Refraction of Light

Light and Electromagnetic Waves. Honors Physics

Ray-Tracing. Misha Kazhdan

Photorealism: Ray Tracing

Ray Tracing. Brian Curless CSEP 557 Fall 2016

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

CS770/870 Spring 2017 Color and Shading

Comp 410/510 Computer Graphics. Spring Shading

Shading. Why we need shading. Scattering. Shading. Objectives

Refractions, Reflections and Caustics : Basic Concepts

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

Timothy Walsh. Reflection Models

WHY WE NEED SHADING. Suppose we build a model of a sphere using many polygons and color it with glcolor. We get something like.

Name Section Date. Experiment Reflection and Refraction

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

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

Surface Rendering Methods

Illumination and Shading

Reflection and Refraction

Lecture 19: All Together with Refraction

GLSL II. Objectives. Coupling GLSL to Applications Example applications

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

Implementation Issues

CS452/552; EE465/505. Intro to Lighting

Reflection and Refraction of Light

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

Reflections and Refractions in Ray Tracing

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

Chapter 23. Light Geometric Optics

Computer Graphics with OpenGL ES (J. Han) Chapter 6 Fragment shader

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

The Propagation of Light:

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

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Global Illumination. COMP 575/770 Spring 2013

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

Lecture 14: Refraction

Geometrical Optics INTRODUCTION. Wave Fronts and Rays

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

Interactive Methods in Scientific Visualization

03 RENDERING PART TWO

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

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading.

3/10/2019. Models of Light. Waves and wave fronts. Wave fronts and rays

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

INF3320 Computer Graphics and Discrete Geometry

Phys 102 Lecture 17 Introduction to ray optics

CS 6620 Shading. Steve Parker Peter Shirley

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

Image Synthesis. Global Illumination. Why Global Illumination? Achieve more photorealistic images

Lighting and Shading II. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Introduction to Visualization and Computer Graphics

Refraction Ch. 29 in your text book

Overview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL

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

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

Chapter 24. Geometric optics. Assignment No. 11, due April 27th before class: Problems 24.4, 24.11, 24.13, 24.15, 24.24

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Homework #1. Reading: Chaps. 14, 20, 21, 23. Suggested exercises: 23.6, 23.7, 23.8, 23.10, 23.12, 23.13, 23.14, 23.15

Physics Midterm Exam (3:00-4:00 pm 10/20/2009) TIME ALLOTTED: 60 MINUTES Name: Signature:

Refraction and Dispersion

Objectives. Shading II. Distance Terms. The Phong Reflection Model

M jrs M jgs M jbs Intensity of light reflected from surface j when illuminated by source i: I ijr

Geometrical Optics. 1 st year physics laboratories. University of Ottawa

CS 325 Computer Graphics

Transcription:

Reflection and Transmission Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico

Introduction Interactions between light and materials Phong model - Absorbtion - Diffuse and specular reflections - Puerely local Reflection: Translucent surfaces - Refraction - Frensel effect - Chromatic dispersion 2

Global vs Local Most of these effects can only be computed in a global renderer such as a ray tracer 3

Ray Tracing Ray tracers can make use of all these effects in a global calculation by tracing rays R N L T -N 4

Environmental Map Can use all these effects Implement in Cg with vertex and fragment programs 5

Refraction With pure refraction, all the light is transmitted but the angle of refraction is determined by Snell s law ή l sin θ l = ή t sin θ t where ή l and ή t are the speed of light relative to the speed of light in a vacuum Let ή = ή l / ή t 6

Computing T ή 2 sin 2 θ l = ή 2 (1- cos 2 θ l )= sin 2 θ t = 1-cos 2 θ t Solving for cos θ t Assuming normalized vectors cos θ t = T N = (1- ή 2 (1-cos 2 θ l )) 1/2 where cos θ l = T N T, N, and L must be coplanar T = L + N and T T = 1 Solving T = -1/ ή L (cos θ t -1/ ή cos θ l ) N 7

Notes Critical angle: total internal reflection 1= ή 2 (1-cos 2 θ l ) Snell s law is a statement that light takes the shortest path (in time) Can apply to reflection maps (see Cg Tutorial) via vertex program 8

Fresnel Effect Some light is reflected and some transmitted at surface between two materials Amount of light reflected is greatest at shallow angle Approximation: use affine combination of refracted and reflected colors where = max (0, min(1, bias + scale (1 + L N) power )) 9

Chromatic Dispersion The refraction coefficient is actually a function of wavelength N L T r -N T g T b 10

Chromatic Dispersion with Cg Easy to do with reflection maps Use three values of Make use of vector operations 11

Fragment Program void C7E5v_dispersion(float4 position : POSITION, float3 normal : NORMAL, out float4 oposition : POSITION, out float reflectionfactor : COLOR, out float3 R : TEXCOORD0, out float3 TRed : TEXCOORD1, out float3 TGreen : TEXCOORD2, out float3 TBlue : TEXCOORD3, { uniform float fresnelbias, uniform float fresnelscale, uniform float fresnelpower, uniform float3 etaratio, uniform float3 eyepositionw, uniform float4x4 modelviewproj, uniform float4x4 modeltoworld) 12

Fragment Program oposition = mul(modelviewproj, position); // Compute position and normal in world space float3 positionw = mul(modeltoworld, position).xyz; float3 N = mul((float3x3)modeltoworld, 13

Fragment Program void C7E6f_dispersion(float reflectionfactor : COLOR, float3 R : TEXCOORD0, float3 TRed : TEXCOORD1, float3 TGreen : TEXCOORD2, float3 TBlue : TEXCOORD3, out float4 color : COLOR, { uniform samplercube environmentmap0, uniform samplercube environmentmap1, uniform samplercube environmentmap2, uniform samplercube environmentmap3) 14

Fragment Program // Fetch the reflected environment color float4 reflectedcolor = texcube(environmentmap0, R); // Compute the refracted environment color float4 refractedcolor; refractedcolor.x = texcube(environmentmap1, TRed).x; refractedcolor.y = texcube(environmentmap2, TGreen).y; refractedcolor.z = texcube(environmentmap3, TBlue).z; refractedcolor.w = 1; // Compute the final color color = lerp(refractedcolor, reflectedcolor, reflectionfactor); } 15