An open API service indexing awesome lists of open source software.

https://github.com/cestef/raytracing-rust

Just a basic multithreaded raytracer
https://github.com/cestef/raytracing-rust

Last synced: 12 days ago
JSON representation

Just a basic multithreaded raytracer

Awesome Lists containing this project

README

          

# Raytracing in Rust

This is just a raytracer written in Rust. It is based on the book [Ray Tracing in One Weekend](https://raytracing.github.io/books/RayTracingInOneWeekend.html) by Peter Shirley.

## Features
- Shapes:
- [x] Spheres
- [x] Planes
- Materials:
- [x] Lambertian
- [x] Metal
- [x] Dielectric
- [x] Antialiasing
- [x] Positionable camera
- [x] Depth of field
- [x] FOV
- [x] Gamma correction
- [x] Triangle mesh support
- [x] Multithreading
- [x] Load balancing
- [x] Beautiful CLI
- [x] Multiple file formats (JPG, PNG, PPM)
- [x] Bounding Volume Hierarchies Optimisation
- [ ] Rendering to a window
- [ ] Textures
- [ ] Importing models
- [ ] Lights

## Running

The help page can be accessed by running the program with the `--help` flag.

```bash
cargo run --release -- --help
```

This will print the following:

```
$ cargo run --release -- --help

A raytracer written in Rust.

Usage: ray-tracing-rust [OPTIONS]

Options:
-w, --width [default: 2560]
-h, --height
-a, --aspect-ratio [default: 16/9]
-s, --samples [default: 100]
-t, --threads [default: 8]
-o, --output [default: output.ppm]
-f, --fov [default: 90]
--open
-h, --help Print help
-V, --version Print version
```

Example:

```bash
cargo run --release -- -w 1920 -h 1080 -s 1000 -t 8 -o output.ppm
```