Smallpt is a path tracing renderer written by Kevin Beason in 99 lines of C++. Let’s reimplement smallpt using the Visionaray ray tracing template library.

- We’ll use Visionaray’s builtin naive path tracing kernel for global illumination rendering.
- Our implementation will be cross platform and can run on NVIDIA GPUs and on CPUs.
- Since Visionaray is a template library, it is trivial to provide two implementations using either 32-bit single precision or 64-bit double precision floating point arithmetic.
- The tutorial is kept very simple by intention. It shows how to use Visionaray’s basic types and algorithms, and how to put a…

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:

`#include <visionaray/camera.h>`

#include <visionaray/cpu_buffer_rt.h>

#include <visionaray/scheduler.h>

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…