Posted on

Table of Contents

We can simplify the illumination of an object into three different types of lighting:

  • Specular highlights
  • Diffuse reflection
  • Ambient lighting

blinnphong

Local Shading

Considering a point on a surface, we can treat it as a very small flat surface with a normal vector N\textbf{N}. The incoming light is represented by vector L\textbf{L}, and the observer's viewpoint is represented by vector V\textbf{V}.

blinn_Vectors

Diffuse Reflection

In diffuse reflection, the energy of light received is influenced by the angle between the light direction and the surface normal.

Lambert's cosine law

cosθ=LN \cos{\theta} = \textbf{L}\cdot\textbf{N}

Lambert

Light Falloff

The principle of light flux conservation states that light intensity from a point source decreases with distance.

This means that the farther an object is from the source, the less intense the light per unit area. I(r)=I(1)/r2 I(r) = I(1)/r^2 falloff

Lambertian Shading

To combine the effects of diffuse and specular reflections, consider a coefficient kdk_d representing the absorption of specific wavelengths (colors) for the diffuse component. Ld=kd(I/r2)max(0,NL) L_d = k_d (I/r^2)\max(0,\textbf{N}\cdot \textbf{L}) In this model, the viewer vector V\textbf{V} does not influence the diffuse reflection because it is isotropic, meaning it reflects light uniformly in all directions.

Specular Highlight

When the viewer direction is very close to the direction of reflected light, specular highlights become visible.

specular

This is further analyzed by considering the half vector H\textbf{H}, which is the normalized vector halfway between the incoming light vector L\textbf{L} and the viewer vector V\textbf{V}. Specular highlights are more prominent when H\textbf{H} is aligned closely with the normal vector N\textbf{N}: H=V+LV+L \textbf{H} = \frac{\textbf{V}+\textbf{L}}{|\textbf{V}+\textbf{L}|}

Ls=ks(I/r2)max(0,NH)p L_s = k_s(I/r^2)\max(0,\textbf{N}\cdot\textbf{H})^p

Where ksk_s is the highlight coefficient, the power pp is the tolerance of highlight area. This formula highlights how specular reflections vary based on the material's properties and the relative positions of the light source, the observer, and the surface normal.

cosine

The larger pp we chose, the less angle tolerance we have to decide the specular area.

Ambient Light

Ambient lighting is indeed unique in that it does not depend on the direction of the light source or the viewing angle. It represents the base level of light present in a scene, simulating indirect light that is scattered and reflected by other surfaces in the environment.

We can simplify it to: La=kaIa L_a = k_aI_a Overall the Blinn-Phong Model: L=La+Ld+Ls=kaIa+kd(I/r2)max(0,NL)+ks(I/r2)max(0,NH)p L = L_a + L_d + L_s = k_aI_a + k_d(I/r^2)\max{(0,\textbf{N}\cdot \textbf{L})} + k_s(I/r^2)\max(0,\textbf{N}\cdot\textbf{H})^p