Skip to content

Commit

Permalink
Create build config. Using dune (and opam)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyob committed Jul 4, 2020
1 parent 459edba commit 2560f57
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# OCaml-Raytracer
A simple OCaml Raytracer
A simple OCaml Raytracer based on my notes from the Cambridge Graphics course and the ''Fundamental of
Computer Graphics'' book.

A functional realization of a raytracer taking advantage of
OCaml's module system and algebraic data types; in an attempt
to generalize the interfaces of components within a raytracer.

Some features of the ray tracer:
- Surfaces: Spheres and planes.
- Materials: Lambertian, Metallic and Dielectric materials.
- Camera: Defined using a viewer, view plane and projection.
- Gamma correction.

Images are stored in a PPM format, with `image.ml` ported from FoCS tick 5 (Thanks [Anil](https://github.com/avsm)!).

An example scene (specified by Peter Shirley's mini-book series [Raytracing in One Weekend](https://raytracing.github.io/)):
![Scene](./image.ppm)

4 changes: 4 additions & 0 deletions bin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(public_name main)
(name main)
(libraries raytracer))
2 changes: 2 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(lang dune 1.2)
(name ocaml_raytracer)
5 changes: 5 additions & 0 deletions dune-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(lang dune 1.2)
(context default)
(env
(dev
(flags (:standard -w -6))))
5 changes: 5 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name raytracer)
(libraries base stdio))

(include_subdirs unqualified)

0 comments on commit 2560f57

Please sign in to comment.