https://github.com/zheoni/ray-tracing
Ray Tracing in One Weekend implementation in Rust
https://github.com/zheoni/ray-tracing
ray-tracing raytracer raytracing raytracing-in-one-weekend raytracing-one-weekend rust
Last synced: 2 months ago
JSON representation
Ray Tracing in One Weekend implementation in Rust
- Host: GitHub
- URL: https://github.com/zheoni/ray-tracing
- Owner: Zheoni
- Created: 2020-12-02T22:06:01.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-30T04:29:10.000Z (over 4 years ago)
- Last Synced: 2025-01-20T06:23:59.380Z (4 months ago)
- Topics: ray-tracing, raytracer, raytracing, raytracing-in-one-weekend, raytracing-one-weekend, rust
- Language: Rust
- Homepage:
- Size: 12.2 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ray Tracing in One Weekend in Rust
This is my [Ray Tracing in One Weekend](https://raytracing.github.io) implementation using Rust.
I also improved the render times by paralelizing the code and added a CLI.
This is the render that it produces by default:

Other examples:

More of them are in the [images](./images) folder.
## CLI
```
Ray tracing renderer 0.1.0
Zheoni
Ray Tracing in a Weekend implementation in RustUSAGE:
ray-tracing [FLAGS] [OPTIONS]FLAGS:
--avoid_bvh Avoid to build a BVH with all the objects. May be faster to render a simple scene.
-d, --debug Increases the logging level.
-h, --help Prints help information
--plain_ppm Use plain ppm format, enconding the image into an ASCII ppm file.
--stdout Returns the image via the standard output, not saving it to a file.
-V, --version Prints version informationOPTIONS:
--aspect Aspect ratio of the image. Format: / e.g. "16/9"
-F, --format Explicitly select image format, if not given it's inferred from output file
extension.
--resolution Vertical resolution of the image
-o, --output File to output to.
--raydepth Maximum ray depth. More depth, more reflects and refractions but more computation.
--spp Samples per pixel. More samples, less noise but more computation.
-j, --threads Number of worker threds to use. Defaults to the number of physical cores available.ARGS:
[possible values: spheres, bouncing_spheres, checker_ground, checker_spheres, perlin_spheres, earth,
black, simple_light, cornell_box, cornell_smoke, final_scene]
```## Other repos
- [cbiffle/rtiow-rust](https://github.com/cbiffle/rtiow-rust) has helped me to achieve a much faster aabb hit function.
- [skyzh/raytracer.rs](https://github.com/skyzh/raytracer.rs) has helped me with the memory layout without so many references, using generics.