Ray Tracer - Part 3

Transformations, instancing and more.

Transformations and Instancing

Translation, scaling and rotation are implemented. I applied almost all transformations at the parsing stage in order to make rendering as fast as possible. Non-uniform scaling of the spheres is done at render-time by manipulating the ray, in order not to implement ellipse shape and its intersection tests etc.

killeroo_glass: 71.200 sec

killeroo_glass

skybox: 0.539 sec

skybox

horse: 0.184 sec

horse

horse_instanced: 0.285 sec

horse_instanced

Motion Blur

Motion blur is my favorite graphics effect ever! The first thing I do when I was a child was enabling Motion Blur from Video Settings, before starting to a game (ex: NFS Underground 2).

With multi-sampling, implementing linear motion blur is really easy. Giving a random time variable to each ray and implementing a time-location function for shapes are almost enough, if we have a proper multi-sampling ray tracer. Multi-sampling averages the color values for each ray with different time value, which creates the visual effect of motion blur.

cornellbox_boxes_dynamic: 60.200 sec

cornellbox_boxes_dynamic

cornellbox_dynamic: 55.500 sec

cornellbox_dynamic

Written on June 4, 2019