GlomeTrace-0.3: Ray Tracing Library

Safe HaskellSafe-Inferred

Data.Glome.Trace

Synopsis

Documentation

data Shader t m ctxa ctxb Source

Constructors

Shader 

Fields

preshade :: ctxa -> Ray -> SolidItem t m -> Rayint t m -> ctxb
 
postshade :: ctxa -> ctxb -> m -> Ray -> SolidItem t m -> Rayint t m -> Int -> (ColorA, [t])
 
missshade :: ctxa -> Ray -> SolidItem t m -> (ColorA, [t])
 

data PacketColor Source

Result of tracing a packet of 4 rays at once.

Constructors

PacketColor !Color !Color !Color !Color 

trace :: ctxa -> Shader t m ctxa ctxb -> SolidItem t m -> Ray -> Flt -> Int -> (ColorA, [t], Rayint t m)Source

Given a scene, a shader, a ray, a maximum distance, and a maximum recursion depth, test the ray for intersection against the object within the scene, then pass the ray intersection to the shade routine (which may trace secondary rays of its own), which returns a color. For most applications, this is the entry point into the ray tracer.