hylogen-0.1.5.1: GLSL embedded in Haskell

Safe HaskellNone
LanguageHaskell2010

Hylogen.Globals

Synopsis

Documentation

len :: forall n. Veccable n => Vec n -> Vec1 Source #

Length of a vector

distance :: forall n. Veccable n => Vec n -> Vec n -> Vec n Source #

Euclidean distance between two points

normalize :: forall n. Veccable n => Vec n -> Vec n Source #

faceForward :: forall n. Veccable n => Vec n -> Vec n -> Vec n -> Vec n Source #

Returns a vector pointing in the same direction as another

faceforward toOrient incident reference  -- == oriented

reflect :: forall n. Veccable n => Vec n -> Vec n -> Vec n Source #

Calculates the reflection direction for an incident vector

reflect incident normal -- == reflected

refract :: forall n. Veccable n => Vec n -> Vec n -> Vec1 -> Vec n Source #

Calculates the refraction direction direction for an incident vector

refract incident normal eta -- == reflected

where eta is the ratio of indicies of refraction

inverseSqrt :: forall n. Veccable n => Vec n -> Vec n Source #

fract :: forall n. Veccable n => Vec n -> Vec n Source #

Fractional part

mod_ :: forall n. Veccable n => Vec n -> Vec n -> Vec n Source #

floor_ :: forall n. Veccable n => Vec n -> Vec n Source #

ceil_ :: forall n. Veccable n => Vec n -> Vec n Source #

min_ :: forall n. Veccable n => Vec n -> Vec n -> Vec n Source #

max_ :: forall n. Veccable n => Vec n -> Vec n -> Vec n Source #

clamp :: forall n. Veccable n => Vec n -> Vec n -> Vec n -> Vec n Source #

Clamps x between min and max

clamp min max x -- == clamped

mix :: Veccable n => Vec1 -> Vec n -> Vec n -> Vec n Source #

Linear interpolation between x and y by p, a Vec1 from 0 to 1

mix p x y = x ^* (1 - p) + y ^* p
-- mix 0 x y == x
-- mix 1 x y == y

bcomp :: Veccable v => String -> Vec v -> Vec v -> Booly Source #

Helper function to compare vectors

eq :: Veccable v => Vec v -> Vec v -> Booly Source #

neq :: Veccable v => Vec v -> Vec v -> Booly Source #

lt :: Veccable v => Vec v -> Vec v -> Booly Source #

gt :: Veccable v => Vec v -> Vec v -> Booly Source #

leq :: Veccable v => Vec v -> Vec v -> Booly Source #

geq :: Veccable v => Vec v -> Vec v -> Booly Source #

texture2D :: Texture -> Vec2 -> Vec4 Source #

Returns rgba value given a texture and texture coordinates texture coordinates start at 0 1

sel :: forall a. ToGLSLType a => Booly -> Expr a -> Expr a -> Expr a Source #

Selection function

sel bool x y is akin to

bool ? x : y in C-like languages