fwgl-0.1.3.1: Game engine

Safe HaskellNone
LanguageHaskell2010

FWGL.Shader.Language

Synopsis

Documentation

data Action Source

Expressions that are transformed to statements.

Constructors

Store String Expr 
If Expr String Expr Expr 
For CInt String Expr (Expr -> Expr -> (Expr, Expr)) 

Instances

newtype Unknown Source

The type of a generic expression.

Constructors

Unknown Expr 

Instances

newtype Sampler2D Source

A GPU sampler (sampler2D in GLSL).

Constructors

Sampler2D Expr 

data Vec2 Source

A GPU 2D vector. NB: This is a different type from Data.Vect.Float.Vec2.

Constructors

Vec2 Float Float 

negate :: GenType a => a -> a Source

(*) :: (Mul a b c, ShaderType a, ShaderType b, ShaderType c) => a -> b -> c infixl 7 Source

(/) :: (Mul a b c, ShaderType a, ShaderType b, ShaderType c) => a -> b -> c infixl 7 Source

class Sum a Source

Types that can be added.

(+) :: (Sum a, ShaderType a) => a -> a -> a infixl 6 Source

(-) :: (Sum a, ShaderType a) => a -> a -> a infixl 6 Source

(^) :: (ShaderType a, ShaderType b) => a -> b -> a infixr 8 Source

(&&) :: Bool -> Bool -> Bool infixr 3 Source

(||) :: Bool -> Bool -> Bool infixr 2 Source

(==) :: ShaderType a => a -> a -> Bool infix 4 Source

(>=) :: ShaderType a => a -> a -> Bool infix 4 Source

(<=) :: ShaderType a => a -> a -> Bool infix 4 Source

(<) :: ShaderType a => a -> a -> Bool infix 4 Source

(>) :: ShaderType a => a -> a -> Bool infix 4 Source

ifThenElse :: ShaderType a => Bool -> a -> a -> a Source

Rebound if. You don't need to use this function, with -XRebindableSyntax.

loop Source

Arguments

:: ShaderType a 
=> Float

Maximum number of iterations (should be as low as possible, must be an integer literal)

-> a

Initial value

-> (Float -> a -> (a, Bool))

Iteration -> Old value -> (Next, Stop)

-> a 

true :: Bool Source

false :: Bool Source

store :: ShaderType a => a -> a Source

Avoid executing this expression more than one time. Conditionals and loops imply it.

radians :: GenType a => a -> a Source

degrees :: GenType a => a -> a Source

sin :: GenType a => a -> a Source

cos :: GenType a => a -> a Source

tan :: GenType a => a -> a Source

asin :: GenType a => a -> a Source

acos :: GenType a => a -> a Source

atan :: GenType a => a -> a Source

atan2 :: GenType a => a -> a -> a Source

exp :: GenType a => a -> a Source

log :: GenType a => a -> a Source

exp2 :: GenType a => a -> a Source

log2 :: GenType a => a -> a Source

sqrt :: GenType a => a -> a Source

inversesqrt :: GenType a => a -> a Source

abs :: GenType a => a -> a Source

sign :: GenType a => a -> a Source

floor :: GenType a => a -> a Source

ceil :: GenType a => a -> a Source

fract :: GenType a => a -> a Source

mod :: (GenType a, GenType b) => a -> b -> a Source

min :: GenType a => a -> a -> a Source

max :: GenType a => a -> a -> a Source

clamp :: (GenType a, GenType b) => a -> b -> b -> a Source

mix :: (GenType a, GenType b) => a -> a -> b -> a Source

step :: GenType a => a -> a -> a Source

smoothstep :: (GenType a, GenType b) => b -> b -> a -> a Source

length :: GenType a => a -> Float Source

distance :: GenType a => a -> a -> Float Source

dot :: GenType a => a -> a -> Float Source

normalize :: GenType a => a -> a Source

faceforward :: GenType a => a -> a -> a -> a Source

reflect :: GenType a => a -> a -> a Source

refract :: GenType a => a -> a -> Float -> a Source

matrixCompMult :: (Matrix a, Matrix b, Matrix c) => a -> b -> c Source

position :: Vec4 Source

The position of the vertex (only works in the vertex shader).

fragColor :: Vec4 Source

The color of the fragment (only works in the fragment shader).