Skip to content

🎨✨ A weekend-initiated project. Create .gif using the Ray Tracing.

License

Notifications You must be signed in to change notification settings

grishy/rust-raytracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Ray Tracer

Weekend project to learn Rust by implementing a ray tracer. The project is based on the book Ray Tracing in One Weekend. The book is a great introduction to ray tracing and the code is written in C++. Also I after finishing the book I found the Rust version of the book.

Additional features

  • Multithreading
  • Render to PNG
  • Capability to render a sequence of images
  • Progress bar

Result

Final scene (GIF)

Final scene gif

Parameters for GIF
Parameter Value
Image size 600x337
Samples per pixel 200
Max depth 20
Frames 88
CPU (Macbook 2019 i9) 16
Render time 4h 40m 30s

Final scene png

Result

Render scene

❯ cargo run --release
   Compiling rust-raytracing v0.1.0
    Finished release [optimized] target(s) in 1.69s
     Running `target/release/rust-raytracing`
⠄ [00:02:05] [########################>--------------------------] 440371/810000 (2m)

How to generate GIF

To generate a GIF from a sequence of images, you will need to install gifski. You can do this with the following command:

❯ brew install gifski
❯ gifski -o render.gif render/image_*.png

License

© 2024 Sergei G.
This project is GPL-3.0 licensed.

About

🎨✨ A weekend-initiated project. Create .gif using the Ray Tracing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages