6
votes

I am wondering about the most accurate way to calculate the shadow generated from several different light sources and ambient light. Ambient light is light that exists in the entire 'world' with the same intensity and no particular direction, and diffused lighting is the lighting that occurs due a direct lighting from a point light source.

Given that Ka is the coefficient for the surface ambient reflectivity, Ia is the intensity of the ambient light, Kd is the surface diffuse reflectivity, Ip1 is intensity of the the first (accordingly) point light source, N is the surface normal, and L1 is the light (of the first source accordingly) direction.

According to my reference material the intensity of the color at the spot should be:

I=Ka.Ia+Kd(Ip1(N.L1)+Ip2(N.L2)) where '.' is the dot product.

But according to my understanding the real light intensity should do some sort of average between the light sources and not just add them up, so that if there are only two light sources the equation should look like:

I=Ka.Ia+Kd(Ip1(N.L1)+Ip2(N.L2))/2

and if there are 3 light sources, but the third is blocked and doesn't light the surface directly then:

I=Ka.Ia+Kd(Ip1(N.L1)+Ip2(N.L2))/3 (so that if there is a place where all 3 lights contribute it would be lighten brighter.

Am I right at my assumption?

3

3 Answers

6
votes

Well, no, light shouldn't be averaged. Think about it. If you have just one powerful light source, and you add another, very faint light, would the color of the object be diminished? For example say the powerful light has intensity 10, the color (presuming the direction is perpendicular to the normal, and no ambient light, for simplicity sake) would be 10. Then after you add the second faint light, with say intensity 0.1 the color would be (10 + 0.1) / 2 which is 5.05. So adding more light would make the object seem darker. That doesn't make sense.

4
votes

In the real world, light adds. It should in your ray tracer, too.

1
votes

Luminance is not a linear function of light intensity. In other words, two identical light sources aimed at one spot are not perceived as twice as "bright" as one light. (Brightness is an ambiguous term -- luminance is a better term that means radiance weighted by human vision).

What you can do as an approximation to correcting the image to be viewed on your monitor, knowing intensities of various pixels, is called gamma correction.