I added depth of field to the camera class. There are two parameters that affect the depth of field using this interface; focal distance and lens radius.
The focal distance corresponds to the distance of the focal plane which will have an infinite depth of field and is the same as the pinhole camera. This means that objects at the focal distance will be in focus.
The lens radius corresponds the the aperture which samples are generated on. The larger the radius the more peturbed the ray is and gives a shallower depth of field.
Below the gifs show the affect of changing one of the parameters while keeping the other one fixed.
I have redone some of the geometry aspects of the rendering engine to allow for transformations and instancing by introducing the Primitive class, which I had for quite a while. I have also added two more analytic shapes Disc and Rectangle.
Some more revision for the graphics course. This time I created a software rasterizer using only the information and algorithms described in the lecture slides linked below. Its pretty slow.
In the slides it uses the shoelace algorithm for backface culling and z-buffer for visible surface determination. Below is a screenshot visualizing the depth values; smaller values means an object is closer.