Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class ShaderType t where
- data Expr
- data Action
- data ContextVarType
- newtype Float = Float Expr
- newtype Unknown = Unknown Expr
- newtype Sampler2D = Sampler2D Expr
- data V2 = V2 Float Float
- data V3 = V3 Float Float Float
- data V4 = V4 Float Float Float Float
- data M2 = M2 V2 V2
- data M3 = M3 V3 V3 V3
- data M4 = M4 V4 V4 V4 V4
- fromRational :: Rational -> Float
- fromInteger :: Integer -> Float
- negate :: Float -> Float
- class Mul a b c | a b -> c
- (*) :: (Mul a b c, ShaderType a, ShaderType b, ShaderType c) => a -> b -> c
- (/) :: (Mul a b c, ShaderType a, ShaderType b, ShaderType c) => a -> b -> c
- class Sum a
- (+) :: (Sum a, ShaderType a) => a -> a -> a
- (-) :: (Sum a, ShaderType a) => a -> a -> a
- (^) :: (ShaderType a, ShaderType b) => a -> b -> a
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- (==) :: ShaderType a => a -> a -> Bool
- (>=) :: ShaderType a => a -> a -> Bool
- (<=) :: ShaderType a => a -> a -> Bool
- (<) :: ShaderType a => a -> a -> Bool
- (>) :: ShaderType a => a -> a -> Bool
- ifThenElse :: ShaderType a => Bool -> a -> a -> a
- loop :: ShaderType a => Float -> a -> (Float -> a -> (a, Bool)) -> a
- true :: Bool
- false :: Bool
- store :: ShaderType a => a -> a
- texture2D :: Sampler2D -> V2 -> V4
- radians :: GenType a => a -> a
- degrees :: GenType a => a -> a
- sin :: GenType a => a -> a
- cos :: GenType a => a -> a
- tan :: GenType a => a -> a
- asin :: GenType a => a -> a
- acos :: GenType a => a -> a
- atan :: GenType a => a -> a
- atan2 :: GenType a => a -> a -> a
- exp :: GenType a => a -> a
- log :: GenType a => a -> a
- exp2 :: GenType a => a -> a
- log2 :: GenType a => a -> a
- sqrt :: GenType a => a -> a
- inversesqrt :: GenType a => a -> a
- abs :: GenType a => a -> a
- sign :: GenType a => a -> a
- floor :: GenType a => a -> a
- ceil :: GenType a => a -> a
- fract :: GenType a => a -> a
- mod :: (GenType a, GenType b) => a -> b -> a
- min :: GenType a => a -> a -> a
- max :: GenType a => a -> a -> a
- clamp :: (GenType a, GenType b) => a -> b -> b -> a
- mix :: (GenType a, GenType b) => a -> a -> b -> a
- step :: GenType a => a -> a -> a
- smoothstep :: (GenType a, GenType b) => b -> b -> a -> a
- length :: GenType a => a -> Float
- distance :: GenType a => a -> a -> Float
- dot :: GenType a => a -> a -> Float
- cross :: V3 -> V3 -> V3
- normalize :: GenType a => a -> a
- faceforward :: GenType a => a -> a -> a -> a
- reflect :: GenType a => a -> a -> a
- refract :: GenType a => a -> a -> Float -> a
- matrixCompMult :: (Matrix a, Matrix b, Matrix c) => a -> b -> c
- position :: V4
- fragColor :: V4
Documentation
class ShaderType t where
A type in the GPU.
data Expr
An expression.
data Action
Expressions that have to be compiled to a statement.
newtype Float
A GPU float.
Sum Float | |
ShaderType Float | |
GLES => AttributeCPU Float Float | |
GLES => UniformCPU Float Float | |
Mul M4 Float M4 | |
Mul M3 Float M3 | |
Mul M2 Float M2 | |
Mul V4 Float V4 | |
Mul V3 Float V3 | |
Mul V2 Float V2 | |
Mul Float M4 M4 | |
Mul Float M3 M3 | |
Mul Float M2 M2 | |
Mul Float V4 V4 | |
Mul Float V3 V3 | |
Mul Float V2 V2 | |
Mul Float Float Float |
newtype Sampler2D
A GPU sampler (sampler2D in GLSL).
data V3
A GPU 3D vector.
data V4
A GPU 4D vector.
data M2
A GPU 2x2 matrix.
data M3
A GPU 3x3 matrix.
data M4
A GPU 4x4 matrix.
fromRational :: Rational -> Float
fromInteger :: Integer -> Float
class Mul a b c | a b -> c
Types that can be multiplied.
Mul M4 M4 M4 | |
Mul M4 V4 V4 | |
Mul M4 Float M4 | |
Mul M3 M3 M3 | |
Mul M3 V3 V3 | |
Mul M3 Float M3 | |
Mul M2 M2 M2 | |
Mul M2 V2 V2 | |
Mul M2 Float M2 | |
Mul V4 M4 V4 | |
Mul V4 V4 V4 | |
Mul V4 Float V4 | |
Mul V3 M3 V3 | |
Mul V3 V3 V3 | |
Mul V3 Float V3 | |
Mul V2 M2 V2 | |
Mul V2 V2 V2 | |
Mul V2 Float V2 | |
Mul Float M4 M4 | |
Mul Float M3 M3 | |
Mul Float M2 M2 | |
Mul Float V4 V4 | |
Mul Float V3 V3 | |
Mul Float V2 V2 | |
Mul Float Float Float |
(*) :: (Mul a b c, ShaderType a, ShaderType b, ShaderType c) => a -> b -> c infixl 7
(/) :: (Mul a b c, ShaderType a, ShaderType b, ShaderType c) => a -> b -> c infixl 7
(+) :: (Sum a, ShaderType a) => a -> a -> a infixl 6
(-) :: (Sum a, ShaderType a) => a -> a -> a infixl 6
(^) :: (ShaderType a, ShaderType b) => a -> b -> a infixr 8
(&&) :: Bool -> Bool -> Bool infixr 3
(||) :: Bool -> Bool -> Bool infixr 2
(==) :: ShaderType a => a -> a -> Bool infix 4
(>=) :: ShaderType a => a -> a -> Bool infix 4
(<=) :: ShaderType a => a -> a -> Bool infix 4
(<) :: ShaderType a => a -> a -> Bool infix 4
(>) :: ShaderType a => a -> a -> Bool infix 4
ifThenElse :: ShaderType a => Bool -> a -> a -> a
Rebinded if.
:: 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
false :: Bool
store :: ShaderType a => a -> a
Avoid executing this expression more than one time. Conditionals and loops imply it.
radians :: GenType a => a -> a
degrees :: GenType a => a -> a
sin :: GenType a => a -> a
cos :: GenType a => a -> a
tan :: GenType a => a -> a
asin :: GenType a => a -> a
acos :: GenType a => a -> a
atan :: GenType a => a -> a
atan2 :: GenType a => a -> a -> a
exp :: GenType a => a -> a
log :: GenType a => a -> a
exp2 :: GenType a => a -> a
log2 :: GenType a => a -> a
sqrt :: GenType a => a -> a
inversesqrt :: GenType a => a -> a
abs :: GenType a => a -> a
sign :: GenType a => a -> a
floor :: GenType a => a -> a
ceil :: GenType a => a -> a
fract :: GenType a => a -> a
mod :: (GenType a, GenType b) => a -> b -> a
min :: GenType a => a -> a -> a
max :: GenType a => a -> a -> a
clamp :: (GenType a, GenType b) => a -> b -> b -> a
mix :: (GenType a, GenType b) => a -> a -> b -> a
step :: GenType a => a -> a -> a
smoothstep :: (GenType a, GenType b) => b -> b -> a -> a
normalize :: GenType a => a -> a
faceforward :: GenType a => a -> a -> a -> a
reflect :: GenType a => a -> a -> a
matrixCompMult :: (Matrix a, Matrix b, Matrix c) => a -> b -> c