OpenGL-3.0.3.0: A binding for the OpenGL graphics system

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

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 -> StateVar (ComparisonFunction, GLint, GLuint)
- data StencilOp
  - = OpZero
  - | OpKeep
  - | OpReplace
  - | OpIncr
  - | OpIncrWrap
  - | OpDecr
  - | OpDecrWrap
  - | OpInvert
- stencilOp :: StateVar (StencilOp, StencilOp, StencilOp)
- stencilOpSeparate :: Face -> StateVar (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 Source #

discardingRasterizer :: IO a -> IO a Source #

# Scissor Test

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

# Multisample Fragment Operations

sampleAlphaToCoverage :: StateVar Capability Source #

sampleAlphaToOne :: StateVar Capability Source #

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

# Depth Bounds Test

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

# Alpha Test

data ComparisonFunction Source #

Constructors

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

#### Instances

Instances details

Show ComparisonFunction Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.ComparisonFunction Methods showsPrec :: Int -> ComparisonFunction -> ShowS Source # show :: ComparisonFunction -> String Source # showList :: [ComparisonFunction] -> ShowS Source #
Eq ComparisonFunction Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.ComparisonFunction Methods (==) :: ComparisonFunction -> ComparisonFunction -> Bool Source # (/=) :: ComparisonFunction -> ComparisonFunction -> Bool Source #
Ord ComparisonFunction Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.ComparisonFunction

Methods

compare :: ComparisonFunction -> ComparisonFunction -> Ordering Source #

(<) :: ComparisonFunction -> ComparisonFunction -> Bool Source #

(<=) :: ComparisonFunction -> ComparisonFunction -> Bool Source #

(>) :: ComparisonFunction -> ComparisonFunction -> Bool Source #

(>=) :: ComparisonFunction -> ComparisonFunction -> Bool Source #

max :: ComparisonFunction -> ComparisonFunction -> ComparisonFunction Source #

min :: ComparisonFunction -> ComparisonFunction -> ComparisonFunction Source #

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

# Stencil Test

stencilTest :: StateVar Capability Source #

stencilFunc :: StateVar (ComparisonFunction, GLint, GLuint) Source #

stencilFuncSeparate :: Face -> StateVar (ComparisonFunction, GLint, GLuint) Source #

data StencilOp Source #

Constructors

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

#### Instances

Instances details

Show StencilOp Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.PerFragment Methods showsPrec :: Int -> StencilOp -> ShowS Source # show :: StencilOp -> String Source # showList :: [StencilOp] -> ShowS Source #
Eq StencilOp Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.PerFragment Methods (==) :: StencilOp -> StencilOp -> Bool Source # (/=) :: StencilOp -> StencilOp -> Bool Source #
Ord StencilOp Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.PerFragment

Methods

compare :: StencilOp -> StencilOp -> Ordering Source #

(<) :: StencilOp -> StencilOp -> Bool Source #

(<=) :: StencilOp -> StencilOp -> Bool Source #

(>) :: StencilOp -> StencilOp -> Bool Source #

(>=) :: StencilOp -> StencilOp -> Bool Source #

max :: StencilOp -> StencilOp -> StencilOp Source #

min :: StencilOp -> StencilOp -> StencilOp Source #

stencilOp :: StateVar (StencilOp, StencilOp, StencilOp) Source #

stencilOpSeparate :: Face -> StateVar (StencilOp, StencilOp, StencilOp) Source #

activeStencilFace :: StateVar (Maybe Face) Source #

# Depth Buffer Test

depthFunc :: StateVar (Maybe ComparisonFunction) Source #

# Blending

blend :: StateVar Capability Source #

blendBuffer :: DrawBufferIndex -> StateVar Capability Source #

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

data BlendEquation Source #

Constructors

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

#### Instances

Instances details

Show BlendEquation Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.PerFragment Methods showsPrec :: Int -> BlendEquation -> ShowS Source # show :: BlendEquation -> String Source # showList :: [BlendEquation] -> ShowS Source #
Eq BlendEquation Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.PerFragment Methods (==) :: BlendEquation -> BlendEquation -> Bool Source # (/=) :: BlendEquation -> BlendEquation -> Bool Source #
Ord BlendEquation Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.PerFragment

Methods

compare :: BlendEquation -> BlendEquation -> Ordering Source #

(<) :: BlendEquation -> BlendEquation -> Bool Source #

(<=) :: BlendEquation -> BlendEquation -> Bool Source #

(>) :: BlendEquation -> BlendEquation -> Bool Source #

(>=) :: BlendEquation -> BlendEquation -> Bool Source #

max :: BlendEquation -> BlendEquation -> BlendEquation Source #

min :: BlendEquation -> BlendEquation -> BlendEquation Source #

blendEquation :: StateVar BlendEquation Source #

blendEquationSeparate :: StateVar (BlendEquation, BlendEquation) Source #

data BlendingFactor Source #

Constructors

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

#### Instances

Instances details

Show BlendingFactor Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.BlendingFactor Methods showsPrec :: Int -> BlendingFactor -> ShowS Source # show :: BlendingFactor -> String Source # showList :: [BlendingFactor] -> ShowS Source #
Eq BlendingFactor Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.BlendingFactor Methods (==) :: BlendingFactor -> BlendingFactor -> Bool Source # (/=) :: BlendingFactor -> BlendingFactor -> Bool Source #
Ord BlendingFactor Source # |

Instance details

Defined in Graphics.Rendering.OpenGL.GL.BlendingFactor

Methods

compare :: BlendingFactor -> BlendingFactor -> Ordering Source #

(<) :: BlendingFactor -> BlendingFactor -> Bool Source #

(<=) :: BlendingFactor -> BlendingFactor -> Bool Source #

(>) :: BlendingFactor -> BlendingFactor -> Bool Source #

(>=) :: BlendingFactor -> BlendingFactor -> Bool Source #

max :: BlendingFactor -> BlendingFactor -> BlendingFactor Source #

min :: BlendingFactor -> BlendingFactor -> BlendingFactor Source #

blendFuncSeparate :: StateVar ((BlendingFactor, BlendingFactor), (BlendingFactor, BlendingFactor)) Source #

blendFunc :: StateVar (BlendingFactor, BlendingFactor) Source #

blendColor :: StateVar (Color4 GLclampf) Source #

# Dithering

dither :: StateVar Capability Source #

# Logical Operation

data LogicOp Source #

Constructors

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

#### Instances

Instances details

Show LogicOp Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.PerFragment Methods showsPrec :: Int -> LogicOp -> ShowS Source # show :: LogicOp -> String Source # showList :: [LogicOp] -> ShowS Source #
Eq LogicOp Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.PerFragment Methods (==) :: LogicOp -> LogicOp -> Bool Source # (/=) :: LogicOp -> LogicOp -> Bool Source #
Ord LogicOp Source # |
Instance details Defined in Graphics.Rendering.OpenGL.GL.PerFragment Methods compare :: LogicOp -> LogicOp -> Ordering Source # (<) :: LogicOp -> LogicOp -> Bool Source # (<=) :: LogicOp -> LogicOp -> Bool Source # (>) :: LogicOp -> LogicOp -> Bool Source # (>=) :: LogicOp -> LogicOp -> Bool Source # max :: LogicOp -> LogicOp -> LogicOp Source # min :: LogicOp -> LogicOp -> LogicOp Source #

logicOp :: StateVar (Maybe LogicOp) Source #