A dumb raytracer written in Rust

Genesis

A long time ago, I found a computer-generated forest background on reddit. I wanted to generate by myself this kind of image and decided few months ago to write a ray tracer with that goal!

Going back to doing maths in 3d, solving complex systems, triangulate matrices was hard!!

Rust

I wrote the raytracer in Rust and making run in parallel was amazingly easy with rayon-rs. Since rendering can be quite long, I’ve added a way to stop resume rendering.

Colors

I wanted to give my rendering an aspect of sunset, during the golden hour but I couldn’t find any interesting litterature on it. I decided that rays from the sun would just mix the objects colors with a bit of orange and in the end, I like the result.

Some objects

The Forest

I used a Monte Carlo method to generat my forest and here’s the result:

The Forest 4k version

While browsing the internets, I went to that page that showed the image below (Credits: Photo by Desmond Simon on Unsplash, but couldn’t find it there).

Actual forest

My image is no too far from there, with its own style.

As usual, this is opensource and on github.