7sDream / remda

Learn Ray Tracing in One Weekend series using Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remda

Learn Ray Tracing in One Weekend series using Rust.

Yet another naive and pure software ray tracing renderer.

Render Result Examples

rendered image of RTOW's balls scene example rtow_13_1, 512 sample, 8 depth, 1920x1080, 8m30s

rendered image of RTNW's balls motion blur scene example rtnw_4_3, 1024 sample, 8 depth, 1920x1080, 22min

rendered image of RTNW's ball with noise texture scene example rtnw_7_4_2, 4096 sample, 8 depth, 1500x900, 15min

rendered image of RTNW's Cornell scene example rtnw_8_2, 10240 sample, 10 depth, 1000x1000, 1h20m

rendered image of RTNW's Cornel smoke scene example rtnw_9_2, 10240 sample, 10 depth, 1000x1000, 1h30m

rendered image of RTNW's final scene example rtnw_10, 10240 sample, 10 depth, 1000x1000, 2h30m

Current Progress

  • Ray Tracing in One Weekend
    • Basic types, Vec, Color, Ray, etc
    • Background/Sky
    • Sphere
    • Lambertian Material
    • Metal Material with Different Fuzz
    • Glass Material with Different Refractive
    • Pinhole Camera
    • Camera Defocus/Depth Field
    • (Extra) Parallelism (by using rayon)
  • Ray Tracing: The Next Week
    • Motion Blur
    • BVH(Bounding Volume Hierarchies)
    • Solid Textures
    • Perlin Noise
    • Image Textures
    • Rectangles
    • Lights
    • Cornell Box
    • Box
    • Instance Translation and Rotation
    • Volumes/Participating Media
  • Ray Tracing: The Rest of Your Life not started yet

Run

Remda is a library crate, but you can run built-in examples(from the book series) to try it.

Use cargo run --example to get examples list, then choose one to run.

For example, to get final scene in section 13.1 of Ray Tracing in One Weekend, run

cargo run --example rtow_13_1 --release

Wait about 1s(according to your machine's CPU performance), you will get a rtow_13_1.ppm in current dir, that's your result.

If you want a bigger and clear image, adjust height(), depth and samples() parameter in example source file and re-run.

You can also try other examples if you want.

PS: Pure software ray tracing takes a long time to render, be patient.

LICENSE

GPLv3

Except:

  • example/earth-map.png, download from NASA, fall in public domain.

About

Learn Ray Tracing in One Weekend series using Rust.

License:GNU General Public License v3.0


Languages

Language:Rust 100.0%