As previously seen in Chapter 2, Creating Your First Shader, the #pragma directive is used to specify which surface function to use. Choosing a different lighting model works in a similar fashion: SimpleLambert forces Cg to look for a function called LightingSimpleLambert(). Note the Lighting at the beginning, which is omitted in the directive.
The Lighting function takes three parameters: the surface output (which contains the physical properties such as the albedo and transparency), the direction the light is coming from, and its attenuation.
According to Lambertian reflectance, the amount of light a surface reflects depends on the angle between the incident light and surface normal. If you have played pool billiards, you ...