Cogs.Core
Public Types | Static Public Member Functions | Public Attributes | List of all members
Cogs::RasterizerState Struct Reference

Encapsulates state for primitive rasterization in a state object. More...

#include <RasterizerState.h>

Public Types

enum  CullMode { Front = 0 , Back , None }
 Culling modes for triangle rasterization. More...
 

Static Public Member Functions

static RasterizerState DefaultState ()
 Constructs a rasterizer state initialized with the default values.
 

Public Attributes

bool wireFrame
 If only wire frames should be rasterized. Default is false.
 
CullMode cullMode
 Which face culling mode to apply to primitives before rasterization.
 
bool frontCounterClockwise
 If counter clockwise polygon winding is used to specify front facing polygons. Default is false.
 
bool multiSample
 If multisample rasterization should be enabled. Default is true.
 
float depthBias
 Depth bias to apply to depth values after initial rasterization before depth values are written.
 
float slopeScaledDepthBias
 Slope scaled depth bias value controlling the depth bias value based on the area of the polygon on screen.
 
float depthBiasClamp
 Value to clamp the depth bias to so that it may not go outside desired values even when applying slope scale.
 
bool scissor
 Enable scissor rect.
 
bool noDepthClip = false
 Clamp depth value instead of clipping against near and depth planes.
 

Detailed Description

Encapsulates state for primitive rasterization in a state object.

Rasterization state can be used to control several aspects of primitive rasterization, such as rendering only wire frames, polygon winding order, back face culling etc.

Definition at line 11 of file RasterizerState.h.

Member Enumeration Documentation

◆ CullMode

Culling modes for triangle rasterization.

Enumerator
Front 

Cull front facing primitives.

Back 

Cull back facing primitives.

None 

Do not perform any face culling.

Definition at line 14 of file RasterizerState.h.

Member Function Documentation

◆ DefaultState()

static RasterizerState Cogs::RasterizerState::DefaultState ( )
inlinestatic

Constructs a rasterizer state initialized with the default values.

Definition at line 54 of file RasterizerState.h.

References None.

Referenced by Cogs::ContextGL20::setRasterizerState(), and Cogs::ContextGLES30::setRasterizerState().

Member Data Documentation

◆ cullMode

CullMode Cogs::RasterizerState::cullMode

◆ depthBias

float Cogs::RasterizerState::depthBias

◆ depthBiasClamp

float Cogs::RasterizerState::depthBiasClamp

Value to clamp the depth bias to so that it may not go outside desired values even when applying slope scale.

Definition at line 43 of file RasterizerState.h.

Referenced by Cogs::RenderTargetsD3D12::loadRasterizerState(), Cogs::RenderTargetsD3D11::loadRasterizerState(), and Cogs::RenderTargetsVK::loadRasterizerState().

◆ frontCounterClockwise

bool Cogs::RasterizerState::frontCounterClockwise

◆ multiSample

bool Cogs::RasterizerState::multiSample

If multisample rasterization should be enabled. Default is true.

Definition at line 34 of file RasterizerState.h.

Referenced by Cogs::RenderTargetsD3D12::loadRasterizerState(), and Cogs::RenderTargetsD3D11::loadRasterizerState().

◆ noDepthClip

bool Cogs::RasterizerState::noDepthClip = false

Clamp depth value instead of clipping against near and depth planes.

Definition at line 49 of file RasterizerState.h.

Referenced by Cogs::RenderTargetsD3D11::loadRasterizerState(), and Cogs::ContextGL20::setRasterizerState().

◆ scissor

bool Cogs::RasterizerState::scissor

◆ slopeScaledDepthBias

float Cogs::RasterizerState::slopeScaledDepthBias

Slope scaled depth bias value controlling the depth bias value based on the area of the polygon on screen.

Definition at line 40 of file RasterizerState.h.

Referenced by Cogs::RenderTargetsD3D12::loadRasterizerState(), Cogs::RenderTargetsD3D11::loadRasterizerState(), Cogs::RenderTargetsVK::loadRasterizerState(), Cogs::ContextGL20::setRasterizerState(), and Cogs::ContextGLES30::setRasterizerState().

◆ wireFrame

bool Cogs::RasterizerState::wireFrame

The documentation for this struct was generated from the following file: