ombra-0.1.1.0: Render engine.

Safe HaskellSafe
LanguageHaskell2010

Graphics.Rendering.Ombra.Shader.Language.Types

Synopsis

Documentation

type MInt = Int #

CPU integer, used in the shader compiler.

data Action #

Expressions that are transformed to statements.

Instances

Eq Action # 

Methods

(==) :: Action -> Action -> Bool #

(/=) :: Action -> Action -> Bool #

Hashable Action # 

Methods

hashWithSalt :: Int -> Action -> Int #

hash :: Action -> Int #

newtype Bool #

A GPU boolean.

Constructors

Bool Expr 

Instances

ShaderType Bool # 
ToFloat Bool # 
ToBool Bool # 
ToInt Bool # 
GLES => BaseAttribute Bool # 

Methods

encodeAttribute :: proxy Bool -> [CPUBase Bool] -> GL AnyArray #

setAttribute :: proxy Bool -> GLUInt -> GL () #

GLES => BaseUniform Bool # 

Methods

setUniform :: UniformLocation -> proxy Bool -> CPUBase Bool -> GL () #

GLES => BaseUniform (Array n Bool) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Bool) -> CPUBase (Array n Bool) -> GL () #

type CPUBase Bool # 
type CPUBase (Array n Bool) # 
type CPUBase (Array n Bool) = [Int32]

newtype Float #

A GPU float.

Constructors

Float Expr 

Instances

ShaderType Float # 
ToMat4 Float # 

Methods

mat4 :: Float -> Mat4 #

ToMat3 Float # 

Methods

mat3 :: Float -> Mat3 #

ToMat2 Float # 

Methods

mat2 :: Float -> Mat2 #

ToBVec4 Float # 

Methods

bvec4 :: Float -> BVec4 #

ToBVec3 Float # 

Methods

bvec3 :: Float -> BVec3 #

ToBVec2 Float # 

Methods

bvec2 :: Float -> BVec2 #

ToIVec4 Float # 

Methods

ivec4 :: Float -> IVec4 #

ToIVec3 Float # 

Methods

ivec3 :: Float -> IVec3 #

ToIVec2 Float # 

Methods

ivec2 :: Float -> IVec2 #

ToVec4 Float # 

Methods

vec4 :: Float -> Vec4 #

ToVec3 Float # 

Methods

vec3 :: Float -> Vec3 #

ToVec2 Float # 

Methods

vec2 :: Float -> Vec2 #

ToFloat Float # 
ToBool Float # 
ToInt Float # 
Num Float # 

Methods

fromInteger :: Integer -> Float #

GenType Float # 
GLES => BaseAttribute Float # 

Methods

encodeAttribute :: proxy Float -> [CPUBase Float] -> GL AnyArray #

setAttribute :: proxy Float -> GLUInt -> GL () #

GLES => BaseUniform Float # 

Methods

setUniform :: UniformLocation -> proxy Float -> CPUBase Float -> GL () #

Base Mat4 Float # 
Base Mat3 Float # 
Base Mat2 Float # 
Base Vec4 Float # 
Base Vec3 Float # 
Base Vec2 Float # 
Base Float Float # 
Mul Float Float Mat4 Vec4 Vec4 # 
Mul Float Float Mat3 Vec3 Vec3 # 
Mul Float Float Mat2 Vec2 Vec2 # 
Mul Float Float Vec4 Mat4 Vec4 # 
Mul Float Float Vec3 Mat3 Vec3 # 
Mul Float Float Vec2 Mat2 Vec2 # 
Arithmetic Float Float Mat4 Mat4 Mat4 # 
Arithmetic Float Float Mat4 Float Mat4 # 
Arithmetic Float Float Mat3 Mat3 Mat3 # 
Arithmetic Float Float Mat3 Float Mat3 # 
Arithmetic Float Float Mat2 Mat2 Mat2 # 
Arithmetic Float Float Mat2 Float Mat2 # 
Arithmetic Float Float Vec4 Vec4 Vec4 # 
Arithmetic Float Float Vec4 Float Vec4 # 
Arithmetic Float Float Vec3 Vec3 Vec3 # 
Arithmetic Float Float Vec3 Float Vec3 # 
Arithmetic Float Float Vec2 Vec2 Vec2 # 
Arithmetic Float Float Vec2 Float Vec2 # 
Arithmetic Float Float Float Mat4 Mat4 # 
Arithmetic Float Float Float Mat3 Mat3 # 
Arithmetic Float Float Float Mat2 Mat2 # 
Arithmetic Float Float Float Vec4 Vec4 # 
Arithmetic Float Float Float Vec3 Vec3 # 
Arithmetic Float Float Float Vec2 Vec2 # 
Arithmetic Float Float Float Float Float # 
GLES => BaseUniform (Array n Float) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Float) -> CPUBase (Array n Float) -> GL () #

type CPUBase Float # 
type CPUBase (Array n Float) # 
type CPUBase (Array n Float) = [Float]

newtype Unknown #

The type of a generic expression.

Constructors

Unknown Expr 

data Vec2 #

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

Constructors

Vec2 Float Float 

data BVec2 #

A GPU 2D boolean vector.

Constructors

BVec2 Bool Bool 

data BVec3 #

A GPU 3D boolean vector.

Constructors

BVec3 Bool Bool Bool 

data BVec4 #

A GPU 4D boolean vector.

Constructors

BVec4 Bool Bool Bool Bool 

data Array n t #

A GPU array.

Constructors

Array Expr 

Instances

(ShaderType t, KnownNat n) => ShaderType (Array n t) # 

Methods

zero :: Array n t #

toExpr :: Array n t -> Expr #

fromExpr :: Expr -> Array n t #

typeName :: Array n t -> String #

size :: Array n t -> MInt #

GLES => BaseUniform (Array n BVec4) # 

Methods

setUniform :: UniformLocation -> proxy (Array n BVec4) -> CPUBase (Array n BVec4) -> GL () #

GLES => BaseUniform (Array n BVec3) # 

Methods

setUniform :: UniformLocation -> proxy (Array n BVec3) -> CPUBase (Array n BVec3) -> GL () #

GLES => BaseUniform (Array n BVec2) # 

Methods

setUniform :: UniformLocation -> proxy (Array n BVec2) -> CPUBase (Array n BVec2) -> GL () #

GLES => BaseUniform (Array n IVec4) # 

Methods

setUniform :: UniformLocation -> proxy (Array n IVec4) -> CPUBase (Array n IVec4) -> GL () #

GLES => BaseUniform (Array n IVec3) # 

Methods

setUniform :: UniformLocation -> proxy (Array n IVec3) -> CPUBase (Array n IVec3) -> GL () #

GLES => BaseUniform (Array n IVec2) # 

Methods

setUniform :: UniformLocation -> proxy (Array n IVec2) -> CPUBase (Array n IVec2) -> GL () #

GLES => BaseUniform (Array n Vec4) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Vec4) -> CPUBase (Array n Vec4) -> GL () #

GLES => BaseUniform (Array n Vec3) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Vec3) -> CPUBase (Array n Vec3) -> GL () #

GLES => BaseUniform (Array n Vec2) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Vec2) -> CPUBase (Array n Vec2) -> GL () #

GLES => BaseUniform (Array n Int) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Int) -> CPUBase (Array n Int) -> GL () #

GLES => BaseUniform (Array n Bool) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Bool) -> CPUBase (Array n Bool) -> GL () #

GLES => BaseUniform (Array n Float) # 

Methods

setUniform :: UniformLocation -> proxy (Array n Float) -> CPUBase (Array n Float) -> GL () #

type CPUBase (Array n BVec4) # 
type CPUBase (Array n BVec4) = [IVec4]
type CPUBase (Array n BVec3) # 
type CPUBase (Array n BVec3) = [IVec3]
type CPUBase (Array n BVec2) # 
type CPUBase (Array n BVec2) = [IVec2]
type CPUBase (Array n IVec4) # 
type CPUBase (Array n IVec4) = [IVec4]
type CPUBase (Array n IVec3) # 
type CPUBase (Array n IVec3) = [IVec3]
type CPUBase (Array n IVec2) # 
type CPUBase (Array n IVec2) = [IVec2]
type CPUBase (Array n Vec4) # 
type CPUBase (Array n Vec4) = [Vec4]
type CPUBase (Array n Vec3) # 
type CPUBase (Array n Vec3) = [Vec3]
type CPUBase (Array n Vec2) # 
type CPUBase (Array n Vec2) = [Vec2]
type CPUBase (Array n Int) # 
type CPUBase (Array n Int) = [Int32]
type CPUBase (Array n Bool) # 
type CPUBase (Array n Bool) = [Int32]
type CPUBase (Array n Float) # 
type CPUBase (Array n Float) = [Float]

class ShaderType t where #

A type in the GPU.

Minimal complete definition

zero, toExpr, fromExpr, typeName, size

Methods

zero :: t #

toExpr :: t -> Expr #

fromExpr :: Expr -> t #

typeName :: t -> String #

size :: t -> MInt #

Instances

ShaderType Mat4 # 
ShaderType Mat3 # 
ShaderType Mat2 # 
ShaderType BVec4 # 
ShaderType BVec3 # 
ShaderType BVec2 # 
ShaderType IVec4 # 
ShaderType IVec3 # 
ShaderType IVec2 # 
ShaderType Vec4 # 
ShaderType Vec3 # 
ShaderType Vec2 # 
ShaderType Unknown # 
ShaderType SamplerCube # 
ShaderType Sampler2D # 
ShaderType Int # 

Methods

zero :: Int #

toExpr :: Int -> Expr #

fromExpr :: Expr -> Int #

typeName :: Int -> String #

size :: Int -> MInt #

ShaderType Float # 
ShaderType Bool # 
(ShaderType t, KnownNat n) => ShaderType (Array n t) # 

Methods

zero :: Array n t #

toExpr :: Array n t -> Expr #

fromExpr :: Expr -> Array n t #

typeName :: Array n t -> String #

size :: Array n t -> MInt #

hash2 :: Hashable a => MInt -> MInt -> a -> MInt #