flaw-visual-0.1.0.0

LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Flaw.Visual

Description

 
Synopsis

Documentation

rgb2xyz :: (OfScalarType a, Vectorized a, Fractional a) => Node (Vec3 a) -> Program (Node (Vec3 a)) Source #

Conversion from RGB (linear sRGB profile) to XYZ.

xyz2rgb :: (OfScalarType a, Vectorized a, Fractional a) => Node (Vec3 a) -> Program (Node (Vec3 a)) Source #

Conversion from XYZ to RGB (linear sRGB profile).

xyz2xyY :: (OfScalarType a, Vectorized a, Fractional a) => Node (Vec3 a) -> Program (Node (Vec3 a)) Source #

Conversion from XYZ to xyY.

xyY2xyz :: (OfScalarType a, Vectorized a, Fractional a) => Node (Vec3 a) -> Program (Node (Vec3 a)) Source #

Conversion from xyY to XYZ.

tangentFrame :: Node Float3 -> Node Float3 -> Node Float2 -> Program (Node Float3, Node Float3, Node Float3) Source #

Calculate tangent frame for bump mapping from position, normal and texcoord. Position and normal must be in whatever space we need a frame, presumably world space.

encodeLambertAzimuthalEqualArea :: Node Float3 -> Program (Node Float2) Source #

Encode normalized 3-float into 2 floats using lambert azimuthal equal-area projection.

decodeLambertAzimuthalEqualArea :: Node Float2 -> Program (Node Float3) Source #

Decode normalized 3-float from 2 floats using lambert azimuthal equal-area projection.

lambertReflectance Source #

Arguments

:: Node Float3

Normal.

-> Node Float3

Normalized direction to light.

-> Program (Node Float) 

Standard diffuse (Lambertian) reflectance. Need to be multiplied by light irrandiance and material's diffuse color.

schulerSpecularReflectance Source #

Arguments

:: Node Float3

Normal.

-> Node Float3

Normalized half-vector between directions to eye and to light.

-> Node Float3

Normalized direction to light.

-> Node Float

Material glossiness, from 0 (rough) to 1 (smooth).

-> Program (Node Float) 

Shading model from "An Efficient and Physically Plausible Real-Time Shading Model" , ShaderX 7, by Christian Schüler. As in original paper, result need to be multiplied by lambertian reflectance (and then by light irrandiance and material's specular color).

schulerAmbientReflectance Source #

Arguments

:: Node Float3

Normal.

-> Node Float3

Normalized direction to eye.

-> Node Float

Specular coef, from 0 to 1.

-> Node Float

Material glossiness, from 0 (rough) to 1 (smooth).

-> Program (Node Float) 

Shading model from "An Efficient and Physically Plausible Real-Time Shading Model" , ShaderX 7, by Christian Schüler, ambient lighting.

gaussianWeights :: Int -> [Float] Source #

Calculate gaussian weights. Accepts half-number of taps, so with n = 3 it will be 7 weights.