Kyle Boss and I made a phong shader for spheres. You set up lights through the command line.
-ka r g b / -kd r g b / -ks r g b
Specifies ambient, diffuse, and specular color coefficients in RGB (floats between 0 and 1) respectively.
Sets specular coefficient.
-pl x y z r g b / -dl x y z r g b
Adds a point or directional light of RGB at (X, Y, Z).
Turns on the ‘toon’ flag, which implements cel shading by creating rough pixel thresholds.
Turns on the ‘save’ flag, which saves image to current directory as img.bmp. Always put this flag at the end of the command line.
The Cool Stuff
The Required Stuff
1 Light with Diffuse Shading
1 Directional Light with Specular Shading
1 Point Light with Specular Shading
Diffuse & Specular Shading
A Study in Pink: example
Saving is accomplished by adding a "-s" in the end of the command line, which will write to img.bmp. For example, below is the original .bmp written by our program.