| Crates.io | rustytracer |
| lib.rs | rustytracer |
| version | 0.1.0 |
| created_at | 2025-08-30 09:53:32.520718+00 |
| updated_at | 2025-08-30 09:53:32.520718+00 |
| description | A high-performance ray tracer with multiple preset scenes |
| homepage | |
| repository | https://github.com/Aditya-1304/raytracer |
| max_upload_size | |
| id | 1817473 |
| size | 67,858 |
A high-performance ray tracer built in Rust featuring 8 stunning preset scenes, BVH acceleration, and parallel processing for fast renders.
Blazing Fast: BVH acceleration + Rayon parallelization
8 Preset Scenes: From classic to ultra-high quality renders
Advanced Materials: Realistic glass, metal, and diffuse surfaces
Interactive Menu: User-friendly scene selection interface
High Resolution: Up to 1400px with 300+ samples per pixel
Parallel Processing: Multi-threaded rendering for maximum performance
Optimized: 10x+ faster rendering compared to single-threaded implementations
# Clone the repository
git clone https://github.com/Aditya-1304/raytracer.git
cd raytracer
# Run with optimizations (strongly recommended!)
cargo run --release
# Follow the interactive menu to select and render scenes
BVH Acceleration: Spatial partitioning reduces intersection tests from O(n) to O(log n)
Parallel Processing: Rayon-powered multi-threading across CPU cores
Advanced Materials:
Camera Effects: Depth of field, anti-aliasing, adjustable field of view
Optimized Sampling: Importance sampling for realistic lighting
src/
├── main.rs # Interactive CLI interface
├── scenes.rs # Scene definitions and generators
├── camera.rs # Camera with depth of field
├── material.rs # Material implementations
├── bvh.rs # BVH acceleration structure
├── vec3.rs # 3D vector math
├── ray.rs # Ray definition and operations
├── sphere.rs # Sphere primitive
├── color.rs # Color handling and gamma correction
└── rtweekend.rs # Utilities and random number generation
.ppm files in the project directoryconvert image.ppm image.jpg (ImageMagick)src/scenes.rs to create your own scenesContributions are welcome! Here are some ideas:
git clone https://github.com/Aditya-1304/raytracer.git
cd raytracer
# Run tests
cargo test
# Check code formatting
cargo fmt --check
# Run clippy for linting
cargo clippy
Acknowledgments
This project demonstrates the power of Rust for high-performance graphics programming, combining memory safety with zero-cost abstractions to achieve both correctness and speed.
This project is licensed under the MIT License - see the LICENSE file for details.
Aditya Mandal