Illumination I: The Phong Illumination Model

Similar documents
Computer Applications in Textile Engineering. Computer Applications in Textile Engineering

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Exam 1 Sample Question SOLUTIONS. y = 2x

Specular reflection. Dielectrics and Distribution in Ray Tracing. Snell s Law. Ray tracing dielectrics

PRODUCT LIFECYCLE MANAGEMENT COMPETENCY CENTRE RENDERING. PLMCC, JSS Academy of Technical Education, Noida Rendering 1 of 16

L 2 : x = s + 1, y = s, z = 4s Suppose that C has coordinates (x, y, z). Then from the vector equality AC = BD, one has

FURTHER VECTORS (MEI)

Dhiren Bhatia Carnegie Mellon University

My Materials. In this tutorial, we ll examine the material settings for some simple common materials used in modeling.

Chapter 23. The Reflection of Light: Mirrors

Math 241 Lines and Planes (Solutions) x = 3 3t. z = 1 t. x = 5 + t. z = 7 + 3t

Curves and Surfaces. Goals. How do we draw surfaces? How do we specify a surface? How do we approximate a surface?

Geometric description of the cross product of the vectors u and v. The cross product of two vectors is a vector! u x v is perpendicular to u and v

Geometry Chapter Point (pt) 1.1 Coplanar (1.1) 1.1 Space (1.1) 1.2 Line Segment (seg) 1.2 Measure of a Segment

Maya 2014 Still Life Part 1 Texturing & Lighting

Computer Animation: Art, Science and Criticism

An introduction to Global Illumination. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Equations of Lines and Planes

Computer Graphics. Introduction. Computer graphics. What is computer graphics? Yung-Yu Chuang

GRAFICA - A COMPUTER GRAPHICS TEACHING ASSISTANT. Andreas Savva, George Ioannou, Vasso Stylianou, and George Portides, University of Nicosia Cyprus

The Lighting Effects Filter

H.Calculating Normal Vectors

CS 431/636 Advanced Rendering Techniques"

Cartoon-Looking Rendering of 3D-Scenes

Advanced Computer Graphics. Rendering Equation. Matthias Teschner. Computer Science Department University of Freiburg

1.5 Equations of Lines and Planes in 3-D

Procedure: Geometrical Optics. Theory Refer to your Lab Manual, pages Equipment Needed

1. Equations for lines on the plane and planes in the space.

Example SECTION X-AXIS - the horizontal number line. Y-AXIS - the vertical number line ORIGIN - the point where the x-axis and y-axis cross

PHOTON mapping is a practical approach for computing global illumination within complex

COMP175: Computer Graphics. Lecture 1 Introduction and Display Technologies

CUBE-MAP DATA STRUCTURE FOR INTERACTIVE GLOBAL ILLUMINATION COMPUTATION IN DYNAMIC DIFFUSE ENVIRONMENTS

Section The given line has equations. x = 3 + t(13 3) = t, y = 2 + t(3 + 2) = 2 + 5t, z = 7 + t( 8 7) = 7 15t.

