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.
|
2 years ago | |
---|---|---|
.github | 2 years ago | |
assets | 2 years ago | |
rayt-cpp | 2 years ago | |
rayt-python | 2 years ago | |
rayt-rust | 2 years ago | |
.gitignore | 2 years ago | |
LICENSE.md | 2 years ago | |
LICENSE_rayt-cpp.md | 2 years ago | |
README.md | 2 years ago | |
config.toml | 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