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.
Next related
Ruby raytracer on M1
While doing something else than I was planning to, I accedentally came back to the raytracer I once wrote in Ruby, and decided that the important thing just now is to benchmark my MacBook Pro M1 against those old results. I guess this will actually be Ruby 3 on M1 vs Ruby 2 on i7, because time happened.
Previous related
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.
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.