https://github.com/nwtgck/ray-tracing-iow-rust
Ray Tracing in One Weekend written in Rust
https://github.com/nwtgck/ray-tracing-iow-rust
parallel parallel-computing rayon raytracer rust tray-tracing
Last synced: 8 months ago
JSON representation
Ray Tracing in One Weekend written in Rust
- Host: GitHub
- URL: https://github.com/nwtgck/ray-tracing-iow-rust
- Owner: nwtgck
- License: mit
- Created: 2019-06-26T16:41:41.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-11T21:03:20.000Z (over 3 years ago)
- Last Synced: 2025-04-19T17:26:07.117Z (about 1 year ago)
- Topics: parallel, parallel-computing, rayon, raytracer, rust, tray-tracing
- Language: Rust
- Homepage:
- Size: 13.3 MB
- Stars: 82
- Watchers: 5
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ray-tracing-iow
[](https://circleci.com/gh/nwtgck/ray-tracing-iow-rust)
Ray Tracing in One Weekend written in Rust

## Features
* Written in Rust
* Parallel processing by [Rayon](https://github.com/rayon-rs/rayon)
* Animation
* Reproducible random generation
## Usage
### One image generation
Create one image.
```bash
cargo run --release -- image.ppm
```
### Animation generation
Here is very small video generation.
```bash
# Generate .ppm files
cargo run --release -- --width=60 --height=40 --anime-out-dir-path=my_anime
# Create anime.mp4
cd my_anime
ffmpeg -i anime%08d.ppm -c:v libx264 -vf fps=25 -pix_fmt yuv420p anime.mp4
```
### Other options
```txt
ray-tracing-iow 0.1.0
Ryo Ota
Ray Tracing in One Weekend in Rust
USAGE:
ray-tracing-iow [OPTIONS] [file]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--anime-dt Animation dt [default: 0.03]
--anime-max-t Animation max time [default: 6.0]
--anime-min-t Animation minimum time [default: 0.0]
--anime-out-dir-path Animation output directory
--height Image height [default: 400]
--min-float Minimum float number [default: 0.001]
--n-samples Number of samples [default: 10]
--random-seed Random seed [default: 101]
--width Image width [default: 600]
ARGS:
Output file path
```
## Related projects
Here are related projects.
* [iyahoo/clj-ray-tracing](https://github.com/iyahoo/clj-ray-tracing) (Clojure)
* [petershirley/raytracinginoneweekend](https://github.com/petershirley/raytracinginoneweekend) (C++)
* [nwtgck/ray-tracing-iow-scala](https://github.com/nwtgck/ray-tracing-iow-scala) (Scala)