This is a raytracing engine written in C++.
- Sphere
- Plane
- Triangle
- Phong
- Matte
- Cosine
- Point light
- Ambient light
- Spot light
- Perspective camera
- Parallel camera
- Simple sampling
- Regular sampling
- Random sampling
- Jittered sampling
- Uniform grid
- Bounding volume hierarchy
- C++ compiler
git clone
cd raytracer
./run.bat buildName
g++ raytracer.cpp tracer/*.cpp cameras/*.cpp geometry/*.cpp lights/*.cpp materials/*.cpp samplers/*.cpp acceleration/*.cpp utilities/*.cpp world/*.cpp build/"build%source_file%".cpp -o a.exe
./a.exe
The raytracer will output a ppm file in the raytracer folder. To convert the ppm file to a png file, run the following command:
python convert.py $source_file
The following image was rendered using the following settings:
- 1000 x 1000 resolution
- Jittered sampling
- 25 samples per pixel
- Grid acceleration structure
- Perspective camera
- Phong material
by running the following command:
./run.bat BabarAzam
The following image was rendered using the following settings:
- 400 x 400 resolution
- Simple sampling
- 1 sample per pixel
- No acceleration structure
- Perspective camera
- Cosine material
by running the following command:
./run.bat HelloWorld