Illumination and Shading • How to shade surfaces based on the position,orientation,characteristics of the surfaces and the light sources illuminating them Illumination Models • It express the factors • Determine a surface’s color at a given point • Called lighting models or shading models Shading Model • Determines when the illumination model is applied • What arguments it will receive • Ex:some shading models invoke an illumination model for every pixel in the image • Others invoke an illumination model for only some pixels , and shade the remaining pixels by interpolations (it is a method of constructing new data points within the range of a discrete set of known data points). Ambient light • light that is already present in a scene, before any additional lighting is added. It usually refers to natural light, either outdoors or coming through windows etc. It can also mean artificial lights such as normal room lights. • Fluorescent lighting in an office is an example of ambient lighting. • In renderings, an ambient light source is sometimes used as a default light source to give a baseline level of lighting to the model. Shading Model • It defines how light is scattered or reflected from a surface. • Light sources shine on the various surfaces of the objects. • The incident light interacts with the surface in 3 different ways. 1.Some is absorbed by the surface and converted to heat 2.Some is reflected from the surface 3.Some is transmitted into the interior of the object as in the case of a piece of glass Shading Model • If all of the incident light is absorbed ,the object appears black and is known as a black body. Example:Point light source Example:Point light source Example:Point light source Example:Point light source Diffuse Scattering • Occurs when some of the incident light penetrates the surface slightly • And re-radiated uniformly in all directions. • Scattered light interacts strongly with the surface • Its color is affected by the nature of the material by which the surface is made Example: Scattering Specular Reflections • • • • • Mirror like Highly directional Incident light does not penetrate the object It is reflected directly from its outer surface Reflected light color is same as the incident light • Make the material look like plastic Example:Specular Example:Specular Flat Shading • • • • • Simplest shading model for polygons. Also called constant shading or faceted shading Basic shading technique The entire object has only one color Color is computed at only one vertex, and entire face is filled with that color. • Brightness is drawn uniformly over the entire face. Flat shading • Calculate single intensity value, use it to share an entire polygon. • Sample the value of the illumination equation once for each polygon, hold the value across the polygon to reconstruct the polygon’s shade. Flat shading This approach is valid,if several assumptions are true, 1.The light source is at infinity,so Ń.Ĺ is constant across the polygon face. 2.The viewer is at infinity,so Ń.Ĺ is constant across the polygon face. 3.The polygon represents the actual surface being modeled,and is not an approximation to a curved surface. Example:Flat shading Example:Flat shading advantages • Inexpensive to compute • Appropriate for objects with flat surfaces • Less pleasant for smooth surfaces. Smooth(or)Interpolative shading Smooth(or)Interpolative shading • • • • • • • It calculates the color at each vertex Produces much better image It computes during scan conversion More expensive to calculate It attempts to emphasize edges between faces Compute colors at more points on each face. Showing the smooth underlying surface rather than the individual polygons making up the object. Two types of smooth shading 1.Gourad shading 2.Phong shading