GlomeTrace-0.3: Ray Tracing Library

Safe HaskellSafe-Inferred

Data.Glome.Shader

Synopsis

Documentation

data Light Source

Constructors

Light 

Fields

litpos :: !Vec
 
litcol :: !Color
 
litfalloff :: Flt -> Flt
 
litrad :: !Flt
 
litshadow :: !Bool
 

Instances

light :: Vec -> Color -> LightSource

Construct a light given a center location and a color.

data Material t Source

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).

Instances

Read SI 
Read [SI] 
Read (Texture () (Material ())) 

t_uniform :: Material t -> Texture t (Material t)Source

Uniform texture

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.

mpostshade :: [Light] -> [(Color, Vec)] -> Material t -> Ray -> SolidItem t (Material t) -> Rayint t (Material t) -> Int -> (ColorA, [t])Source

mmissshade :: [Light] -> Ray -> SolidItem t (Material t) -> (ColorA, [t])Source