A short-lived experiment with real-time raytring on the CPU, written in C++.

The idea was that one could use an adaptively tesselated screen space grid to only raytrace pixels that influenced the end result greatly, for example pixels along the edge of an object or edge of a region in shadow.

If the 4 corner pixels of a grid cell where different enough, the grid cell would be subdivided into 4 sub-cells that were evaluated further. Once a grid cell was deemed “good enough”, pixels still left inside the cell were colored using linear interpolation.

The inner workings of the algorithm is most visible in the first set of images in the gallery below: