This 2nd installment in a series of tutorials on the ray tracing framework Visionaray explains the reasoning behind custom intersectors and how to program with them.
Ray tracing algorithms typically implement two consecutive phases: intersection testing and shading. During intersection testing, rays are tested for intersection with the scene geometry. If the geometry with the minimum distance between ray origin and intersection position was found, shading is performed to find the color reflected from that position towards the eye, based on material and lighting properties. …
Today I’m going to demonstrate how one can write a simple 3-D direct volume renderer using C++-11 and the ray tracing kernel framework Visionaray (https://github.com/szellmann/visionaray). We’ll implement volume rendering with coherent ray packet traversal that is optimized with SSE 4.1.
Let’s start with a few includes:
Visionaray is based on a simple metaphor: kernels describe what a single ray (or a packet of rays) does, while schedulers describe how primary rays are generated. Visionaray comes with a set of builtin kernels and some schedulers which can be used to execute a ray tracing algorithm…