- data PacketColor = PacketColor !Color !Color !Color !Color
- debug_norm_shade :: Rayint -> Ray -> Scene -> Int -> Int -> Color
- flat_shade :: Rayint -> Ray -> Scene -> Int -> Int -> Color
- shade :: Rayint -> Ray -> Scene -> Int -> Int -> Color
- trace :: Scene -> Ray -> Flt -> Int -> Color
- trace_depth :: Scene -> Ray -> Flt -> Int -> (Color, Flt)
- trace_pos :: Scene -> Ray -> Flt -> Int -> (Color, Vec)
- trace_debug :: Scene -> Ray -> Flt -> Int -> Color
- trace_packet :: Scene -> Ray -> Ray -> Ray -> Ray -> Flt -> Int -> PacketColor
Result of tracing a packet of 4 rays at once.
ray intersection returned by rayint
ray that resuted in the ray intersection
scene we're rendering
debugging value (usualy not used)
This is the lighting routine that handles diffuse light, shadows, specular highlights and reflection. Given a ray intersection, the ray, a scene, and a recursion limit, return a color. Debug is a parameter useful for debugging; sometimes we might want to tint the color by the number of bounding boxes tested or something similar. Todo: refraction
Given a scene, 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.
Similar to trace, but return depth as well as color. We might want the depth for post-processing effects.
Similar to trace, but return hit position as well as color.
A trace function which returns some additional debugging info, mainly for performance tuning.