Day 22, Murky waters
Remember when we introduced shadows? Casting a ray towards the light and see if any object is in the way. Well, that’s a huge shortcut, because transparent materials. Well, why not fix that by taking another huge shortcut, and add a toggle to exclude certain objects from shadow ray casting?
Next related
Day 23, Cubes
All core functionality is in place, so time for more shapes. First up is cubes, the volume contained by three perpendicular pairs of parallel planes, and aligned with the axes. So planar ray intersection with each one, and pick the snuggest fit to intersect the cube. Not quite pixel ready yet, so something for tomorrow.
Previous related
Day 18 – 21, Feverish Shiny Glass Pixels
Day 17, Transparency and Refraction
No new pixels today, because implementing transparency and refraction turned out to be quite a lot of work. So far I’ve made all the cases where nothing happens, and the refracted ray would be black.
Day 16, Halfway there
Fitting that the halfway point would be about reflections. Pagewise we’re more than halvway through the book, but I’m guessing that there will be plenty of things to do for the remaining 15 days. There’s still the going back and replacing the homebuilt algebra code with stdlib, if nothing else.