Sunday, February 01, 2009

Lighting Effect (Phong Model)

My implematation of Phong Lighting Model, refer to  Cg Tutorial Chapter 5, composed in FxComposer.

Below three pictures are captured in FxComposer. The Light is located at left-front-below position from the elephant, Light's direction to directly toward the elephant.
  1. Point Light, No Light Decay.

  2. Point Light, with Light Decay. The plane behind elephant is darker than front ones , as the Light is affected by distance between Light position and Vertex position. Refer to "Distance Attenuation" section of the tutorial.

  3. Spot Light, with Light Decay. Refer to "Adding a SpotLight Effect" section. This effect is more interesting than above two :)

No comments: