OpenGL-2.9.2.0: A binding for the OpenGL graphics system

Copyright | (c) Sven Panne 2002-2013
License | BSD3
Maintainer | Sven Panne <svenpanne@gmail.com>
Stability | stable
Portability | portable
Safe Haskell | None
Language | Haskell98

Graphics.Rendering.OpenGL.GL.PerFragment

Contents

- Discarding Primitives Before Rasterization
- Scissor Test
- Multisample Fragment Operations
- Depth Bounds Test
- Alpha Test
- Stencil Test
- Depth Buffer Test
- Blending
- Dithering
- Logical Operation

Description

This module corresponds to section 4.1 (Per-Fragment Operations) of the OpenGL 2.1 specs.

Synopsis

- rasterizerDiscard :: StateVar Capability
- discardingRasterizer :: IO a -> IO a
- scissor :: StateVar (Maybe (Position, Size))
- sampleAlphaToCoverage :: StateVar Capability
- sampleAlphaToOne :: StateVar Capability
- sampleCoverage :: StateVar (Maybe (GLclampf, Bool))
- depthBounds :: StateVar (Maybe (GLclampd, GLclampd))
- data ComparisonFunction
  - = Never
  - | Less
  - | Equal
  - | Lequal
  - | Greater
  - | Notequal
  - | Gequal
  - | Always
- alphaFunc :: StateVar (Maybe (ComparisonFunction, GLclampf))
- stencilTest :: StateVar Capability
- stencilFunc :: StateVar (ComparisonFunction, GLint, GLuint)
- stencilFuncSeparate :: Face -> SettableStateVar (ComparisonFunction, GLint, GLuint)
- data StencilOp
  - = OpZero
  - | OpKeep
  - | OpReplace
  - | OpIncr
  - | OpIncrWrap
  - | OpDecr
  - | OpDecrWrap
  - | OpInvert
- stencilOp :: StateVar (StencilOp, StencilOp, StencilOp)
- stencilOpSeparate :: Face -> SettableStateVar (StencilOp, StencilOp, StencilOp)
- activeStencilFace :: StateVar (Maybe Face)
- depthFunc :: StateVar (Maybe ComparisonFunction)
- blend :: StateVar Capability
- blendBuffer :: DrawBufferIndex -> StateVar Capability
- data BlendEquation
  - = FuncAdd
  - | FuncSubtract
  - | FuncReverseSubtract
  - | Min
  - | Max
  - | LogicOp
- blendEquation :: StateVar BlendEquation
- blendEquationSeparate :: StateVar (BlendEquation, BlendEquation)
- data BlendingFactor
  - = Zero
  - | One
  - | SrcColor
  - | OneMinusSrcColor
  - | DstColor
  - | OneMinusDstColor
  - | SrcAlpha
  - | OneMinusSrcAlpha
  - | DstAlpha
  - | OneMinusDstAlpha
  - | ConstantColor
  - | OneMinusConstantColor
  - | ConstantAlpha
  - | OneMinusConstantAlpha
  - | SrcAlphaSaturate
- blendFuncSeparate :: StateVar ((BlendingFactor, BlendingFactor), (BlendingFactor, BlendingFactor))
- blendFunc :: StateVar (BlendingFactor, BlendingFactor)
- blendColor :: StateVar (Color4 GLclampf)
- dither :: StateVar Capability
- data LogicOp
  - = Clear
  - | And
  - | AndReverse
  - | Copy
  - | AndInverted
  - | Noop
  - | Xor
  - | Or
  - | Nor
  - | Equiv
  - | Invert
  - | OrReverse
  - | CopyInverted
  - | OrInverted
  - | Nand
  - | Set
- logicOp :: StateVar (Maybe LogicOp)

# Discarding Primitives Before Rasterization

rasterizerDiscard :: StateVar Capability

discardingRasterizer :: IO a -> IO a

# Scissor Test

scissor :: StateVar (Maybe (Position, Size))

# Multisample Fragment Operations

sampleAlphaToCoverage :: StateVar Capability

sampleAlphaToOne :: StateVar Capability

sampleCoverage :: StateVar (Maybe (GLclampf, Bool))

# Depth Bounds Test

depthBounds :: StateVar (Maybe (GLclampd, GLclampd))

# Alpha Test

data ComparisonFunction

Constructors

Never |
Less |
Equal |
Lequal |
Greater |
Notequal |
Gequal |
Always |

Instances

Eq ComparisonFunction |
Ord ComparisonFunction |
Show ComparisonFunction |

alphaFunc :: StateVar (Maybe (ComparisonFunction, GLclampf))

# Stencil Test

stencilTest :: StateVar Capability

stencilFunc :: StateVar (ComparisonFunction, GLint, GLuint)

stencilFuncSeparate :: Face -> SettableStateVar (ComparisonFunction, GLint, GLuint)

data StencilOp

Constructors

OpZero |
OpKeep |
OpReplace |
OpIncr |
OpIncrWrap |
OpDecr |
OpDecrWrap |
OpInvert |

Instances

Eq StencilOp |
Ord StencilOp |
Show StencilOp |

stencilOp :: StateVar (StencilOp, StencilOp, StencilOp)

stencilOpSeparate :: Face -> SettableStateVar (StencilOp, StencilOp, StencilOp)

activeStencilFace :: StateVar (Maybe Face)

# Depth Buffer Test

depthFunc :: StateVar (Maybe ComparisonFunction)

# Blending

blend :: StateVar Capability

blendBuffer :: DrawBufferIndex -> StateVar Capability

enable or disable blending based on the buffer bound to the i'th drawBuffer that is the buffer fmap (!! i) (get drawBuffers)

data BlendEquation

Constructors

FuncAdd |
FuncSubtract |
FuncReverseSubtract |
Min |
Max |
LogicOp |

Instances

Eq BlendEquation |
Ord BlendEquation |
Show BlendEquation |

blendEquation :: StateVar BlendEquation

blendEquationSeparate :: StateVar (BlendEquation, BlendEquation)

data BlendingFactor

Constructors

Zero |
One |
SrcColor |
OneMinusSrcColor |
DstColor |
OneMinusDstColor |
SrcAlpha |
OneMinusSrcAlpha |
DstAlpha |
OneMinusDstAlpha |
ConstantColor |
OneMinusConstantColor |
ConstantAlpha |
OneMinusConstantAlpha |
SrcAlphaSaturate |

Instances

Eq BlendingFactor |
Ord BlendingFactor |
Show BlendingFactor |

blendFuncSeparate :: StateVar ((BlendingFactor, BlendingFactor), (BlendingFactor, BlendingFactor))

blendFunc :: StateVar (BlendingFactor, BlendingFactor)

blendColor :: StateVar (Color4 GLclampf)

# Dithering

dither :: StateVar Capability

# Logical Operation

data LogicOp

Constructors

Clear |
And |
AndReverse |
Copy |
AndInverted |
Noop |
Xor |
Or |
Nor |
Equiv |
Invert |
OrReverse |
CopyInverted |
OrInverted |
Nand |
Set |

Instances

Eq LogicOp |
Ord LogicOp |
Show LogicOp |

logicOp :: StateVar (Maybe LogicOp)