| Cornell Box |
|---|
![]() |
- Unbiased Monte Carlo Path tracer.
- Lambertian, Dielectric and Mirror BRDF.
- Antialiasing via jittered supersampling.
The project uses CMake (minimum version 3.9) for generating build files. For building the project:
- Clone the repository (or download the zip file)
git clone https://github.com/vermaditya1999/PathTracer.git - With CMake it generally recommended to create an out-of-source build, and so do we. Create a folder
buildin the root directorycd PathTracer mkdir build cd build - By default, CMake will build in Release mode (optimized). To build in Debug mode set the
-DCMAKE_BUILD_TYPE=Debugflag with thecmakecommand.cmake .. - Now run
maketo create the executablemake
An executable PathTracer should be created in the build directory.
Run the program using ./PathTracer while being in the build directory.
The scene will be rendered as an image.ppm file in the build directory.
- Antialiasing: Change
jg_sizevariable in the functionvoid RealisticRenderer::render(Scene scene)in filesrc/RealisticRenderer.cpp - Samples per pixel: Change
n_samplesvariable in the functionvoid RealisticRenderer::render(Scene scene)in filesrc/RealisticRenderer.cpp
There are two sample scenes provided in the code:
- Luminaire on the top of diffused ball. [SCENE ID = 1]
- Cornell Box. [SCENE ID = 0]
The scenes can be switched by changing the scene_id variable in src/main.cpp.
