# Light question

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

## Recommended Posts

Hi All, I got question, how to calculate the Final Object colour = object color * Light_Ambient (If only got ambient light) It is, object color * Light_Ambient or object color + Light_Ambient / 2 to get the Final Object colour ? (256, G, B) * (128, G, B) = 32768(>256) (256, G, B) + (128, G, B) /2 = 192 ???

##### Share on other sites
You add together ambient, diffuse, and specular. So, yes, you add it, not multiply.

##### Share on other sites
For most lighting models, you multiply the material properties by the respective light properties, and add the products together in some fashion.

[Edited by - Mastaba on November 7, 2006 10:09:09 PM]

##### Share on other sites
You should note that colors are usualy changed to be in a 0 to 1 range when doing the math.

##### Share on other sites
FinalColor = Color_object*( AmbientLight + DiffuseLight + SpecularLight + EmissiveLight )

##### Share on other sites
Yeah u usually clamp it to be between 0 and 1;

Steve-O

##### Share on other sites
Quote:
 Original post by eliukYeah u usually clamp it to be between 0 and 1;

Not so much these days - HDR lighting requires that you don't clamp the result.

1. 1
2. 2
Rutin
22
3. 3
4. 4
JoeJ
16
5. 5

• 14
• 29
• 9
• 11
• 11
• ### Forum Statistics

• Total Topics
631775
• Total Posts
3002278
×