Procedural Shading
The Images
No extras image (Checkboard on floor):

Checkerboard on everything:

Noise shader on spheres:

Turbulence shader on back wall:

Texture mapped floor:

Discussion
The checkerboard shader is implemented by calling the project method of each object to determine where on the object the intersection occurs. The return value from this is a 2-tuple with values between 0 and 1. This value and the frequency of the checkerboard are used to determine what the color of each checker space is. The noise and turbulence shaders are implemented using the noise and turbulence functions from cgkit. The texture mapping is done using the same project method to determine where in the texture the needed texel is.
The Code
- raytracer.py
- The ray tracing application that iterates through the pixels. Also contains classes to model the scene and output.
- primitives.py
- The primitives (shapes, lights, ray, colors).
- shaders.py
- The shaders