Safe Haskell | Safe-Inferred |
---|
- data Light = Light {}
- light :: Vec -> Color -> Light
- data Material t
- t_uniform :: Material t -> Texture t (Material t)
- mpreshade :: [Light] -> Ray -> SolidItem t (Material t) -> Rayint t (Material t) -> [(Color, Vec)]
- mpostshade :: [Light] -> [(Color, Vec)] -> Material t -> Ray -> SolidItem t (Material t) -> Rayint t (Material t) -> Int -> (ColorA, [t])
- mmissshade :: [Light] -> Ray -> SolidItem t (Material t) -> (ColorA, [t])
- materialShader :: Shader t (Material t) [Light] [(Color, Vec)]
Documentation
Surface properties at a point on an object's surface. Much of this is standard whitted-style illumination. Plain diffuse/specular suraces can be defined with Surface.
Reflection and Refraction have their own constructors. AdditiveLayers is a way of stacking textures such that the colors are added together.
Blend takes two textures and returns the result of cobining them.
Warp is a little stranger; it takes a ray and re-casts into a separate scene (or the same one, if you so choose).
mpreshade :: [Light] -> Ray -> SolidItem t (Material t) -> Rayint t (Material t) -> [(Color, Vec)]Source
Calculate light intensity and direction at the current ray intersection. We do this up front so we don't have to re-do the shadow tests when we evaluate multiple layered textures.