package tiny_libs

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module RaytraceSource

Sourcetype rgb = float * float * float
Sourcetype light =
  1. | Sun of {
    1. towards : Vec3.t;
    2. color : rgb;
    }
  2. | Lamp of {
    1. position : Vec3.t;
    2. radius : float;
    3. color : rgb;
    }
  3. | Spot of {
    1. position : Vec3.t;
    2. aim : Vec3.t;
    3. angle : float;
    4. falloff : float;
    5. color : rgb;
    }
Sourcetype scene = {
  1. camera : Camera.t;
  2. solids : Solid.t list;
  3. lights : light list;
  4. ambient : float;
  5. background : int;
}
Sourcetype algorithm =
  1. | Ray_casting
  2. | Lambert
  3. | Shadow_rays
  4. | Whitted
  5. | Soft_shadows
  6. | Path_tracing
Sourceval algorithms : algorithm list
Sourceval latest : algorithm
Sourceval default_algorithm : algorithm
Sourceval name : algorithm -> string
Sourcetype acceleration =
  1. | Brute_force
  2. | Bvh of Bvh.split
Sourcetype options = {
  1. algorithm : algorithm;
  2. epsilon : float;
  3. acceleration : acceleration;
  4. depth : int;
  5. cutoff : float;
  6. samples : int;
  7. seed : int;
}
Sourceval default_options : options
Sourceval camera_ray_through : Camera.t -> width:int -> height:int -> float -> float -> Ray.t * float * float
Sourceval camera_ray : Camera.t -> width:int -> height:int -> x:int -> y:int -> Ray.t * float * float
Sourceval nearest : ?min_t:float -> ?max_t:float -> Ray.t -> Solid.t list -> (float * Solid.t) option
Sourceval shadowed : epsilon:float -> Solid.t list -> Vec3.t -> light -> bool
Sourcetype world
Sourceval world : ?options:options -> scene -> world
Sourceval reflect : Vec3.t -> Vec3.t -> Vec3.t
Sourceval refract : Vec3.t -> Vec3.t -> eta:float -> (Vec3.t * float) option
Sourceval schlick : n1:float -> n2:float -> float -> float
Sourceval trace : world -> Ray.t -> min_t:float -> max_t:float -> int
Sourceval tests : world -> int
Sourceval boxes : world -> int
Sourceval secondary_rays : world -> int
Sourceval saved_rays : world -> int
Sourceval pixel : world -> width:int -> height:int -> x:int -> y:int -> int
Sourceval render : ?options:options -> scene -> width:int -> height:int -> Rgba_image.t
Sourceval passes : int list
Sourcetype progress
Sourceval start : ?options:options -> scene -> width:int -> height:int -> progress
Sourceval advance : progress -> rays:int -> unit
Sourceval finished : progress -> bool
Sourceval rays_shot : progress -> int
Sourceval pass : progress -> int
Sourceval world_of : progress -> world
Sourceval picture : progress -> Rgba_image.t