Home

Awesome

RTOW-OptiX (my OptiX version of Pete's 'Ray Tracing in One Weekend' series)

"Deprecation Notice"

Dear reader/user - this project was once written as a sample code for OptiX 5; however, the OptiX API has since underdone major and significant changes that make this code no longer work with any publicly available or supported form of OptiX. For a more modern version of this sample I would encourage you to have a look at my "OWL" project (https://github.com/owl-project/owl), which aims at providing some more OptiX-5/OptiX-6 like "wrappers" around today's much more low-level OptiX-7 API. In particular, there are actually multiple different versions of this particular "RTOW" Sample in OWL, including both a direct port of this sample (in https://github.com/owl-project/owl/tree/master/samples/cmdline/s05-rtow) as well as ones with extra boxes, with multi-GPU support, etc.

Overview

This project aims at providing a Optix Version of the 'final chapter' example in Pete Shirley's "Ray Tracing in one Week-End" series.

If you haven't read that book yet, you should (have a look here: https://www.amazon.com/Ray-Tracing-Weekend-Minibooks-Book-ebook/dp/B01B5AODD8 ).

For reference, Pete's original C++ code is here: https://github.com/petershirley/raytracinginoneweekend

Note this project covers only the final chapter example; Pete and I are in parallel working on a more complete OptiX-version of Pete's entire book series, but that might take a while yet.

Some random notes

Prerequisites

To buidl this project, you need

Building

This project is built with cmake. On linux, simply create a build directory, and start the build with with ccmake:

mkdir build cd build cmake .. make

Assuming you have nvcc (CUDA) in your path, and have set a OptiX_INSTALL_DIR environment variable to point to the OptiX install dir, everything should be configured automatically.

On windows, you'll have to use the cmake gui, and make sure to set the right paths for optix include dirs, optix paths, etc.

Running

Just run the ./finalChapter binary (finalChapter.exe on windows). This should render a finalChapter.ppm image. To change image resolution (default 1200x800), number of samples (default 128), etc, just edit FinalChapter/finalChapter.cpp.

Code Overview

I'll write a more "tutorial" - style version that explains the high-level concepts in a separate place (likely my blog, on http://ingowald.blog).

ChangeLog