https://github.com/spicycactuar/raytracingoneweekend
My take on the Ray Tracing in One Weekend book.
https://github.com/spicycactuar/raytracingoneweekend
computer-graphics cpu-raytracing learning-by-doing
Last synced: 8 months ago
JSON representation
My take on the Ray Tracing in One Weekend book.
- Host: GitHub
- URL: https://github.com/spicycactuar/raytracingoneweekend
- Owner: SpicyCactuar
- License: mit
- Created: 2022-05-15T23:24:58.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-20T22:45:33.000Z (over 1 year ago)
- Last Synced: 2025-03-30T00:44:22.274Z (about 1 year ago)
- Topics: computer-graphics, cpu-raytracing, learning-by-doing
- Language: C++
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Ray Tracing in One Weekend

Implementation of the [Ray Tracing in One Weekend](https://raytracing.github.io/books/RayTracingInOneWeekend.html) exercise. This codebase includes some naming and convention differences compared to the textbook implementation. The overall structure remains almost untouched therefore readers of the book should be able to navigate it with ease.
Different results can be achieved by tweaking the scene in `main.cpp`.
# Building & Running
The project uses [CMake](https://cmake.org/), set to C++17, as its build system. The structure is [CLion](https://www.jetbrains.com/clion/) based, however its usage is not mandatory.
The following instructions assume CMake is already installed. The commands are meant for a Unix based OS, nevertheless they should run on Windows with the appropiate tweaks.
Running the following command will create a `$PATH_TO_PROJECT/cmake-build-release` folder:
`$PATH_TO_CMAKE -DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - Unix Makefiles" $PATH_TO_PROJECT`
To then build build the release flavor:
`$PATH_TO_CMAKE --build $PATH_TO_PROJECT/cmake-build-release --target RayTracingOneWeekend`
This will create a `cmake-build-release/RayTracingOneWeekend` executable. Finally, render the ray traced scene to an example `~/Desktop/image.ppm` file:
`$PATH_TO_PROJECT/cmake-build-release/RayTracingOneWeekend > ~/Desktop/image.ppm`
Users of CLion can simply compile using its tools. Do note that prior to compiling users should create a **Release** profile as the IDE only provides a default **Debug** one. Alternatively, the embedded version of CMake can be referenced by pointing the command to `$PATH_TO_CLION/bin/cmake/$OS/bin/cmake`.