60 likes | 73 Views
Explore the concepts of local illumination and shading in computer graphics, including the interaction between objects, materials, and light sources. Learn about the three basic shading models - flat, Gouraud, and Phong, and how to program them using OpenGL. Discover Lambert's Law, specular reflection, and the use of the half-way vector for faster computation. Update your hierarchical scene model to incorporate realistic lighting effects.
E N D
Local Illumination Pictures Gerda Kamberova
Lightinginteraction between objects’ materials and geometry, and the light sources Shadingthe process of performing the lighting computations and determining pixels’ color from them. Three basic models discussed Flat Gouraud Phong Programming OpenGL Updating the hierarchical scene model Summary: Intro to Lighting and Shading Gerda Kamberova
Lambert’s law Ip(L.N) Ip N L P It does not matter where the viewer is, he sees reflected light in the mount of Ip(L.N) Gerda Kamberova
Specular reflection N L R Ip V P Light reflected in direction of V = Ip(R.V) Each time viewer changes position must be recomputed Gerda Kamberova
Specular reflection N L R Ip a a -b b P R = -b+a = -(L-a)+a = -(L-(L.N)N)+(L.N)N = 2(L.N)N – L If the relative position of light and object changes, must be recomputed Gerda Kamberova
Using the half-way vector to speed up computation N H L R Ip V P H=(L+V)/|L+V| 2(H.N) approximates (R.V), H is easier to compute than R Gerda Kamberova