Skip to content
/ rayst Public

Rust port of the postcard-sized raytracer from Andrew Kensler

License

Notifications You must be signed in to change notification settings

djeedai/rayst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rayst

LICENSE

Rust port of the postcard-sized raytracer from Andrew Kensler distributed by Pixar at GHC 2018. The initial code written in C/C++ is described by Fabien Sanglard in a detailed blog post.

Result image, 256 samples per pixel

Disclaimer: This Rust port produces the same image as the original C/C++ code, which has been optimized for source code size and is therefore highly de-optimized in terms of performance. On top of that, this is a naive Rust port and my first ever Rust program, so it likely contains extra inefficiencies. I have no intention of even trying to optimize the raytracer, but feedback on the Rust code itself is encouraged!

Usage

As with the original code, this generates a PPM image on the standard output, best redirected to a file:

rayst > pixar.ppm

After that the image can be opened with any tool supporting the PPM format, like Gimp for example.

Earlier version

Andrew Kensler wrote an earlier postcard-sized raytracer before the one ported here, and presents some details about it in a blog post along with some more explanations and a commented code version. Several ports of that earlier code are mentioned, including a Rust port by Huon Wilson.

About

Rust port of the postcard-sized raytracer from Andrew Kensler

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages