lambdacube-engine-0.2.1: 3D rendering engine written entirely in Haskell

Graphics.LambdaCube.BlendMode

Synopsis

Documentation

data LayerBlendType Source

Type of texture blend mode.

Constructors

LBT_COLOUR 
LBT_ALPHA 

data LayerBlendOperation Source

Texture blending operations.

Constructors

LBO_REPLACE

replace all colour with texture with no adjustment

LBO_ADD

add colour components together

LBO_MODULATE

multiply colour components together

LBO_ALPHA_BLEND

blend based on texture alpha

data LayerBlendOperationEx Source

Extended texture blending operations.

Constructors

LBX_SOURCE1

use source1 without modification

LBX_SOURCE2

use source2 without modification

LBX_MODULATE

multiply source1 and source2 together

LBX_MODULATE_X2

as LBX_MODULATE but brighten afterwards (x2)

LBX_MODULATE_X4

as LBX_MODULATE but brighten more afterwards (x4)

LBX_ADD

add source1 and source2 together

LBX_ADD_SIGNED

as LBX_ADD, but subtract 0.5 from the result

LBX_ADD_SMOOTH

as LBX_ADD, but subtract product from the sum

LBX_SUBTRACT

subtract source2 from source1

LBX_BLEND_DIFFUSE_ALPHA

use interpolated alpha value from vertices to scale source1, then add source2 scaled by (1-alpha)

LBX_BLEND_TEXTURE_ALPHA

as LBX_BLEND_DIFFUSE_ALPHA, but use alpha from texture

LBX_BLEND_CURRENT_ALPHA

as LBX_BLEND_DIFFUSE_ALPHA, but use current alpha from previous stages

LBX_BLEND_MANUAL

as LBX_BLEND_DIFFUSE_ALPHA but use a constant manual blend value (0.0-1.0)

LBX_DOTPRODUCT

dot product of color1 and color2

LBX_BLEND_DIFFUSE_COLOUR

use interpolated color values from vertices to scale source1, then add source2 scaled by (1-color)

data LayerBlendSource Source

Sources of values for blending operations.

Constructors

LBS_CURRENT

the colour as built up from previous stages

LBS_TEXTURE

the colour derived from the texture assigned to this layer

LBS_DIFFUSE

the interpolated diffuse colour from the vertices

LBS_SPECULAR

the interpolated specular colour from the vertices

LBS_MANUAL

a colour supplied manually as a separate argument

data LayerBlendModeEx Source

Constructors

LayerBlendModeEx 

Fields

lbBlendType :: LayerBlendType

The type of blending (colour or alpha)

lbOperation :: LayerBlendOperationEx

The operation to be applied

lbSource1 :: LayerBlendSource

The first source of colour/alpha

lbSource2 :: LayerBlendSource

The second source of colour/alpha

lbColourArg1 :: ColourValue

Manual colour value for manual source1

lbColourArg2 :: ColourValue

Manual colour value for manual source2

lbAlphaArg1 :: FloatType

Manual alpha value for manual source1

lbAlphaArg2 :: FloatType

Manual alpha value for manual source2

lbFactor :: FloatType

Manual blending factor

data SceneBlendType Source

Types of blending that you can specify between an object and the existing contents of the scene.

Constructors

SBT_TRANSPARENT_ALPHA

Make the object transparent based on the final alpha values in the texture

SBT_TRANSPARENT_COLOUR

Make the object transparent based on the colour values in the texture (brighter = more opaque)

SBT_ADD

Add the texture values to the existing scene content

SBT_MODULATE

Multiply the 2 colours together

SBT_REPLACE

The default blend mode where source replaces destination

data SceneBlendOperation Source

Blending operations controls how objects are blended into the scene.

convertSBTtoSBF :: SceneBlendType -> (SceneBlendFactor, SceneBlendFactor)Source

Converts SceneBlendType to SceneBlendFactor pair