Course Overview. CSCI 480 Computer Graphics Lecture 1. Administrative Issues Modeling Animation Rendering OpenGL Programming [Angel Ch.

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

LINES AND PLANES CHRIS JOHNSON

CIRCLE COORDINATE GEOMETRY

Computer Graphics Global Illumination (2): Monte-Carlo Ray Tracing and Photon Mapping. Lecture 15 Taku Komura

Graphic Design. Background: The part of an artwork that appears to be farthest from the viewer, or in the distance of the scene.

Synthetic Sensing: Proximity / Distance Sensors

Elasticity Theory Basics

COMP-557: Fundamentals of Computer Graphics McGill University, Fall 2010

3D Scanner using Line Laser. 1. Introduction. 2. Theory

discuss how to describe points, lines and planes in 3 space.

TWO-DIMENSIONAL TRANSFORMATION

9.4. The Scalar Product. Introduction. Prerequisites. Learning Style. Learning Outcomes

How many PIXELS do you need? by ron gibbs

Monte Carlo Path Tracing

Last lecture... Computer Graphics:

The Three Heat Transfer Modes in Reflow Soldering

JUST THE MATHS UNIT NUMBER 8.5. VECTORS 5 (Vector equations of straight lines) A.J.Hobson

The RADIANCE Lighting Simulation and Rendering System

Section 9.5: Equations of Lines and Planes

Computer Graphics Labs

28 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE. v x. u y v z u z v y u y u z. v y v z

12.5 Equations of Lines and Planes

Lecture 8 : Coordinate Geometry. The coordinate plane The points on a line can be referenced if we choose an origin and a unit of 20

DEFINITION A complex number is a matrix of the form. x y. , y x

Surface Normals and Tangent Planes

Math 241, Exam 1 Information.

Materials in NX Render

Real Time Rendering. Preface What's New Getting Started Basic Tasks Advanced Tasks Workbench Description Index

Section 13.5 Equations of Lines and Planes

THREE DIMENSIONAL GEOMETRY

SkillsUSA 2014 Contest Projects 3-D Visualization and Animation

Figure 1.1 Vector A and Vector F

AP Physics B Ch. 23 and Ch. 24 Geometric Optics and Wave Nature of Light

Determine whether the following lines intersect, are parallel, or skew. L 1 : x = 6t y = 1 + 9t z = 3t. x = 1 + 2s y = 4 3s z = s

Scan-Line Fill. Scan-Line Algorithm. Sort by scan line Fill each span vertex order generated by vertex list

(a) We have x = 3 + 2t, y = 2 t, z = 6 so solving for t we get the symmetric equations. x 3 2. = 2 y, z = 6. t 2 2t + 1 = 0,

Mark Scheme. Mathematics General Certificate of Education examination June series. MPC1 Pure Core 1

Continued Fractions and the Euclidean Algorithm

LINES AND PLANES IN R 3

Section 1.1. Introduction to R n

ICC Recommendations for Color Measurement

Solutions to old Exam 1 problems

13.4 THE CROSS PRODUCT

GUI GRAPHICS AND USER INTERFACES. Welcome to GUI! Mechanics. Mihail Gaianu 26/02/2014 1

Lecture 14: Section 3.3

Geometry Module 4 Unit 2 Practice Exam

Deferred Shading & Screen Space Effects

INTRODUCTION TO RENDERING TECHNIQUES

Lesson 26: Reflection & Mirror Diagrams

Interference. Physics 102 Workshop #3. General Instructions

Reflectance Characteristics of Accuflect Light Reflecting Ceramic

CM2202: Scientific Computing and Multimedia Applications General Maths: 2. Algebra - Factorisation

11.1. Objectives. Component Form of a Vector. Component Form of a Vector. Component Form of a Vector. Vectors and the Geometry of Space

Lines & Planes. Packages: linalg, plots. Commands: evalm, spacecurve, plot3d, display, solve, implicitplot, dotprod, seq, implicitplot3d.

The Fourth International DERIVE-TI92/89 Conference Liverpool, U.K., July Derive 5: The Easiest... Just Got Better!

A QUICK GUIDE TO THE FORMULAS OF MULTIVARIABLE CALCULUS

13. Write the decimal approximation of 9,000,001 9,000,000, rounded to three significant

CHAPTER FIVE. 5. Equations of Lines in R 3

Vector Math Computer Graphics Scott D. Anderson

PLOTTING DATA AND INTERPRETING GRAPHS

Blackbody Radiation References INTRODUCTION

The waveguide adapter consists of a rectangular part smoothly transcending into an elliptical part as seen in Figure 1.

Introduction to Computer Graphics

National 5 Mathematics Course Assessment Specification (C747 75)

Transcription:

Illumination I: The Phong Illumination Model Components of Phong illumination or reflection model using RGB model: OpenGL allows us to break this light s emitted intensity into 3 components: ambient L a, diffuse L d, and specular L s. Each type of light component consists of 3 color components, so, for example, L rd denotes the intensity of the red component of diffuse illumination. Question: What is the amount of light that is transmitted (either by emission or reflection) from each point in the direction of the viewer. Solution: This is achieved by first associating reflectivity or material properties to all the modelled objects in the scene, and then applying a Phong reflection calculation to determine the transmitted light intensity. The Reflected Light Luminance/Intensity function shall be captured by: for each of Light s components. For example, I = (I r,i g,i b ) The University of Texas at Austin 1

ambient emission I a = I ar I ag I ab An object s material properties determines how much of a given input Light intensity is reflected. Under the Phong model, material properties are captured by reflectivity coefficient vectors K = (k r,k g,k b ) for ambient, diffuse and specular. Thus k d r is the fraction of red diffuse light that is reflected from an object. If k r = 0, then no red light is reflected. The computation of reflected luminance/intensity function using Phong illumination, for each object and light source, shall be governed by the following four light/material interactions. Emission intensity: to model objects that glow Ambient reflection: A simple way to model indirect reflection. All surfaces in all positions and orientations are illuminated equally. Diffuse reflection: The diffuse shading produced by dull, smooth objects. Specular reflection: The bright spots appearing on smooth shiny (e.g., metallic or polished) surfaces. The University of Texas at Austin 2

Relevant Vectors for Phong Shading l n v α r θ θ The shading of a point on a surface is a function of the relationship between the viewer, light sources, and surface. The following vectors are relevant to direct illumination. All vectors are assumed to be normalized to unit length. Normal vector: A vector n that is perpendicular to the surface and directed outwards from the surface. View vector: A vector v that points in the direction of the viewer. Light vector: A vector l that points towards the light source. Reflection vector: A vector r that indicates the direction of pure reflection of the light vector. The University of Texas at Austin 3

Normals Computation Given any three non-collinear points, P 0, P 1, P 2, on a polygon, a normal of the polygon is given through a cross product n = (P 1 P 0 ) (P 2 P 0 ). n P 0 P 2 P 1 Normals by cross product. For a polygon is given by n points P 0, P 1,..., P n 1. If we can determine a plane equation (via least-squares fit): ax + by + cz + d = 0 from these n points, then normalizing (a,b,c) is the unit normal vector n of the polygon. The University of Texas at Austin 4

Normals for Implicitly Defined Surfaces Given a surface defined by an implicit representation, i.e., defined by some equation f(x,y,z) = 0 then the normal at some point is given by gradient vector n = f/ x f/ y f/ z The University of Texas at Austin 5

Normals for Parametric Surfaces Surfaces in computer graphics are most often represented parametrically. The parametric representation of a surface is defined by three functions of 2 variables or parameters: x = φ x (u,v), y = φ y (u,v), z = φ z (u,v). Then the normal of the surface at a point is defined as the n = φ u φ v where φ u = φ x / u φ y / u φ z / u φ v = φ x / v φ y / v φ z / v The University of Texas at Austin 6

The Reflection Vector n l u n, u r n = ( n l) n u = n l r = l + 2 u = l + 2( n l) = 2( n l) n l The University of Texas at Austin 7

The Refraction Vector l n ò l ò t -n t If η l and η t are the refractive indices of the materials on the two sides of the surface, then Snell s law states that η l Sin(θ l ) = η t Sin(θ t ) The University of Texas at Austin 8

Using this and the fact that l, n, and t are assumed coplanar, we can calculate the unit transmitted light vector t, as follows. let η = η t η l, we have Cos(θ t ) = ((1 1 η 2(1 Cos2 (θ l ))) 1 2 and t = 1 η l (Cos(θt ) 1 η Cos(θ l)) n The University of Texas at Austin 9

Ambient Light Reflection Ambient light is simplest to deal with. Let I a denote the intensity of ambient light. For each surface, let 0 k a 1 denote the surface s coefficient of ambient reflection, that is, the fraction of the ambient light that is reflected from the surface. The ambient component of illumination is I a = k a L a Note that this is a vector equation (whose components are RGB). The University of Texas at Austin 10

Diffuse Reflection Diffuse reflection arises from the assumption that light from any direction is reflected uniformly in all direction. Such a reflector is called a pure Lambertian reflector. n l l n q da da da cos q The key parameter of surface that controls diffuse reflection is k d, the surface s coefficient of diffuse reflection. Let I d denote the diffuse reflection component of the light source. Assume l and n are normalized, then cosθ = ( n l). If ( n l) < 0, then the point is on the dark side of the object. The diffuse component to illumination is I d = k d max(0, n l)l d The University of Texas at Austin 11

The University of Texas at Austin 12

Specular Reflection I Most objects are not perfect Lambertian reflector. One of the most common deviation is for smooth metallic or highly polished objects. They tend to have specular highlights (or shiny spots ). The parameters of surface that control specular reflection under Phong model, are k s, the surface s coefficient of specular reflection, and s, shininess. The formula for the specular component is I s = k s ( r v) s L s The University of Texas at Austin 13

Specular Reflection II Another way of calculating specular reflection under the Phong model, is via the halfway vector (OpenGL). Define h to be the halfway vector, the normalized vector which is the halfway of l and v. Define h = Normalize ( l + v). The formula for the specular component can then be written as I s = k s ( n h) s L s The University of Texas at Austin 14

The Phong Model Illumination Equation The total illumination of a point in OpenGL is computed for the supported Light sources and is calculated I = I e + I a + = I e + k a L a + 1 a + bd + cd 2(I d + I s ) 1 a + bd + cd 2(k dmax(0, n l)l d + k s ( n h) s L s ), where d is the distance from the object to the light source. The reflection material properties for front/back of each surface is specified by OpenGL using for example, GLfloat ambient[]=0.1,0.25,0.0,1.0 GLfloat diffuse[]=0.1,0.25,0.0,1.0 GLfloat specular[]=1.0,0.0,1.0,1.0 The University of Texas at Austin 15

GLfloat emission[]=0.0,0.8,0.0,1.0 glmaterialfv(gl-front-and-back,gl-specular,specular) glmaterialf(gl-front-and-back,gl-shininess, 100.0) Function gllightmodel*() allows us to tell OpenGL how to carry out the lighting calculations. Since normals are reversed for back faces and the front, back faces can have different material properties, calculating shading for back faces requires extra work. If we need correct two-sided lighting calculations (when we can see inside an object) one uses gllightmodeli(gl-light-model-two-sided, GL-TRUE); For multiple light sources, we add up the ambient, diffuse, and specular components for each light source. The University of Texas at Austin 16

Reading Assignment and News Please review the appropriate sections related to this weeks lectures in chapter 5, and 11, and associated exercises, of the recommended text. (Recommended Text: Interactive Computer Graphics, by Edward Angel, Dave Shreiner, 6th edition, Addison-Wesley) Please track Blackboard for the most recent Announcements and Project postings related to this course. (http://www.cs.utexas.edu/users/bajaj/graphics2012/cs354/) The University of Texas at Austin 17