5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model.

Slides:



Advertisements
Similar presentations
Chapter 1 The Study of Body Function Image PowerPoint
Advertisements

Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Points, Vectors, Lines, Spheres and Matrices
GR2 Advanced Computer Graphics AGR
GR2 Advanced Computer Graphics AGR
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 6 Physically Based Reflection Model.
15.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 15 – Visible Surfaces and Shadows.
GR2 Advanced Computer Graphics AGR
SI23 Introduction to Computer Graphics
SI23 Introduction to Computer Graphics
GR2 Advanced Computer Graphics AGR
16.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 16 – Some Special Rendering Effects.
7.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 7 Polygon Shading Techniques.
9.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
SI31 Advanced Computer Graphics AGR
8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
13.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 13 An Introduction to Ray Tracing.
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
VOORBLAD.
Factor P 16 8(8-5ab) 4(d² + 4) 3rs(2r – s) 15cd(1 + 2cd) 8(4a² + 3b²)
#1UNIT C Describes a material which allows light to pass through easily.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
25 seconds left…...
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
PSSA Preparation.
13- 1 Chapter 13: Color Processing 。 Color: An important descriptor of the world 。 The world is itself colorless 。 Color is caused by the vision system.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CS 480/680 Computer Graphics Shading 2 Dr. Frederick C Harris, Jr.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
University of New Mexico
Rendering (彩現 渲染).
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Course Website: Computer Graphics 16: Illumination.
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Illumination.
CS 445 / 645: Introductory Computer Graphics
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
David Luebke 1 10/26/2015 Lighting CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
Basic Illumination BRANCH :- ELECTRICAL (C11) Gohil Amit M. ( ) Joshi Jay P. ( ) Barot Mahesh P. ( ) Pandya Bhrugu I.
Illumination.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Cornell CS465 Spring 2004 Lecture 4© 2004 Steve Marschner 1 Shading CS 465 Lecture 4.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Shading To determine the correct shades of color on the surface of graphical objects.
CSE 470 Introduction to Computer Graphics Arizona State University
Chapter IX Lighting.
Simple Illumination CSE 681.
CS 480/680 Computer Graphics Shading.
Presentation transcript:

5.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 5 A Simple Reflection Model

5.2 si31_2001 What is a Reflection Model? reflection modellighting illumination n A reflection model (also called lighting or illumination model) describes the interaction between light and a surface, in terms of: – surface properties – nature of incident light n Computer graphics uses a simplification of accurate physical models – objective is to mimic reality to an acceptable degree

5.3 si31_2001 Phong Reflection Model n The most common reflection model in computer graphics is due to Bui-Tuong Phong - in 1975 n Has proved an acceptable compromise between simplicity and accuracy n Largely empirical

5.4 si31_2001 Diffuse Reflection and Specular Reflection - Phong Approach microscopic view white light specular reflection (white) diffuse reflection (yellow) yellow pigment particles Some light reflected directly from surface. Other light passes into material. Particles of pigment absorb certain wavelengths from the incident light, but also scatter the light through multiple reflections - some light emerges back through surface as diffuse reflection.

5.5 si31_2001 Ambient Reflection ambient n In addition to diffuse and specular reflection, a scene will also include ambient reflection n This is caused by light falling on an object after reflection off other surfaces – eg in a room with a light above a table, the floor below the table will not be totally black, despite having no direct illumination - this is reflection of ambient light

5.6 si31_2001 Reflection Model - Ambient Light surface I ( )= K a ( )I a ( ) I a = Intensity of ambient light K a = Ambient-reflection coefficient I = Reflected intensity = wavelength of light hemisphere of ambient light P

5.7 si31_2001 Ambient Lighting

5.8 si31_2001 Reflection Model - Diffuse Reflection Light reflected equally in all directions - intensity dependent on angle between light source and surface normal Lamberts cosine law: I = I* cos where I* is intensity of light source P light source P light source light source N L surface

5.9 si31_2001 Reflection Model - Diffuse Reflection I = K d ( cos ) I* I* = Intensity of light source N = Surface normal L = Direction of light source K d = Diffuse-reflection coefficient I = Reflected intensity light source N L surface Light reflected equally in all directions, with intensity depending on angle between light and surface normal:

5.10 si31_2001 Reflection Model - Diffuse Reflection The angle between two vectors is given by their dot product: cos = L. N (assume L, N are unit length) The coefficient K d depends on the wavelength of the incoming light light source N L surface I ( ) = K d ( ) ( L. N ) I*( )

