Skip to content

ellishg/rust-raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-raytracer

Build Status

A final project for Stanford's CS248 http://cs248.stanford.edu/winter20.

scene This 1024x1024 image with about 2.3 million triangles was rendered with 16 samples per pixel in about 39 seconds (generating the BVH tree took about 27 seconds) on a 4 core i5-6600K CPU. Thanks to the Stanford Computer Graphics Laboratory for providing these models at https://graphics.stanford.edu/data/3Dscanrep.

Running

Use cargo to build, test, and run the code. For optimal performace, use the release build. The following command will render a basic scene to out.png with size 1024x1024.

#cargo run --release -- <args>
cargo run --release -- -f out.png -w 1024

To print useful timing information, set the environment variable RUST_LOG.

RUST_LOG=debug cargo run --release

Testing

cargo test

TODO

  • Move structs into their own files
  • Lights
    • Ambient
    • Point
    • Cone
    • Directional
  • Shadows
    • Soft shadows
    • Correct shadows from transparent surfaces
  • Objects
    • Sphere
    • Plane
    • Triangle
    • Triangle Meshes
      • BVH
        • Parallelize
  • Materials
    • Flat
    • Phong
    • Reflective
    • Transparent
    • Texture
      • Super sample texture
  • Tracing
    • Anti-aliasing
    • Focus blur
  • Threads

About

Another raytracer written in rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages