ombra-0.2.1.0: Render engine.

Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Ombra.Layer

Contents

Synopsis

Documentation

data Layer Source #

An Object associated with a program.

layer :: (Subset progAttr grpAttr, Subset progUni grpUni) => Program progUni progAttr -> Object grpUni grpAttr -> Layer Source #

Create a simple Layer from a Program and an Object.

over :: Layer -> Layer -> Layer infixl 1 Source #

Draw the first Layer over the second one. This means that the first Layer will use the same buffers (color, depth, stencil) of the second, but the visibility of the objects still depends on their depth.

clear :: [Buffer] -> Layer -> Layer Source #

Clear some buffers before drawing a Layer.

Programs

type Compatible pgs vgs fgs = EqualOrErr pgs (Union vgs fgs) ((((Text "Incompatible shader uniforms" :$$: (Text " Vertex shader uniforms: " :<>: ShowType vgs)) :$$: (Text " Fragment shader uniforms: " :<>: ShowType fgs)) :$$: (Text " United shader uniforms: " :<>: ShowType (Union vgs fgs))) :$$: (Text " Program uniforms: " :<>: ShowType pgs)) Source #

Compatible shaders.

data Program gs is Source #

A vertex shader associated with a compatible fragment shader.

Instances

Eq (Program gs is) Source # 

Methods

(==) :: Program gs is -> Program gs is -> Bool #

(/=) :: Program gs is -> Program gs is -> Bool #

Hashable (Program gs is) Source # 

Methods

hashWithSalt :: Int -> Program gs is -> Int #

hash :: Program gs is -> Int #

program :: (ShaderVars vgs, ShaderVars vis, VOShaderVars os, ShaderVars fgs, Compatible pgs vgs fgs) => VertexShader vgs vis os -> FragmentShader fgs os -> Program pgs vis Source #

Create a Program from the shaders.

Sublayers

subLayer :: Int -> Int -> Layer -> (Texture -> Layer) -> Layer Source #

Alias for colorSubLayer.

colorSubLayer Source #

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on a Texture.

-> (Texture -> Layer)

Layers using the texture.

-> Layer 

Use a Layer as a Texture on another.

depthSubLayer Source #

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on a depth Texture.

-> (Texture -> Layer)

Layers using the texture.

-> Layer 

Use a Layer as a depth Texture on another.

colorDepthSubLayer Source #

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on the Textures.

-> (Texture -> Texture -> Layer)

Color, depth.

-> Layer 

Combination of colorSubLayer and depthSubLayer.

colorStencilSubLayer Source #

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on a Texture

-> (Texture -> Layer)

Color.

-> Layer 

colorSubLayer with a stencil buffer.

colorSubLayer' Source #

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on a Texture.

-> Int

First pixel to read X

-> Int

First pixel to read Y

-> Int

Width of the rectangle to read

-> Int

Height of the rectangle to read

-> (Texture -> [Color] -> Layer)

Function using the texture.

-> Layer 

Extended version of colorSubLayer that reads and converts the Texture pixels.

depthSubLayer' Source #

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on a depth Texture.

-> Int

First pixel to read X

-> Int

First pixel to read Y

-> Int

Width of the rectangle to read

-> Int

Height of the rectangle to read

-> (Texture -> [Word8] -> Layer)

Layers using the texture.

-> Layer 

Extended version of depthSubLayer. Not supported on WebGL.

colorDepthSubLayer' Source #

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on a Texture

-> Int

First pixel to read X

-> Int

First pixel to read Y

-> Int

Width of the rectangle to read

-> Int

Height of the rectangle to read

-> (Texture -> Texture -> [Color] -> [Word8] -> Layer)

Layers using the texture.

-> Layer 

Extended version of colorDepthSubLayer. Not supported on WebGL.

colorStencilSubLayer' Source #

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on a Texture.

-> Int

First pixel to read X

-> Int

First pixel to read Y

-> Int

Width of the rectangle to read

-> Int

Height of the rectangle to read

-> (Texture -> [Color] -> Layer)

Function using the texture.

-> Layer 

colorSubLayer' with an additional stencil buffer.

buffersSubLayer Source #

Arguments

:: Int

Textures width.

-> Int

Textures height.

-> Int

Number of colors.

-> Layer

Layer to draw.

-> ([Texture] -> Layer)

Function using the textures.

-> Layer 

Render a Layer with multiple floating point colors (use Fragment2, Fragment3, etc.) in some Textures and use them to create another Layer.

buffersDepthSubLayer Source #

Arguments

:: Int

Textures width.

-> Int

Textures height.

-> Int

Number of colors.

-> Layer

Layer to draw.

-> ([Texture] -> Texture -> Layer)

Function using the buffers textures and the depth texture.

-> Layer 

Combination of buffersSubLayer and depthSubLayer.

buffersStencilSubLayer Source #

Arguments

:: Int

Textures width.

-> Int

Textures height.

-> Int

Number of colors.

-> Layer

Layer to draw.

-> ([Texture] -> Layer)

Function using the texture.

-> Layer 

buffersSubLayer with an additional stencil buffer.