Cogs.Rendering
Loading...
Searching...
No Matches
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.

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.

Member Function Documentation

◆ DefaultState()

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

Constructs a rasterizer state initialized with the default values.

References None.

Member Data Documentation

◆ cullMode

CullMode Cogs::RasterizerState::cullMode

Which face culling mode to apply to primitives before rasterization.

Referenced by std::equal_to< Cogs::RasterizerState >::operator()(), and std::hash< Cogs::RasterizerState >::operator()().

◆ depthBias

float Cogs::RasterizerState::depthBias

Depth bias to apply to depth values after initial rasterization before depth values are written.

Referenced by std::equal_to< Cogs::RasterizerState >::operator()(), and std::hash< Cogs::RasterizerState >::operator()().

◆ 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.

Referenced by std::equal_to< Cogs::RasterizerState >::operator()(), and std::hash< Cogs::RasterizerState >::operator()().

◆ frontCounterClockwise

bool Cogs::RasterizerState::frontCounterClockwise

If counter clockwise polygon winding is used to specify front facing polygons. Default is false.

Referenced by std::equal_to< Cogs::RasterizerState >::operator()(), and std::hash< Cogs::RasterizerState >::operator()().

◆ multiSample

bool Cogs::RasterizerState::multiSample

If multisample rasterization should be enabled. Default is true.

Referenced by std::equal_to< Cogs::RasterizerState >::operator()(), and std::hash< Cogs::RasterizerState >::operator()().

◆ noDepthClip

bool Cogs::RasterizerState::noDepthClip = false

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

Referenced by std::equal_to< Cogs::RasterizerState >::operator()(), and std::hash< Cogs::RasterizerState >::operator()().

◆ 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.

Referenced by std::equal_to< Cogs::RasterizerState >::operator()(), and std::hash< Cogs::RasterizerState >::operator()().

◆ wireFrame

bool Cogs::RasterizerState::wireFrame

If only wire frames should be rasterized. Default is false.

Referenced by std::equal_to< Cogs::RasterizerState >::operator()(), and std::hash< Cogs::RasterizerState >::operator()().


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