This is a raytracer built from scratch in pure Rust, capable of rendering any scene in either raytracing mode or using Jensen's advanced Photon Mapping technique. It doesn't use any libraries, not even OpenGL.
- Directional, positional and ambient lights
- Reflection, refraction and transparency using Fresnel equations
- Quadratic surfaces and shapes (Quadrics)
- Constructive Solid Geometry (CSG)
- Texturing for planar, spherical and cuboid surfaces including normal maps
- Jensen Photon mapping, including caustics
With Rust installed and FFmpeg in your PATH, simply run cargo run --release
.
By default, it will render the scene in scene2.txt
. You can specify another scene to render using cargo run --release -- scene.txt
for example.
For simple scenes, the number of photons shot can be reduced in src/environments/photon_scene.rs
to speed up the render. Inversely, the number can be increased for more realistic lighting.
FFmpeg is used to convert textures from PNG to PPM, and the output from PPM to PNG.