RayTracer.ml
RayTracer.ml copied to clipboard
🌈 Path tracer implemented in OCaml based on "Ray Tracing in One Weekend"
RayTracer.ml
🌈 Path tracer implemented in OCaml based on "Ray Tracing in One Weekend"
Features
- Defocus Blur
- Motion Blur
- Bounding Volume Hierarchies
- Textures
- Checker Texture
- Instance Translation & Rotation
Usage
To set up the environment, run the following command (Ubuntu)
apt install opam
opam init
opam install dune
To render the scene, run the following command
make
, and the rendered scene will be stored in ./output/
Screenshots
Ray Tracing in One Weekend
Result: (Intel i7-8750H CPU @ 2.20GHz) (Random Scene)
Ray Tracing finished in 1474.2 s.
Random Scene | Sphere Sea (hd) |
---|---|
![]() |
![]() |
Ray Tracing: The Next Week
Result: (Intel i7-8750H CPU @ 2.20GHz)
Bouncing spheres (2071.7 s) | Texture (531.9 s) | Light (1654.9 s) |
---|---|---|
![]() |
![]() |
![]() |
Empty Cornell box (437.5 s) | Cornell box with two blocks (958.3 s) | Standard Cornell box (1165.1 s) |
---|---|---|
![]() |
![]() |
![]() |