Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 963 Bytes

README.md

File metadata and controls

18 lines (11 loc) · 963 Bytes

Ray Tracing in One Weekend in C++

Output from ray tracing

This is a ray tracing implementation in C++, pretty much a re-implementation of an earlier attempt in Go

All implementation was pretty much the result of me manually typing out everything in the minibook Ray Tracing In One Weekend, but with an attempt at introducing some modern C++ features.

Running the ray tracer

make
./raytracer-cpp > img.ppm

The program outputs portable pixmap format to the console/stdout, and so, the > symbol writes the output to a file.

Rendering a whole 1024 by 576 image takes around an 4 and half minutes on my 2020 M1 MacBook Pro. If you want something rendered quicker, change the nx and ny variables in main(), in main.c to something smaller than 1024 by 576 (perhaps 200 and 100, respectively).