https://github.com/hlustikp/raytracing-example
Example for a 0 lib c++ implementation of raytracing
https://github.com/hlustikp/raytracing-example
cpp cpp23 raytracing
Last synced: 8 months ago
JSON representation
Example for a 0 lib c++ implementation of raytracing
- Host: GitHub
- URL: https://github.com/hlustikp/raytracing-example
- Owner: HlustikP
- License: mit
- Created: 2023-11-14T17:09:40.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-11-15T19:47:43.000Z (over 2 years ago)
- Last Synced: 2025-02-04T13:03:14.311Z (over 1 year ago)
- Topics: cpp, cpp23, raytracing
- Language: C++
- Homepage:
- Size: 401 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C++23 Raytracing Example
This is a simple raytracing example based on the book [Ray Tracing in One Weekend](https://raytracing.github.io/books/RayTracingInOneWeekend.html) by Peter Shirley et al.
It uses modern c++ features from the 17, 20 and 23 standards
such as `std::optional`, `Class template argument deduction (CTAD)`
`std::expected` and more.
## Prerequisites
- Cmake 3.26 or higher
- Ninja build system
- C++23 compatible compiler (`msvc 19.36+` or `gcc 13+`)
Refer to the [C++23 status page](https://en.cppreference.com/w/cpp/compiler_support#C.2B.2B23_features)
for a list of compilers that support C++23.
## Build
### Generate build files
Windows:
```bash
cmake --preset win-x64-release
```
Linux:
```bash
cmake --preset linux-x64-release
```
For a list of all available presets run:
```bash
cmake --list-presets
```
### Compile and link
```bash
cd ./bin/(win-x64-release|linux-x64-release)
ninja
```
### Run
```bash
./raytracing(.exe)
```