RSAGL.Material handles properties of surfaces such as color, shininess, and transparency including procedural textures but not including anything touching the normal vector, such as bumpiness. Materials are handled using layers.
- module RSAGL.Modeling.Color
- data MaterialLayer
- type MaterialSurface a = ApplicativeWrapper Surface a
- data Material
- materialIsEmpty :: Material -> Bool
- toLayers :: Material -> [MaterialLayer]
- materialLayerSurface :: MaterialLayer -> MaterialSurface RGBA
- materialLayerRelevant :: MaterialLayer -> MaterialSurface Bool
- materialComplexity :: Material -> Integer
- materialLayerToOpenGLWrapper :: MaterialLayer -> IO () -> IO ()
- isOpaqueLayer :: MaterialLayer -> Bool
- diffuseLayer :: MaterialSurface RGB -> Material
- specularLayer :: MaterialSurface RGB -> GLfloat -> Material
- transparentLayer :: MaterialSurface RGBA -> Material
- emissiveLayer :: MaterialSurface RGB -> Material
- filteringLayer :: MaterialSurface RGB -> Material
MaterialLayer is a layer of material some material quality (diffuse, transparent, emissive, or specular highlight).
MaterialLayers are rendered one on top of another to create layered effects.
Get the color information for a
Get a relevance layer for a surface. Purely irrelevant materials can be removed without changing the appearance of a model. Irrelevant triangles can also be selectively culled from a model.
Answers a complexity heuristic for a
Material. Result is a small integer greater than or equal to zero.
Run an IO action wrapped in OpenGL state appropriate for the layer in question.
True if the
MaterialLayer is completely opaque. A layer under an opaque layer is not visible.
A shiny material with specular highlight, including a specular exponent parameter. Larger exponents give tighter specular highlights, but should be less than 128 (larger than that wouldn't have very much effect anyway). Typical values are 1-10 or so.