NOTE: The development of this renderer lives on in a different code-base now: zyg!
sprout is a small raytracing renderer written in C++. I work on it to learn about, and experiment with computer graphics, focused mainly on physically based rendering, and global illumination.
The overall architecture is heavily inspired by PBRT, while the implementation details differ more or less strongly in various places.
At the moment the default integrator is a uni-directional path tracer with forward prediction and multiple importance sampling. A combination of a rudimentary light tracer and photon mapper can assist with caustic paths. Mesh lights and image-based lights are supported.
The default material is inspired by the Disney and Unreal 4 material models. It uses a combination of the Disney Diffuse BRDF and GGX with adjustable roughness and metallic parameters. Optionally subsurface scattering can be enabled. Most parameters like color, roughness, and normals can be controlled via texture mapping. Specialized materials for e.g. metal and glass are also available.
There is support for a few built in shapes (sphere, disk, plane…) as well as triangle meshes. Those shapes are shared between solid objects, volumetric objects, and light emitters.
Support for heterogeneous participating media and subsurface scattering is based on the spectral tracking technique described here.
A render is configurable by json files which describe the different parts of the scene (shapes, lights, material parameters etc.) as well as camera and renderer settings. For performance reasons, images and meshes are stored in a binary format.
A few images rendered with sprout can be found in the gallery.
mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release ../source make
All source files needed to build the project are included in the repository and organized with cmake.
sprout needs a compiler with (partial) c++20 support.
On Linux it should work with Clang 11 and libstdc++ 11 or higher. It should also build with GCC 11 or higher. On Windows it should work with Visual Studio 2019 or a newer version.
I try to keep the number of required dependencies reasonably low in this project. At the moment there are two/three. All of them are included in the repository directly with all necessary source code.
- Miniz for encoding/decoding PNG images and decompressing gz archives
- RapidJSON for parsing json files
- (Zstandard as an additional compression option; this is not essential and can easily be disabled)
If you have FFmpeg installed you can export animations to mp4, but it is neither required to build nor to run.
Additionally, the repository includes a slightly modified copy of the Hosek sky model. The main changes are a conversion from double
to float
type, optimizations of pow() with a constant exponent, and modifying the solar radius to better match various sources quoting this number.