5.11 si31_2001 Ambient and Diffuse

5.12 si31_2001 Reflection Model - Specular Reflection In perfect specular reflection, light is only reflected along the unique direction symmetric to the incoming light P light source N R

5.13 si31_2001 Reflection Model - Specular Reflection P light source N R In practice, light is reflected within a small angle of the perfect reflection direction - the intensity of the reflection tails off at the outside of the cone. This gives a narrow highlight for shiny surfaces, and a broad highlight for dull surfaces.

5.14 si31_2001 Reflection Model - Specular Reflection Thus we want to model intensity, I, as a function of angle between viewer and R, say, like this: I with a sharper peak for shinier surfaces, and broader peak for dull surfaces.

5.15 si31_2001 Reflection Model - Specular Reflection n Phong realised this effect can be modelled by: (cos ) n with a sharper peak for larger n I n=1 n=10

5.16 si31_2001 Reflection Model - Specular Reflection I = K s ( cos ) n I* I* = Intensity of light source V = View direction R = Direction of perfect reflected light K s = Specular-reflection coefficient I = Reflected intensity n varies with material large n : shiny small n : dull Intensity depends on angle between eye and reflected light ray: V light source N L R eye surface

5.17 si31_2001 Reflection Model - Specular Reflection V light source N L R eye surface Using cos = R. V (R, V unit vectors), we have: I ( ) = K s ( R. V ) n I( )* Note: K s does not depend on the wavelength - hence colour of highlight is same as source Note: intensity forms ellipse shape

5.18 si31_2001 Ambient, Diffuse and Specular

5.19 si31_2001 Reflection Model - Ambient, Diffuse and Specular Reflection Model - Ambient, Diffuse and Specular light source I( ) = K a ( )I a ( ) + ( K d ( )( L. N ) + K s ( R. V ) n ) I*( ) N L R V eye surface

5.20 si31_2001 Example - Ambient Reflection

5.21 si31_2001 Example - Ambient and Diffuse

5.22 si31_2001 Ambient, Diffuse and Specular

5.23 si31_2001 Reflection Model - Effect of Distance light source surface d The intensity of light reaching a surface decreases with distance - so we use typically: I* K 1 + K 2 *d + K 3 *d 2 K 1, K 2, K 3 constant - often K 2 =1, K 3 =0

5.24 si31_2001 Final Reflection Model light source N L R V eye surface d I( ) = K a ( )I a ( ) + ( K d ( )( L. N ) + K s ( R. V ) n ) I*( ) K 1 + K 2 *d + K 3 *d 2 This needs to be applied for every light source in the scene

5.25 si31_2001 Phong illumination model: Ks 0.0 to 1.0, Kd 0.0 to 1.0 (Ka = 0.7, n = 10.0) Ks Kd

5.26 si31_2001 Phong Illumination Model: Ks 0.0 to 1.0; n = 10.0 to (Ka = 0.7, Kd = 1.0) n Ks

5.27 si31_2001 Phong Model in Practice n In practice, some simplifications are made to the model for sake of efficiency n For example, ambient light is sometimes assumed to be a constant n Other simplifications are: – lights at infinity – simple colour model

5.28 si31_2001 Practicalities - Effect of Distance n There are advantages in assuming light source and viewer are at infinity – L and V are then fixed for whole scene and calculations become simpler directional n Lights at infinity are called directional lights positional point n Lights at a specified position are called positional, or point, lights

5.29 si31_2001 Practicalities - Calculating R n R + L = 2 ( N.L ) N hence R = 2 ( N.L )N - L n In practice, implementations often compute H = ( L + V ) / 2 and replace (R.V) with (H.N) – these are not the same, but compensation is made with choice of n (angle between N and H is half angle between R and V - if vectors coplanar) N LR R L V R H N

5.30 si31_2001 Practicalities - Calculating R n As noted, if viewer and light source both sufficiently far from surface, then V and L are constant over scene - and so H = (L+V)/2 just needs to be calculated once n H is often called the halfway vector

5.31 si31_2001 Practicalities - Effect of Colour The Phong reflection model gives reflection for each wavelength in visible spectrum n In practice, we assume light to be composed as a mixture of RGB (red, green, blue) components - and reflection model is applied for each component n Coefficients of ambient-reflection (K a ) and diffuse-reflection (K d ) have separate components for RGB n Coefficient of specular-reflection (K s ) is independent of colour

5.32 si31_2001 Acknowledgements n Thanks to Alan Watt for the images