All the things
One limitation so far was that there could only be one surface in a scene. To get past that, we add the Group
meta-surface, that contains a number of surfaces, and intersects with rays on their behalf. To make this actually useful, surfaces also need transforms to translate them out of their shared origin.
To keep the simplified unit sphere intersection formula, the surface is not actually transformed, but instead the intersecting ray is inversely transformed to shift its frame of reference to the surface.
Next related
Messy shadows
Apparently, I messed up some more vector algebra. Ray / surface hits currently record the event in surface space, which works just fine for shading a unit sphere still positioned at origin. When we transform things around, and try to cast the secondary shadow rays, it becomes painfully obvious that surface space and world space no longer coincide.
Previous related
Light and Magic
The next natural step after getting basic shading to work is to have actual light sources, that can be tinted and positioned in the scene.
Working camera
So yesterday’s attempt at capturing an image didn’t turn out so well, because I messed up the camera, or rather the vector algebra behind everything. When I realized what I had done, I instantly remembered that similar lesson from last year; because points have w=1, while vectors have w=0, almost all vector operations will get messed up by the extra 1, if you accidentally use a point instead. Or vice versa.
Actual pixels
First actual image generated, using a “camera light”. The shading is too dark, for some reason I can’t figure out at the moment, so I guess tomorrow will be more of a debugging session than new feature creation.