CS6620 Advanced Graphics 2 University of Utah
Prof: Peter Shirley Ray Tracing Sem: Spring 2002



Assignment 02a - Ambient Study

I have a question about ambient lighting.

In my raytracer for assignment 2, I put in a constant ambient term that was added to the color of every surface, like so:

I = Ca + Id * Kd * N dot L
(I used Ca = [0.2,0.2,0.2])

A couple of people asked me if I had implemented specular lighting after looking at my homework. I said no, but it got me to thinking that my implementation was probably "wrong" (if anything with a hacked ambient can be called "right"). Anyway, I took another (more critical) look at the pictures, and indeed, in some of them, there are bright spots that could be construed as specular highlights.

The highlights are caused by the color saturating because of the added Ca.

Check out the difference between images (4) and (6) below for a visual description of what I'm talking about. Image (4) has clipped colors, whereas image (6) does not.

It seems to me that there are a lot of things that could be done to "fix" this. For example, I could have a global ambient intensity/color, that is modulated by the diffuse surface color:

I = Ga * Kd + Id * Kd * N dot L
Or, the same thing but each surface could have an ambient reflectivity:
I = Ga * Ka + Id * Kd * N dot L
Or, an ambient intensity/color per light:
I = Ia * Ka + Id * Kd * N dot L
Or, even more complex, an ambient base color and the above:
I = Ga + Ia * Ka + Id * Kd * N dot L
So, here (finally) are my questions:

Is one of these (or another) the "right" answer? That is, is one the accepted method to use?

Assuming I use one of these, do I need to scale the diffuse component (or the total?) to keep the colors in range so I don't saturate into a "highlight"?

Or, are these diffuse "highlights" acceptable?

Should I do away with ambient altogether?

Am I just smoking crack?



Ambient (no lights)
Ambient + Diffuse
I = Ca + Kd * N dot L
Ca = [0.2, 0.2, 0.2], 0 lights

(1)
I = Ca + Kd * N dot L
Ca = [0.2, 0.2, 0.2], 1 light

(2)


I = Ia * Ka + Kd * N dot L
Ka = Kd, Ia = [0.2, 0.2, 0.2], 0 lights

(3)
I = Ia * Ka + Kd * N dot L
Ka = Kd, Ia = [0.2, 0.2, 0.2], 1 lights

(4)


I = Ia * Ka + Kd * N dot L
Ka = Kd, Ia = [0.0, 0.0, 0.0], 0 lights

(5)
I = Ia * Ka + Kd * N dot L
Ka = Kd, Ia = [0.0, 0.0, 0.0], 1 lights

(6)


Questions/comments to nate@pobox.com.



January 2002
© Nate Robins