Ray tracing implementation in three languages: C++, Python, Rust. I follow Peter Shirley's Ray Tracing trilogy.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
Gökmen Görgen 726d8e3d97 add background feature for ray_color. 1 year ago
.github add funding file. 2 years ago
assets update asset for rayt-cpp. 1 year ago
rayt-cpp new structure. 1 year ago
rayt-python add missing inplace arithmetic operators. 2 years ago
rayt-rust add background feature for ray_color. 1 year ago
.gitignore rename project, remove itertools. 2 years ago
LICENSE.md add license for rayt-cpp 2 years ago
LICENSE_rayt-cpp.md add license for rayt-cpp 2 years ago
README.md new structure. 1 year ago
config.toml dos2unix. 2 years ago

README.md

RAYT

Ray Tracing codes. I follow Peter Shirley's Ray Tracing trilogy. The goal is to have the same output in three languages; C++, Python, and Rust.

Build C++ Project

One Weekend:

Next Week:

CMake will generate makefiles for your operating system. If you didn't use CMake before, take a look at the documentation to learn how to build a C++ project. Example usage:

cd rayt-cpp
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build && cmake --install build && strip build/rayt_*
./build/one_weekend > rayt_cpp_one_weekend.ppm
./build/next_week > rayt_cpp_next_week.ppm

For Windows use Visual Studio with C++ build tools directly.

Performance status (image width is 600px):

time ./bin/one_weekend > rayt_cpp_one_weekend.ppm

Scanlines remaining: 0
Done.

real    0m21.853s
user    0m21.582s
sys     0m0.011s

Build Rust Project

I'll add a screenshot when the Rust project is ready.

cargo build --release
strip target/release/rayt_*  # for linux and macos
./target/release/one_weekend > rayt_rust_one_weekend.ppm
./target/release/next_week > rayt_rust_next_week.ppm

Performance status (image width is 600px):

time ./target/release/rayt > image.ppm

Scanlines remaining: 0
Done.

real    0m51.454s
user    0m26.004s
sys     0m1.428s

Build Python Project

I tested the project using the latest stable version of Python (3.8).

cd rayt-python
pip install -r requirements.txt
python setup.py build_ext --inplace
python -m rayt_python.main > image.ppm

For development:

pip install -r requirements-dev.txt
python -m scalene rayt_python/main.py --html --outfile scalene.html
python -m pytest -s
python -m pytest -s -k test_subtraction

Performance status (image width is 300px):

time python -m rayt_python.main > image.ppm

Scanlines remaining: 1
Done.

real    5m34.828s
user    63m33.183s
sys     0m3.051s