This is simple CPU raytracer. It is based on the book "Ray Tracing in One Weekend" by Peter Shirley. The code is written in C++ and only uses the standard library. The code is written in a way that it is easy to understand and modify. The code is not optimized for speed and is not meant to be used in production. It is meant to be used as a learning tool.
It consists in a raytracing library and a simple application that uses the library. The library is in the include/rt
folder and the application is in the apps
folder.
- Code coverage
- Review RT API
- Raytracing in One Weekend
- Raytracing the Next Week
- Raytracing the Rest of Your Life
- Adding support for other image formats
- BMP File Support
- Normal Map Rendering
- Depth Map Rendering
The library documentation can be built using Doxygen. The Doxygen will produce adocs
folder. The documentation can be built using the following command:
doxygen Doxyfile
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
The application can be run with the following command:
./raytracer
--seed=<SEED>
--width=<WIDTH>
--height=<HEIGHT>
--output=<OUTPUT>
--samples=<SAMPLES>
--bounces=<BOUNCES>
--render_type=[normal_map|depth_map]
The seed
argument is used to seed the random number generator. The width
and height
arguments are used to set the width and height of the output image. The output
argument is used to set the output file name. The samples
argument is used to set the number of samples per pixel. The bounces
argument is used to set the number of bounces per ray. The render_type
argument is used to set the type of render to produce.
There are a few optional arguments that can be passed to the application.
--max_depth=<MAX_DEPTH>
This argument is useful when --render_type=depth_map
is set. The max_depth
argument is used to set the maximum depth for the depth map. The default value is 1.
The following benchmarks were run on an Intel Core i7-7700K CPU @ 4.20GHz with 16GB of RAM.
Benchmark | Time |
---|---|
1 | 0.00 |
2 | 0.00 |
3 | 0.00 |
4 | 0.00 |
If you want to contribute to this project, please follow the following steps:
- Fork the project
- Create a new branch
- Make your changes
- Create a pull request
- Wait for the pull request to be reviewed and merged
This project is licensed under the MIT License - see the LICENSE file for details
If you have any questions, feel free to contact me via email.