Unit 4: Shading

Β 
Disc
LJ
Β 
Β 
  • Shading in CG is computing the pixels colors
    • It is very much about lighting
Β 

Shading and Lighting

  • Given the surface normal is and the light direction vector is
notion image
notion image
  • By rotating the surface, we will have the angle and which we can use to calculate the light intensity
notion image
notion image
notion image
Β 

Lambertian (Diffuse) Material

  • This way, we can model a relation between the light intensity and the surface color property given that is the original surface color
  • By adding another factor which represents the amount of light coming from the light source, we can have a full formula to calculate the pixel color and it is called Lambertian (Diffuse) Material
notion image
πŸ“Œ
In this model, the reflection happens in all directions in equal amount

Phong Specular Reflections

notion image
Β 
  • Reflections viewing depends on the viewer direction
  • It is one of specular reflection models
notion image
  • Given the perfect reflection direction vector and the viewer direction vector
  • Properties:
    • Material props:
      • the specular reflection color
      • the shininess of the material (opacity of shininess)
    • the light intensity
  • The phong material model is defined according to the formula
  • The formula of the perfect reflection direction
notion image
Β 

Phong Material Model

  • It’s defined by combining Lambertian (Diffuse) Material model and Phong Specular Reflections
notion image
  • When we want to implement it, we should consider eliminating the negative values of cosine. So finally it becomes:
notion image
notion image
Β 
29:00
Β 

Resources

Disc