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

Similar documents
Lighting and Shading

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

Illumination & Shading

CS770/870 Spring 2017 Color and Shading

Raytracing. COSC 4328/5327 Scott A. King

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

Comp 410/510 Computer Graphics. Spring Shading

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

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

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

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Supplement to Lecture 16

COMP371 COMPUTER GRAPHICS

Shading I Computer Graphics I, Fall 2008

Lecture 10: Ray tracing

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

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

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

Introduction. Lighting model Light reflection model Local illumination model Reflectance model BRDF

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

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

CSE 681 Illumination and Phong Shading

Illumination & Shading: Part 1

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

Photorealism: Ray Tracing

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

Lighting and Reflectance COS 426

CS 325 Computer Graphics

CS 5625 Lec 2: Shading Models

Ray Tracing. Kjetil Babington

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

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

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

w Foley, Section16.1 Reading

Lecture 15: Shading-I. CITS3003 Graphics & Animation

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

Reflection and Shading

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

Computer Graphics. Illumination and Shading

Lighting affects appearance

Shading 1: basics Christian Miller CS Fall 2011

Implementation Issues

Ray-Tracing. Misha Kazhdan

Shading. Brian Curless CSE 557 Autumn 2017

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

Recall: Basic Ray Tracer

Illumination. Courtesy of Adam Finkelstein, Princeton University

Raytracing CS148 AS3. Due :59pm PDT

Reading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5.

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

CPSC 314 LIGHTING AND SHADING

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

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

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

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Review for Ray-tracing Algorithm and Hardware

Virtual Reality for Human Computer Interaction

Ray Tracing. Brian Curless CSEP 557 Fall 2016

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

Illumination in Computer Graphics

CS5620 Intro to Computer Graphics

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

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

Introduction to Computer Graphics 7. Shading

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

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

Lecture 7 Notes: 07 / 11. Reflection and refraction

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

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

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

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

CS6670: Computer Vision

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

Local Reflection Models

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

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

Lecture 4: Reflection Models

7: Rendering (1) COMP Computer Graphics and Image Processing. Local illumination model. Global illumination model. Direct Direct.

Shading. Reading. Pinhole camera. Basic 3D graphics. Brian Curless CSE 557 Fall Required: Shirley, Chapter 10

Computer Graphics: 3-Local Illumination Models

Illumination & Shading I

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

Algebra Based Physics

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

Physics 202, Lecture 23

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

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

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

specular diffuse reflection.

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

CS Illumination and Shading. Slide 1

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

Illumination Models & Shading

Complex Shading Algorithms

Topics and things to know about them:

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

Transcription:

CS 431/636 Advanced Rendering Techniques Ø Dr. David Breen Ø Korman 105D Ø Wednesday 6PM 8:50PM Presentation 6 5/16/12 Questions from ast Time? Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" 1 2 Slide Credits Ø Charles B. Owen - Michigan State University Illumination and Shading Ø The Hall illumination model Hall, R. A. and Greenberg D.P., "A Testbed for Realistic Image Synthesis", IEEE Computer Graphics and Applications, 3(8, pp. 10-20, ov. 1983 Ø Original ray tracing paper Whitted, T., An Improved Illumination Model for Shaded Display, Communications of the ACM, 23(6, pp. 343-349 (1980 3 4 Discrete Illumination Models Ø What occurs when light strikes a surface is quite complex. Continuous process ight from infinite angle reflected in infinite directions Ø We are determining intensity of a pixel with Finite number of point lights Finite reflections into space Finite illumination directions Ø Hence, we must have a discrete model for lighting and illumination. Illumination Models Ø What should a lighting model entail? Discrete ights Types of surface reflection Ø Commercial systems can be quite complex Most start with a basic model and embellish to pick up details that are missing 5 6 1

