ombra-0.2.2.0: Render engine.

Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Ombra.D3

Contents

Description

Simplified 3D graphics system.

Synopsis

3D Objects

type Object3D = Object Uniforms3D Geometry3D Source #

A standard 3D object, without the View3 matrix.

type IsObject3D gs is = (Subset Geometry3D is, Subset (View3 ': Uniforms3D) gs, ShaderVars is, ShaderVars gs) Source #

3D objects compatible with the standard 3D shader program.

cube :: GLES => Texture -> Object3D Source #

A cube with a specified Texture.

mesh :: GLES => Texture -> Geometry is -> Object Uniforms3D is Source #

A 3D object with a specified Geometry.

Transformations

trans :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Object gs is -> Object gs is Source #

Translate a 3D Object.

rotX :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is Source #

Rotate a 3D Object around the X axis.

rotY :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is Source #

Rotate a 3D Object around the Y axis.

rotZ :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is Source #

Rotate a 3D Object around the Z axis.

rot :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Float -> Object gs is -> Object gs is Source #

Rotate a 3D Object around a vector.

scale :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is Source #

Scale a 3D Object.

scaleV :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Object gs is -> Object gs is Source #

Scale a 3D Object in three dimensions.

transform :: (MemberGlobal Transform3 gs, GLES) => Mat4 -> Object gs is -> Object gs is Source #

Transform a 3D Object.

Layers

view :: (GLES, ShaderVars gs, ShaderVars is) => Mat4 -> [Object gs is] -> Object (View3 ': gs) is Source #

Create a group of objects with a view matrix.

viewPersp Source #

Arguments

:: (GLES, ShaderVars gs, ShaderVars is) 
=> Float

Near

-> Float

Far

-> Float

FOV

-> Mat4

View matrix

-> [Object gs is] 
-> Object (View3 ': gs) is 

Create a group of objects with a view matrix and perspective projection.

viewOrtho Source #

Arguments

:: (GLES, ShaderVars gs, ShaderVars is) 
=> Float

Near

-> Float

Far

-> Float

Left

-> Float

Right

-> Float

Bottom

-> Float

Top

-> Mat4

View matrix

-> [Object gs is] 
-> Object (View3 ': gs) is 

Create a group of objects with a view matrix and orthographic projection.

viewVP :: (GLES, ShaderVars gs, ShaderVars is) => (Vec2 -> Mat4) -> [Object gs is] -> Object (View3 ': gs) is Source #

Create a group of objects with a view matrix, depending on the size of the framebuffer.

layerS :: IsObject3D gs is => Object gs is -> Layer' s t () Source #

A Layer with the standard 3D program.

Matrices

View matrices

perspectiveMat4 Source #

Arguments

:: Float

Near

-> Float

Far

-> Float

FOV

-> Float

Aspect ratio

-> Mat4 

4x4 perspective projection matrix.

perspectiveMat4Size Source #

Arguments

:: Float

Near

-> Float

Far

-> Float

FOV

-> Vec2

Viewport size

-> Mat4 

4x4 perspective projection matrix, using width and height instead of the aspect ratio.

orthoMat4 Source #

Arguments

:: Float

Near

-> Float

Far

-> Float

Left

-> Float

Right

-> Float

Bottom

-> Float

Top

-> Mat4 

4x4 orthographic projection matrix.

cameraMat4 Source #

Arguments

:: Vec3

Eye

-> Float

Pitch

-> Float

Yaw

-> Mat4 

4x4 FPS camera matrix.

lookAtMat4 Source #

Arguments

:: Vec3

Eye

-> Vec3

Target

-> Vec3

Up

-> Mat4 

4x4 "look at" camera matrix.

Transformation matrices

transMat4 :: Vec3 -> Mat4 Source #

4x4 translation matrix.

rotXMat4 :: Float -> Mat4 Source #

4x4 rotation matrix (X axis).

rotYMat4 :: Float -> Mat4 Source #

4x4 rotation matrix (Y axis).

rotZMat4 :: Float -> Mat4 Source #

4x4 rotation matrix (Z axis).

rotMat4 Source #

Arguments

:: Vec3

Axis.

-> Float

Angle

-> Mat4 

4x4 rotation matrix.

scaleMat4 :: Vec3 -> Mat4 Source #

4x4 scale matrix.

Uniforms

data Texture2 Source #

Constructors

Texture2 Sampler2D 

Instances

Generic Texture2 Source # 

Associated Types

type Rep Texture2 :: * -> * #

Methods

from :: Texture2 -> Rep Texture2 x #

to :: Rep Texture2 x -> Texture2 #

type Rep Texture2 Source # 
type Rep Texture2 = D1 (MetaData "Texture2" "Graphics.Rendering.Ombra.Shader.Default3D" "ombra-0.2.2.0-h29ECupgrZ3Ibp6AVWfWT" False) (C1 (MetaCons "Texture2" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Sampler2D)))

data Transform3 Source #

Constructors

Transform3 Mat4 

Instances

Generic Transform3 Source # 

Associated Types

type Rep Transform3 :: * -> * #

type Rep Transform3 Source # 
type Rep Transform3 = D1 (MetaData "Transform3" "Graphics.Rendering.Ombra.Shader.Default3D" "ombra-0.2.2.0-h29ECupgrZ3Ibp6AVWfWT" False) (C1 (MetaCons "Transform3" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Mat4)))

data View3 Source #

Constructors

View3 Mat4 

Instances

Generic View3 Source # 

Associated Types

type Rep View3 :: * -> * #

Methods

from :: View3 -> Rep View3 x #

to :: Rep View3 x -> View3 #

type Rep View3 Source # 
type Rep View3 = D1 (MetaData "View3" "Graphics.Rendering.Ombra.Shader.Default3D" "ombra-0.2.2.0-h29ECupgrZ3Ibp6AVWfWT" False) (C1 (MetaCons "View3" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Mat4)))