Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nrc/ray
Rust and JS ray tracers
https://github.com/nrc/ray
Last synced: 11 days ago
JSON representation
Rust and JS ray tracers
- Host: GitHub
- URL: https://github.com/nrc/ray
- Owner: nrc
- Created: 2016-07-30T02:50:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-12T07:43:15.000Z (almost 8 years ago)
- Last Synced: 2024-10-28T20:47:07.446Z (about 2 months ago)
- Language: Rust
- Homepage:
- Size: 301 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Toy ray-tracer
JS/canvas version in top directory, Rust version in `ray` sub-directory.
Supports:
* spheres and triangles
* anti-aliasing
* point lights (hard shadows)
* sphere lights (soft shadows)
* reflections
* attenuation of lightingThe Rust version has been a bit of a playground for optimisation, check the commit log for the various things I've tried out. Blog post coming soon.
Example image:
![balls](example.png)
To run the Rust version:
```
cargo run --release -- out.png
```To run the JS/canvas version - open `ray.html` in your browser (and wait, or tweak the settings so it renders in a reasonable amount of time).