Super Sampling Anti-Aliasing
Remember the smoothly shaded teapot? Still looks pretty rough with all the jaggies and speckles. Well, with the shiny new multi threading support it’s actually feasible to add some image quality improvements.
[1] pry(#<GlisteningRuby::DSL::Scene>)> render verbose:true, threads:8
Setup time: 0.564666 s
Render time: 73.976052 s
Total time: 74.540718 s
Same scene, but rendered with 3x Super Sampling Anti-Aliasing. Nine times as many rays to cast into the world should mean nine times as long rendering time, but the good news is that with heavier rendering, the threading overhead is offset slightly so we only pay 7.5x time penalty for 9x processing.
[2] pry(#<GlisteningRuby::DSL::Scene>)> render verbose:true, threads:8, ssaa:3
Setup time: 0.5425 s
Render time: 561.85829 s
Total time: 562.40079 s
Next related
Soft Shadows
With the recent anti-aliasing feature enables, the image quality is pretty good, but the shadow edges are still too hard to be realistic, because the light source is still just a point without surface area.
Previous related
Threaded rendering
Shaved another 30% off rendering time by inlining and some more caching, but it seems like I’m reaching the limit of what I can get out of a single thread.
Light and Magic
Made some refinements to lighting. Originially there was only a point light without distance falloff, which is not an accurate light model in any case. The light inside the room lights the entire world, all the way to the horizon.
Cache is King
Cut teapot rendering time in half with some clever caching.