Cogs.Core
|
Encapsulates state for depth buffer usage and stencil buffer usage in a state object. More...
#include <DepthStencilState.h>
Public Types | |
enum | DepthFunction { Never = 0 , Less , LessOrEqual , Equal , GreaterOrEqual , Greater , NotEqual , Always } |
Depth functions to apply when determining object visibility based on its depth test. More... | |
Static Public Member Functions | |
static DepthStencilState | DefaultState () |
Constructs a depth stencil state object initialized with the default values. | |
Public Attributes | |
bool | depthEnabled |
If depth testing is enabled/disabled. Default is true. | |
bool | writeEnabled |
If writes to the depth buffer are enabled/disabled. Default is true. | |
DepthFunction | depthFunction |
The depth function to use for depth testing. | |
Encapsulates state for depth buffer usage and stencil buffer usage in a state object.
This can be used to control how objects being drawn affect the contents of depth/stencil buffers, and which rules to apply when figuring out if an object should be drawn based on its depth values.
Definition at line 12 of file DepthStencilState.h.
Depth functions to apply when determining object visibility based on its depth test.
Example: Object A is rendered at depth 0.5 The depth function is set to Greater Object B is rendered at depth 0.6 Visibility = depth(B) Greater depth(A) = True
Definition at line 23 of file DepthStencilState.h.
|
inlinestatic |
Constructs a depth stencil state object initialized with the default values.
Definition at line 59 of file DepthStencilState.h.
References Less.
Referenced by Cogs::Core::Renderer::render(), Cogs::ContextGL20::setDepthStencilState(), and Cogs::ContextGLES30::setDepthStencilState().
bool Cogs::DepthStencilState::depthEnabled |
If depth testing is enabled/disabled. Default is true.
Definition at line 44 of file DepthStencilState.h.
Referenced by Cogs::RenderTargetsD3D12::loadDepthStencilState(), Cogs::RenderTargetsD3D11::loadDepthStencilState(), Cogs::RenderTargetsVK::loadDepthStencilState(), Cogs::ContextGL20::setDepthStencilState(), and Cogs::ContextGLES30::setDepthStencilState().
DepthFunction Cogs::DepthStencilState::depthFunction |
The depth function to use for depth testing.
The depth of an object being drawn is compared to the contents of the depth buffer using this function. If the result of the depth test is true, the object is sent to the rasterization state, else no rasterization is performed.
Definition at line 54 of file DepthStencilState.h.
Referenced by Cogs::RenderTargetsD3D12::loadDepthStencilState(), Cogs::RenderTargetsD3D11::loadDepthStencilState(), Cogs::RenderTargetsVK::loadDepthStencilState(), Cogs::Core::Renderer::render(), Cogs::ContextGL20::setDepthStencilState(), and Cogs::ContextGLES30::setDepthStencilState().
bool Cogs::DepthStencilState::writeEnabled |
If writes to the depth buffer are enabled/disabled. Default is true.
Definition at line 47 of file DepthStencilState.h.
Referenced by Cogs::RenderTargetsD3D12::loadDepthStencilState(), Cogs::RenderTargetsD3D11::loadDepthStencilState(), Cogs::RenderTargetsVK::loadDepthStencilState(), Cogs::ContextGL20::setDepthStencilState(), and Cogs::ContextGLES30::setDepthStencilState().