In this workshop, you will implement a non-physically based path tracer that runs on your graphics card in real time.
The final result of the workshop should look similar to the image below:
While the path tracer will not be physically based, its implementation will include a proper Monte Carlo estimator to help evaluate the light transport equation.
The provided starting code is written in a way that allows you to further expand on the material presented in the workshop. Possible extensions include:
- Adding new shapes
- Implementing physically correct specular reflections using different BRDFs
- Experimenting with advanced sampling or lighting models
Three requirements must be met before you can run the application:
- Your GPU (either discrete or integrated) must support Vulkan 1.3.
→ Read more here - You must have Python installed.
→ Verify by runningpython -vin your terminal. - You must download the Slang compiler.
Create a folder anywhere on your computer — this will be the workspace where you store everything related to this workshop.
- Download the Slang compiler for your operating system from the official Slang release page.
- Extract the downloaded zip file, preferably to the same folder where you will later extract the workshop executables.
To run the application, you need to download the precompiled executables I have prepared for you.
- Navigate to the release page of this repository and download the
build-xxxarchive for your operating system. - Extract the downloaded zip file to the folder you created earlier.
- Verify that the program is running correctly by double-clicking the executable
RaytracingInOneHour, or by running one of the following commands in your terminal:
# For Linux
./RaytracingInOneHour
# For Windows
RaytracingInOneHourWait a bit, and then a window should open where you will see the following:
That’s it!
For advanced users, you can also build this application from source.
All libraries are statically linked and compiled from source, including the Vulkan headers.
The project uses Volk to provide a lightweight and efficient Vulkan loader that automatically handles function pointer management and simplifies Vulkan initialization.
Building from source gives you full control over the renderering engine located in RenderingEngine.h/cpp including adding new UI elements or more advanced usage of Vulkan.
- recursinvly clone the repo
git clone https://github.com/wpsimon09/Ray-Tracing-In-One-Hour.git --recursive
- create build folder
mkdir build
cd build- configure cmake
Linux
cmake .. -DCMAKE_BUILD_TYPE=ReleaseWindows
cmake .. -DCMAKE_TOOLCHAIN_FILE=../toolchain-windows.cmake -DCMAKE_BUILD_TYPE=Release- build
cmake --build . --config Release -j 14
