Saturday, November 1, 2008

Lights & Rays by Phong

At first, I was quite angry at this Phong fella and all this lighting and shading algorithm. But then I started reading about him in wikipedia...

Oooh... Dr Phong. I will study your algo and make the darn lights lit!

Basic Light Model

surfaceColor = emissive + ambient + diffuse + specular


All about lights:

  • diffuse = object_diffuse * light_diffuse / (distance_to_object * angle)
  • ambient = object_ambient * light_ambient
  • emissive = object_emissive
  • specular = object_specular * light_specular : with size of reflection determined by object_specular_power and distance_to_object and the position of the reflection based on angle.
  • final_color = (diffuse + ambient + emissive) * object_texture + specular : with the sum of diffuse, ambient and emissive capped at (1.0, 1.0, 1.0)
From: neurobs.com

BASICS DETAILS OF LIGHTING:
http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter05.html

No comments: