Advanced Computer Graphics: Laboratory Project

<< PREV | INDEX | NEXT >>

Task 1C: Calculate the Specular Lighting Term

Solution

float intensity = pow(max(0, dot(r, directionToEye)), materialShininess);
	
return light0specular * materialSpecular * intensity;

The following images show a visualization of the specular lighting term (Figure 4) and the model under complete illumination (Figure 5):

Figure 4: Visualization of specular lighting term.
Figure 5: Resulting image with full lighting equation enabled.

This completes Part 1, move on to Part 2.


<< PREV | INDEX | NEXT >>