A multi-threaded ray-tracing engine in C++20, written using this book for inspiration and the theory behind the ideas.
A 1920×1080p scene with 487 spheres, and 500 samples per pixel.The above picture was rendered on my machine, which has an i5-1135G7 processor with 4 cores (with SMT, so 8 logical cores). It took 36 mins 13 secs to render the image.
- A C++20 compliant compiler
- GCC >= 11 or MSVC >= 19.30 should do.
- CMake
- Clone the repository.
- You can clone the repo by running
git clone https://github.com/wermos/Celerity.git
.
- You can clone the repo by running
- Run CMake on the repository.
- Run
cmake -S. -Bbuild -G[generator]
.- If you are on Linux, then you can ignore the
-G
flag (as in, not use it at all) or just use-G"Unix Makefiles"
. (Since this is the default, both variants have the same behavior.) - If you are on Windows (with Visual Studio, presumably), you can use
"Ninja"
or"Visual Studio 16 2019"
in place of[generator]
. - If you pass in nothing, then CMake tries to use NMake as the generator.
- For more help, you can visit the CMake docs.
- If you are on Linux, then you can ignore the
- To pass in a specific build type, you can append
-DCMAKE_BUILD_TYPE=[type]
to the above command. The choices for[type]
are the default ones available for any CMake project:Debug
,Release
,RelWithDebInfo
, andMinSizeRel
. - Run
cmake --build build
.- On Linux, you can also append
-- -j<num>
to the end of the above command, to run the build on<num>
cores. For example,
cmake --build build -- -j4 # for 4 cores
- On Linux, you can also append
- Run
- Run the executable.
- The executable will be in
build/Celerity/
. The name of the executableCelerity
(Linux) orCelerity.exe
(Windows).
- The executable will be in
- After running, the program saves two images called
pic.jpg
andpic.png
to the current working directory.