Git Product home page Git Product logo

tray_rust's Introduction

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.

tray_rust's People

Contributors

kant avatar llogiq avatar twinklebear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tray_rust's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.