Simple Real-time ASCII raytracer in terminal, written in Rust with animation support.
- Real-time 3D scene rendering in ASCII
- Animation support (orbiting cameras, pulsing objects, moving lights)
- Customizable character palette for different effects
- Automatic adaptation to terminal size
cargo build --releasecargo run --release# Set resolution
cargo run --release -- --width 120 --height 60
# Change FPS
cargo run --release -- --fps 30
# Use custom palette
cargo run --release -- --palette " .:-=+*#%@"cargo bench| Scene | Time per frame | FPS |
|---|---|---|
| Simple scene | ~30 µs | ~33,000 |
| Screensaver (9 objects) | ~118 µs | ~8,400 |
| Full animation cycle | ~108 µs | ~9,300 |
The project tries to follow clean architecture principles:
src/scene/- geometry, camera, animationssrc/renderer/- ASCII renderingbenches/- performance benchmarks
Options:
-p, --palette <PALETTE> ASCII palette (lightest to darkest) [default: ASCII70]
-f, --fps <FPS> Frames per second (0 = single frame) [default: 24]
-W, --width <WIDTH> Width in characters
-H, --height <HEIGHT> Height in characters
-h, --help Display help
- Default (ASCII70):
`.-':_,^=;<>+!rc*/z?sLTv)J7(|Fi{C}fI31tlu[neoZ5Yxjya]2ESwqkP6h9d4VpOGbUAKXHm8RD#$Bg0MNWQ%&@ - Simple:
.:-=+*#%@ - Blocks:
░▒▓█
MIT