Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Traditional Lighting Model in Computer Graphics: Ambient, Diffuse, and Specular Light, Slides of Computer Graphics

An overview of the traditional method of calculating lighting in real-time computer graphics. It explains the local lighting model, which calculates lighting at a vertex as a sum of ambient, diffuse, and specular light. The reflection coefficients, the role of ambient, diffuse, and specular light, and phong's specular lighting equation.

Typology: Slides

2011/2012

Uploaded on 11/09/2012

bacha
bacha 🇮🇳

4.3

(42)

214 documents

1 / 72

Toggle sidebar

Partial preview of the text

Download Traditional Lighting Model in Computer Graphics: Ambient, Diffuse, and Specular Light and more Slides Computer Graphics in PDF only on Docsity! Computer Graphics Lecture 29 Docsity.com Mathematics of Lighting and >) aYele [ae mem I The traditional approach in real-time computer graphics has been to calculate lighting at a vertex as a sum of the ambient, diffuse, and specular light. Docsity.com In the simplest form (used by OpenGL and Direct3D), the function is simply the sum of these lighting components (clamped to a maximum color value). Docsity.com we have an ambient term and then a sum of all the light from the light sources Docsity.com This is called a local lighting model since the only light on a vertex is from a light source, not from other objects. That is, lights are lights, not objects! Docsity.com we've included the reflection coefficients for each term, k for completeness. Docsity.com The reflection coefficients are in the [0,1] range and are specified as part of the material property Docsity.com Thus this equation is really not good at modeling the illumination of objects that have anything other than a smooth surface (like fur or sand) Docsity.com or a surface that doesn't really reflect light uniformly in all directions (like brushed metal, hair, or skin). Docsity.com However, with liberal use of texture maps to add detail, this model has served pretty well and can still be used for a majority of the lighting processing to create a realistic environment in real time Docsity.com Ambient light is the light that comes from all directions — thus all surfaces are illuminated equally regardless of orientation Docsity.com Figure 1: Ambient light provides illumination, but no surface details. Docsity.com We can see that it's difficult to make out details or depth information with just ambient light. Docsity.com A world with too much ambient light looks washed out and dull. Docsity.com Diffuse Light Docsity.com Diffuse light is the light that is absorbed by a surface and is reflected in all directions Docsity.com The regardless of the direction from which we view an object with a stationary diffuse light source on it, the brightness of any point on the surface will remain the same Docsity.com Unlike ambient light, the intensity of diffuse light is directional and is a function of the angle of the incoming light and the surface Docsity.com This type of shading is called Lambertian shading after Lambert's cosine law, Docsity.com Diffuse light decreases as the angle between the light vector and the surface normal increases. Docsity.com Figure 2 shows the intensity of reflected light as a function of the angle between the vertex normal and the light direction. Docsity.com i; = (nel }(Mt 4 CH) $4] The equation for calculating diffuse lighting is Docsity.co The problem with just diffuse lighting is that it's independent of the viewer's direction Docsity.com Thus as we change the viewing angle to a vertex, the vertex's diffuse light value never changes Docsity.com We have to rotate the object (change the normal direction) or move the light (change the light direction) to get a change in the diffuse lighting of the object Docsity.com Figure 4: When diffuse and ambient terms are combined, you get more detail and a more natural- looking scene. The final color is the combination of the ambient and diffuse colors. Docsity.com Specular Light Docsity.com Specular light is the light from a light source that is reflected by a surface and is reflected in such a manner that it's both a function of the light's vector and the viewer's direction. Docsity.com Phong's Specular Light Equation Docsity.com Warnock [WARNOCK 1969] and Romney [ROMNEY 1969] were the first to try to simulate highlights using a cos n (θ ) term. Docsity.com But it wasn't until Phong Bui- Tong [BUI 1998] reformulated this into a more general model that formalized the power value as a measure of surface roughness that we approach the terms used today for specular highlights Docsity.com Figure 6: The relationship between the normal n, the light vector l, the view direction v, and the reflection vector r. Docsity.com RECAP The traditional approach in real-time computer graphics has been to calculate lighting at a vertex as a sum of the ambient, diffuse, and specular light. Docsity.com ® Bele) Were) At] Let's take a look at the individual parts of the traditional lighting pipeline. Docsity.com Ambient Light Docsity.com Figure 1: Ambient light provides illumination, but no surface details. Docsity.com i; = (nel }(Mt 4 CH) $4] The equation for calculating diffuse lighting is Docsity.co Diffuse light shading brings out some > details Bele) Were) At] Ambient and Diffuse light together give a much better shading Docsity.com Phong's equation for specular lighting is \ . a eee l= (m.Qs.)(rs y) 3 (Phong) ® Bele) Were) At] Viewpoint n Light Computer Graphics Lecture 29 Docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved