Phong Shading Model Slide Set 8 04 Bui
Phong Shading Model Slide Set 8. 04
Bui Tuong Phong Contributions • Bui Tuong Phong developed two main methods used widely in computer graphics • The Phong reflection model describes illumination of a surface using three components: specular, diffuse, and ambient • Phong Shading is a technique for applying that model in which normal vectors are interpolated across a triangle to approximate the normal vectors at each fragment • In Gouraud shading, a color is computed at each vertex and fragments use interpolated colors 2
Approach to Realism • As we have discussed, we cannot use the fully detailed physics of light and reflection to render our scenes. • The Phong reflection model provides realistic lighting effects that can be efficiently computed in Open. GL. 3
Model Components • Light described in terms of three contributions: specular, diffuse, ambient • Surfaces described in terms of three characteristics: specular, diffuse, ambient • Surface geometry, mainly represented by several vectors computed at each point on the surface • Most importantly, the normal vector • Mathematical expressions that can be used to compute the color of each fragment 4
Describing Light • Each light source will contribute towards specular, diffuse and ambient lighting • With three values for each color, this is a total of nine values for a light source • We will simplify this considerably for our examples • The size of the values will depend on the characteristics of the light source itself and • Distance from surface point to the light source in case of a point • Direction of light for a directional light source 5
Surface Characteristics • We use the term material properties to describe how we model a surface reflecting light • Nine values specify how the surface reflects each RGB component of each type of light • Three values specify the shininess for each RGB component • Again, we will simplify this in our examples 6
Light Interacting with a Surface • To compute the basic reflection from a surface, each light type is multiplied by the corresponding surface type • Ambient light times surface ambient reflectivity • Diffuse light times surface diffuse reflectivity • Specular light times surface diffuse reflectivity • Shading will be implemented by computing other multiplicative factors 7
Demonstration • http: //ksuweb. kennesaw. edu/~bsetzer/4722 fa 20/nanoc/output/ modules/m 08 -light-shading/04 -phong-reflectionmodel/index. html#demonstrating-lighting-types 8
Four Vectors • 9
Computing the Lighting • Compute each component • Add the results 10
Ambient • Multiply the material component by the ambient component of each light source and add the results • The sum is the ambient contribution to the lighting 11
Diffuse • 12
Observations • If the light direction is straight down (high noon) then the cosine is 1 and the diffuse reflection is most intense • If the light direction is about parallel to the ground (twilight in winter) then the cosine is near 0 and the diffuse reflection is very small 13
Specular • 14
Observations • 15
Blinn-Phong Modification for Specular • 16
- Slides: 16