Skip to content

viktorku/wort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WORT - a Week(end) Of Ray Tracing

This is yet another implemention of the Ray Tracing in One Weekend tutorial/book. The original implementation is in C++ so I translated the code in a hopefully idiomatic Rust, which I also learned in parallel.

A bunch of balls

Some extra features:

  • Usage of simple framebuffer window (minifb) to draw the image and experiment with different diffuse methods via key presses
  • Single threaded C++ implementation by Shirley is slightly faster (15.8s with either -02 or -03 optimizations) than single threaded Rust (18.6s) on the final random scene
  • Rayon parallelizes tracing the ray along the X/width axis and gained 3.7-4 times speed up (5.3s)
  • Rust lacks reflection so string-enum mapping and iterating had to be done via a custom crate strum

Running notes:

  • Don't bother running the tracer in debug mode, as it's painfully slow
  • Image output can be a PPM file or a framebuffer window
  • There are a couple of CLI arguments, run --help to see or check the code out

TODO:

  • Reported rendering time above is on 2015 MacBook Pro, but add times for i9-9900K (should be ~4 times faster?), and M1 silicon for an interesting comparison
  • There are many parameters (such as camera positioning, FOV, dielectrics reflectivity, object poses, etc.) that can be made configurable via the framebuffer window or the CLI
  • Implement the second and third part
  • Play around with AVX/SIMD?
  • ...

About

a week(end) of ray tracing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages