Skip to content

Twinklebear/tray_rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tray_rust - A Toy Ray Tracer in Rust

tray_rust is a toy physically based ray tracer built off of the techniques discussed in Physically Based Rendering. It began life as a port of tray to Rust to check out the language but has surpassed it in a few ways. The renderer is currently capable of path tracing, supports triangle meshes (MTL support coming soon), and various physically based material models (including measured data from the MERL BRDF Database). tray_rust also supports rigid body animation along B-spline paths and distributed rendering.

Build Status

Running

Running and passing --help or -h will print out options you can pass to the renderer which are documented in the help. For the more complicated use cases I hope to do some write ups and guides on how to use them (e.g. distributed rendering, animation) but this may take a while. I strongly recommend running the release build as the debug version will be very slow.

Building Your Own Scenes

To position and animate objects, the camera and so on the Blender plugin is the easiest to use. However the plugin is still in development and missing some features like setting materials, changing light properties and such so you'll still currently need to do those by hand in the exported JSON file. For materials take a look at the materials documentation for lights you'll likely just want to change the emission color which is an RGB color plus a strength term.

Start at the documentation for the scene module, there are also a few example scenes included but not all the models are provided. From a clean git clone you should be able to run cornell_box.json and smallpt.json. I plan to add some more simple scenes that show usage of other features like animation to provide examples. The rigid body animation feature is relatively new though so I haven't had time to document it properly yet.

Documentation

Documentation can be found on the project site.

TODO

Sample Renders

In the samples the Buddha, Dragon, Bunny and Lucy statue are from The Stanford Scanning Repository. The Rust logo model was made by Nylithius on BlenderArtists. The Utah teapot used is from Morgan McGuire's page and the monkey head is Blender's Suzanne. I've made minor tweaks to some of the models so for convenience you can find versions that can be easily loaded into the sample scenes here, though the cube model for the Cornell box scene is included. The materials on the Rust logo, Buddha, Dragon and Lucy are from the MERL BRDF Database. Models for running the scenes and links to model sources can be found here.

Render times are formatted as hh:mm:ss and were measured using 144 threads on a machine with four Xeon E7-8890 v3 CPUs. The machine is an early/engineering sample from Intel so your results may differ, but massive thanks to Intel for the hardware! Some older renders are shown as well without timing since they were run on a different machine.

Some more sample renders can be found here. I've also used tray_rust for the past two years at Utah's Teapot Rendering Competition, view my animations for 2015 and 2016. The latter was made using the Blender plugin for modeling and contains more complex motion and sequences.

Model gallery

1920x1080, 4096 samples/pixel. Rendering: 00:43:36.45.

Rust Logo with friends, disk

1920x1080, 4096 samples/pixel. Rendering: 00:49:33.514.

About

A toy ray tracer in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages