用 Rust 抄 Ray Tracing in a Weekend
git clone https://github.com/oopsno/toy-raytracer-rust.git
cd toy-raytracer-rust
cargo run --release
toy-raytracer-rust 0.1
USAGE:
toy-raytracer-rust [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-a, --aspect-ratio <aspect-ratio> [default: 1.5]
-i, --image-width <image-width> [default: 1200]
-m, --max-depth <max-depth> [default: 50]
-n, --num-threads <num-threads> [default: 0]
-o, --output <output> [default: output.png]
-s, --samples-per-pixel <samples-per-pixel> [default: 500]
-s, --scene <scene> [default: weekend]
scene 取值可为以下五项之一
diffuse-spheres
Image 10: 带有半球散射的漫反射球体shiny-metal
Image 11: 闪亮金属fuzzy-metal
Image 12: 模糊金属hollow-glass-spheres
Image 16: 中空玻璃球weekend
最终场景
以默认参数渲染的上述场景位于 artifacts
目录下。