I have here an equation.
where I is the RGB color to be displayed for a given point on the
surface,kd is the RGB diffuse reflectance at the point,ka is the
RGB ambient illumination, l is the unit vector in the direction of
the light source, and n is the unit surface normal vector at the point.
From what I can guess. kd would be the models diffuse color or map. ka is the ambient light. l is the light vector. and n is the models normal.
What I don't know is what a comma does. How do you read (0, L.n)?
And what does it mean by kd max?
My best approximation is
Is this correct?
Replies
I = kd * ka + kd * max(0, dot(L, n))
Max means to take the larger of the two values, 0 or the dot product of the light and normal vectors.
Here the comma is used to separate two values in the max function.
This lighting model is usually handled by the engine though, is there a reason you're putting this into your shader?
So its not "kd max" but "max(0, L.N)"
So the "max(0," is effectively clamping the L.N from -1...1 to 0...1.