afnanenayet / weekend-ray-tracer

This is a ray tracer written in Rust designed from "Ray Tracing in One Weekend"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weekend ray tracer

Build Status

Synopsis

This is a toy ray tracer written in Rust, following "Ray Tracing in One Weekend"

Pictures

Spheres shaded by their normals with no antialiasing

Spheres, shaded by their normals, with no antialiasing

Spheres shaded by their normals with antialiasing

Spheres, shaded by their normals, with antialiasing

Mirror spheres

Mirror spheres, no gamma correction

diffuse sphere

Lambertian spheres, with gamma correction

lambertian, mirror spheres

Lambertian and mirror spheres

Sources

I used these sources for reference and inspiration to help me with this project. For the more core ray-tracing part, I used the classic book Ray Tracing in One Weekend. I also referenced a tutorial on writing a ray tracer in Rust, since I wanted to make sure I was using proper Rust conventions when writing this.

For the rendering side, I referenced the classic pbrt book, as well as information from Dartmouth's CS87 rendering course, taught by Wojciech Jarosz.

I'm also using nalgebra as my linear algebra library.

Usage

To run tests:

cargo test

To build:

RUSTFLAGS="-C target-cpu=native" cargo build --release

To run:

RUSTFLAGS="-C target-cpu=native" cargo run --release

In order for the renderer to be able to output images, you will need to create the output folder, otherwise it will panic and fail.

mkdir renders

About

This is a ray tracer written in Rust designed from "Ray Tracing in One Weekend"

License:MIT License


Languages

Language:Rust 100.0%