An open API service indexing awesome lists of open source software.

https://github.com/allenvox/ray-tracer

Basic C++ ray tracing program based on book series by Peter Shirley
https://github.com/allenvox/ray-tracer

cmake cpp cpp17 geometry graphics path-tracing raytracer raytracing

Last synced: 11 months ago
JSON representation

Basic C++ ray tracing program based on book series by Peter Shirley

Awesome Lists containing this project

README

          

# C++ Ray Tracer
![GitHub last commit](https://img.shields.io/github/last-commit/allenvox/ray-tracer)


Build: `cmake --preset release && cmake --build --preset release`

Run: `build/release/bin/raytracer > image.ppm`
### Example images:
###### Final scene with focus distance & camera positioning ([commit](https://github.com/allenvox/ray-tracer/tree/2baa99a02b6073fc3e651fb14606d44bfc3f6687))
![10](.github/examples/10.jpg)
###### Hollow glass sphere (left) ([commit](https://github.com/allenvox/ray-tracer/tree/1d11530e40c7f58e5b4530ce218c51b08c3e0353))
![9](.github/examples/9.jpg)
###### Fuzzed metal material on center (fuzz 0.3) & left spheres (fuzz 1.0) ([commit](https://github.com/allenvox/ray-tracer/tree/4912576d73af69980262939c4155eb8ec0b7e925))
![8](.github/examples/8.jpg)
###### Metal & Lambertian sphere materials ([commit](https://github.com/allenvox/ray-tracer/tree/98c76d39869021d35ad793d6fbec21954396d843))
![7](.github/examples/7.jpg)
###### Diffuse sphere with no shadow acne ([commit](https://github.com/allenvox/ray-tracer/tree/8bf74026fe05d62e404a57aa4a8a90bd79651bcd))
![6](.github/examples/6.jpg)
###### Diffuse sphere ([commit](https://github.com/allenvox/ray-tracer/tree/12f7e0e9929322bcb155471779ce426db12a5cd1))
![5](.github/examples/5.jpg)
###### Sphere with antialiasing ([commit](https://github.com/allenvox/ray-tracer/tree/580a02dffecbed07362f1b632d736bb5a16b3565))
![4](.github/examples/4.jpg)
###### Gradient sphere in a world with ground & sky ([commit](https://github.com/allenvox/ray-tracer/tree/266b1e426b31ecb2b4cb4b20fe7b1e9b47c199e9))
![3](.github/examples/3.jpg)
###### Simple sky ([commit](https://github.com/allenvox/ray-tracer/tree/b34d3c142cb37209aaaf5b242efd3f728f1a0066))
![2](.github/examples/2.jpg)
###### Simple gradients ([commit](https://github.com/allenvox/ray-tracer/tree/8744b4b397affb99e536a181ebe93696a20f33f1))
![1](.github/examples/1.jpg)