Elements of ighting at a point Reflection Ø What we need is the amount of light reflected to the eye The surface normal ector to the light ector to the eye R Reflection direction R 7 8 This consists of several components Ø Diffuse reflection - light reflected in all directions equally (or close to equally. Most obects have a component of diffuse reflection other than pure specular reflection obects like mirrors. What determines the intensity of diffuse reflection? Characteristics Ø Since the intensity is the same in every direction, the only other characteristic is the angle between the light and the surface normal. The smaller this angle, the greater the diffuse reflection: 9 10 ambert s aw 11 w w w cos = w / w' w = w'cos Diffuse reflection decreases intensity by the cosine of the angle between the light and surface normal. Ø Specular reflection - If the light hits the surface and is reflected off mostly in a reflection direction, we have specular reflection. There is usually some diffusion. A perfect specular obect (no diffusion at all is a mirror. Most obects have some specular characteristics 12 2

Diffuse and Specular colors Where do these come from? Ø Typically Ø Most the colors reflected for diffuse and specular reflection are different surfaces tend to have: Deep color, the color of the paint, finish, interior material, etc. Diffuse Generally the surface appearance Specular The color of bright highlights, often more white then the surface color Diffuse Color Surface reflection characteristics, varnish, polish, smoothness Specular Color 13 14 Components of the Hall Model The Hall Illumination Model I( = ksr Il ( Fsr (,"r, (cos" r, n + kst I l(fst (,"t, (cos" t, n' + kdr I l (Fdr (( $ + ksr Isr ( Fsr (,"R T r %sr + kst Ist (Fst (," T T t %st + kdr ( Fdr ( Ambient ight 15 16 Hall Model Implementing Shadows Ø At every ray intersection shoot a shadow ray at every point light source in your scene Ø If an obect is hit before reaching the light, don t use the light when shading that intersection point Ø What if occluding obect is transparent? Make light s contribution weighted rather than binary 17 18 3

Ambient ight Ambient ight ( Ø Ambient light is light with no associated direction. The term in the Hall shading model for ambient light is: Ø is the coefficent of diffuse reflection. This term determines how much diffuse reflection a surface has. It ranges from 0 to 1 (as do most of these coefficients. 19 ( Ø (λ is the spectrum of the ambient light. It is a function of the light wavelength λ. In nature this is a continuous range. For us it is the intensity of three values: Red, Blue, and Green, since that is how we are representing our spectrum. In other words, there are only 3 possible values for λ. Simply perform this operation for each color 20 Ambient ight ( Implementation ( Ø F dr (λ is the Fresnell term for diffuse reflection. It specifies a curve of diffuse reflections for every value of the spectrum. We don t have every possible color, we only have three. So, this term specifies how much of each color will be reflected. It is simply the color of the obect. Ø It s common to combine and F dr (λ F dr (λ is really ust a color. Just call this is ambient surface color (λ is the ambient light color Ø Implementation (But you don t have to for(int c=0; c<3; c++ hallcolor[c] = lightambient[c] * * surfacediffuse[c]; 21 22 of ight Sources Ø The iterator takes on the index of every light in the system. - coefficent of diffuse reflection. I l (λ - spectrum of light source. It is simply the color of the light. I l (( " of ight Sources I l (( " Ø component." is the surface normal at the point. is a vector towards the light. Dot product is the cosine of the angle (vectors must be normalized. alue decreases as the angle increases. 23 24 4

of ight k Sources sr Ø k sr and I l (λ are now obvious. Ø F sr (λ,θ r, is the Fresnell term representing the specular reflection curve of the surface. Specular reflection is due to microfacets in the surface and this curve can be complex. In real world systems which strive for accuracy, this curve will be measured for a given material. ote that the curve is dependent on not only the wavelength, but also an angle. Ø A simplification of this is to ignore the angle, which is what we will do. But, the color of spectral highlights is independent of the color of the surface and is often ust white. 25 I l (," r, (cos" r, n The Spectral Intensity Function Ø (cosθ r, n is the spectral intensity function. It represents the cosine of the angle between the half reflection vector and the surface normal raised to a power. Maximum reflection is in the mirror direction 26 k sr I l (," r, (cos" r, n Cosine of Reflection Angle H k sr I l (," r, (cos" r, n Reflection Angles H This is an example α α of maximum reflection H cos r, = " H cos r, = " H + H = + In this case, the half vector is the same as the surface normal Cosine of angle between half vector and normal is 1. H bisects the angle between and 27 28 Different Than Phong Shading H cos" r, = H Hall Model cos" r, = v r Phong Model Hall vs. Phong Specular Ø Same when = R cos(θ = cos(φ = 1 Ø Phong goes to zero when R. Then it goes negative Ø Hall only goes to zero when = &&. Ø Hall never negative. H R H 29 30 5

Highlight Coefficient Ø The term n is called the specular reflection highlight coefficient. Ø This effects how large the spectral highlight is. A larger value makes the highlight smaller and sharper. Matte surfaces has smaller n. 31 ery shiny surfaces have large n. A perfect mirror would have infinite n. from Other Surfaces Ø This is reflections of other surfaces Ø The only new terms are I sr (λ and T r Δsr The T r Δsr term reflects the fact that light falls off exponentially with distance. T r is a term which models how much light falls off per unit of travel within the medium. The Δsr term represents how far the light travels. ote that for mediums such as air and a small scene T r is close to 1, so you can sometimes ignore it. Glassner suggests 1/(1 + a*δsr instead 32 k sr I sr (," R T r sr The Reflection Direction Ø Given a view direction and a normal, the reflection direction R is: R = 2( " Ø I sr (λ is the color seen in the reflection direction, i.e. returned from the reflection ray Transmission Ø Transmission is light that passes through materials 33 34 from ights Ø Bright spots from lights passing through obects. Most of the same issues apply. Ø I l (λ is the color of light. Ø F st (λ,θ t, specular transmissive color of obect Ø (cosθ t, n is how the specularity falls off if looking directly down the direction of transmission. 35 k st I l (F st (," t, (cos" t, n' Refractive Transmission Ø Given indices of refraction on above and below a surface, we can compute the angle for the view and transmission vectors using Snell s law 36 sin sin" " i = i θ i T - θ η i η 6

What Transmission ooks ike Index of Refraction Ø Ratio of speed of light in a vacuum to the speed of light in a substance. 37 - T H H ' = " " 1, where " = 2 1 cos t, this time is (" H' η 1 and η 2 are the indices of refraction for the from and to obects respectively. 38 Substance Index acuum 1.0 Air 1.00029 Water 1.33 Glass 1.52 Diamond 2.417 Sapphire 1.77 Salt 1.54 The Transmission Direction Total Internal Reflection " r = " i " T = " r 39 ( ( $ 1$" 2 r (1$ ( 2 $" r See Glassner p. 134-141 T η i η Ø If light is traveling from η i to a smaller η (e.g. out of water into air, the angle from the negative normal increases: 40 This can lead to the angle for T being >=90 degrees This is called total internal reflection Square root term in previous equation goes negative T T η i η Total Internal Reflection Hack What to do if square root is negative? Ø Return obect s reflective color, or Ø Shoot an internal reflective ray, or Ø Make T equal to - Ø Do the one that looks best 41 from Other Surfaces 42 k st I st (F st (," T T t st Ø This is transmitted light from other obects Ø K st - specular transmission coefficient Ø I st (λ is the light value from transmitted ray Ø F st (λ,θ Τ specular transmissive color of obect Ø T r Δst is the light fall off term, as before Glassner suggests 1/(1 + a*δst instead Ø Δst is distance traveled through obect 7

Hall Model Recap Hall Model Revisited I( = k sr I l (," r, (cos" r, n +k st I l (F st (," t, (cos" t, n' + I l (( $ +k sr I sr (," R T r %sr +k st I st (F st (," T T t %st + ( Ambient ight I( = k sr I l (," r, (cos" r, n +k st I l (F st (," t, (cos" t, n' + I l (( " sr +k r I sr (," R T r st +k st I st (F st (," T T t +k a ( Ambient ight 43 44 ew Parameters Ø Adding two new coefficients in order to provide more flexibility to the model Ø K r Reflection coefficient If set to zero, the obect is not reflective This will allow you to generate Phongshaded models Ø K a Ambient coefficient Allows you to set ambient properties separate from diffuse properties 45 Algorithm Overview Ø For every primary ray that hits obect Shoot shadow ray at each light If you hit something don t use that light Or decrease light color if obect is transparent Calculate diffuse, specular and ambient colors Shoot reflected ray. Calculate color I sr (λ and add it to the shading equation Shoot transmitted ray. Calculate color I st (λ and add it to the shading equation Calculate transmissive specular highlight, if light ray goes through transparent obect 46 Generating trees for moderately complex scenes Ø Ø Ø Ø ight is reflected from several surfaces before reaching the viewer. The light ray behavior can be modeled as a tree. The shader traverses the tree, applying the shading equation at each node to calculate intensity. Tree should have a preset maximum depth Tricks Ø Terminate shadow ray ASAP Ø imit the depth of ray tree Ø Recursion can be stopped when color value drops below ε Ø Shooting a secondary ray can be tricky Move start point slightly away from surface Ø What if shadow ray hits a non-opaque obect? Ø What to do with total internal reflection and coming to the bottom of ray tree? 47 48 8

ext Programming Assignment Ø Update shading equation ew specular angle k d + k s = 1 Ø Add shadows Ø Add reflections I = k s I C s (cos n +k d I C d (cos" +k s I r C s +k a C d 49 9