# Light question

This topic is 5514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I got some questions about the equation below : Ambient = Material_Ambient * Light_Ambient Diffuse = Material_Diffuse * Light_Diffuse * Dot(Normal, LightDirection) 1)What is the different between Material_Ambient and Light_Ambient ? 2) Is it Object colour * Material_Ambient * Light_Ambient = Final Object colour (If only got ambient light)? 3) What is the different between Material_Diffuse and Light_Diffuse ? 4) Is it Light_Diffuse is the Intensity ? If so, why the Light_Diffuse * Dot(Normal, LightDirection)? Because the Dot(Normal, LightDirection) = 0.1 - 1. confuse ?? 5)Is it the point light, infinite light or spot light have to multiply the diffuse light in order to get the final light ? 6) Is it different between Diffuse light and diffuse refection ? 7)Here's the simplified lighting equation :- Color = Ambient + Diffuse + Specular + Emmisive Is it the equation correct ?If so, where is the point light, infinite light or spot light ? 8)intensity for a light is: light intensity * (normal vector DOT light vector) Is it correct ? Is it light intensity is a scalar ? If so, why have to multiply (normal vector DOT light vector), So become Scalar * (0.1 - 1) ?? 9) How the Ambient, diffuse, specular and emission(is it attribute of light)work with Infinite, Point, Spot light, Ambient light(is it light type) ? How they multiply to each other in order to get the final colour ? I quiet confuse with the 3D Light and shade. Hope you can understand my question. Thank You.

##### Share on other sites
Quote:
 1)What is the different between Material_Ambient and Light_Ambient ?

Material_Ambient is the material's ambient colour and Light_Ambient is the light's ambient colour. E.g. you may have a light with a white ambient colour and an object with a red ambient colour, this would give a red colour for the ambient term. If however you had a light with a blue ambient colour and a red object, it'd have a black ambient term, while an object with a blue ambient colour would show up blue.

Quote:
 2) Is itObject colour * Material_Ambient * Light_Ambient =Final Object colour (If only got ambient light)?

Material_Ambient effectively is the object colour so you'd need to take the object colour term from the equation.

Quote:
 3) What is the different between Material_Diffuse and Light_Diffuse ?

See 1)

Quote:
 4) Is it Light_Diffuse is the Intensity ? If so, why the Light_Diffuse * Dot(Normal, LightDirection)?Because the Dot(Normal, LightDirection) = 0.1 - 1.confuse ??

Light_Diffuse is the light's diffuse colour. The Dot(Normal, LightDirection) term alters the colour at that point of the object depending on the angle between the normal and the light, so if the light is directly over the normal it'd be brighter than if the light was off to the side. There should also be a max in there like this Max(Dot(Normal, LightDirection), 0). This means that when the surface is facing away from the light vector you don't get a negative diffuse term, it just blacks out.

Quote:
 5)Is it the point light, infinite light or spot light have to multiply the diffuse light in order to get the final light ?

All of these lights have the same equation really. It's just altering the way the light vector (pointing from where you're lighting to the light) is calculated. And with a spot light there's an extra term the cuts the light off after a certain angle (giving the spot light effect).

Quote:
 6) Is it different between Diffuse light and diffuse refection

Not entirely sure what you're asking here

Quote:
 7)Here's the simplified lighting equation :-Color = Ambient + Diffuse + Specular + EmmisiveIs it the equation correct ?If so, where is the point light, infinite light or spot light ?

Yes that's correct, with a spot light there'd be an extra term that would be 0 when the angle between the spot light's direction and the light vector goes past a certain value.

Quote:
 8)intensity for a light is:light intensity * (normal vector DOT light vector)Is it correct ? Is it light intensity is a scalar ? If so,why have to multiply (normal vector DOT light vector),So become Scalar * (0.1 - 1) ??

In the lighting equation you're using there is no intensity, you just have various colour values. You could say a light with colour (0.5, 0.5, 0.5) is a less intense one than one with (1.0, 1.0, 1.0)

Quote:
 9) How the Ambient, diffuse, specular and emission(is it attribute of light)work with Infinite, Point, Spot light, Ambient light(is it light type) ? How they multiply toeach other in order to get the final colour ?

In exactly the same way, see the above answers where I've given some more detail.

Remember lighting equations are only a model of the real world, in real life an object has just one colour, as does a light (well sort of). In the lighting model you're using here each light may have several different colours (e.g. ambient, diffuse, specular and emissive colours) as may every object.

##### Share on other sites
In OpenGL material properties are set using the glMaterial* set of functions, and can be changed on a per-vertex basis (I think you can use it inside glBegin()/glEnd() block, though it's hardly efficient, because these are expensive calls).
The light properties on the other hand, are changed by using the glLight* set of functions.

Let me give you an example, (however lousy :P). If you want to render a metallic object next to a plastic one, then you'd use different material properties for each of the objects. The first would have a high specular-component, for instance. You might also want a totally different colour. This should all be done with glMaterial*. Without material properties, you'd have to render the first object with one light setting, then change the lighting values before rendering the second object.
It just makes more sense to separate the two.

Hope I helped clear things up.

Thank you.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 11
• 15
• 21
• 26
• 11