libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Member Functions | Public Attributes | List of all members
donut::graphics::ShaderConfiguration Struct Reference

Base configuration options for a shader. More...

#include <donut/graphics/ShaderConfiguration.hpp>

Public Member Functions

constexpr bool operator== (const ShaderConfiguration &other) const =default
 Compare two sets of shader options for equality. More...
 
constexpr std::strong_ordering operator<=> (const ShaderConfiguration &other) const =default
 Compare two sets of shader options. More...
 

Public Attributes

DepthBufferMode depthBufferMode = DepthBufferMode::USE_DEPTH_TEST
 How to treat the depth buffer for each pixel being rendered. More...
 
DepthTestPredicate depthTestPredicate = DepthTestPredicate::LESS
 The condition to check when evaluating the depth test. More...
 
StencilBufferMode stencilBufferMode = StencilBufferMode::IGNORE
 How to treat the stencil buffer for each pixel being rendered. More...
 
StencilTestPredicate stencilTestPredicate = StencilTestPredicate::ALWAYS_PASS
 The condition to check when evaluating the stencil test. More...
 
std::int32_t stencilTestReferenceValue = 0
 The reference value to compare the stencil buffer value against when evaluating the stencil test. More...
 
std::uint32_t stencilTestMask = 0xFFFFFFFF
 The bit pattern to mask the reference value and stencil value with before performing the stencil test. More...
 
StencilBufferOperation stencilBufferOperationOnStencilTestFail = StencilBufferOperation::KEEP
 The operation to perform on the stencil buffer if the stencil test fails. More...
 
StencilBufferOperation stencilBufferOperationOnDepthTestFail = StencilBufferOperation::KEEP
 The operation to perform on the stencil buffer if the stencil test passes, but the depth test fails. More...
 
StencilBufferOperation stencilBufferOperationOnPass = StencilBufferOperation::KEEP
 The operation to perform on the stencil buffer if the stencil test and the depth test both pass. More...
 
FaceCullingMode faceCullingMode = FaceCullingMode::CULL_BACK_FACES
 How to treat the facing of primitives while rendering. More...
 
FrontFace frontFace = FrontFace::COUNTERCLOCKWISE
 The winding order of front-facing faces. More...
 
AlphaMode alphaMode = AlphaMode::IGNORE
 How to treat the alpha channel of the output pixel color while rendering. More...
 

Detailed Description

Base configuration options for a shader.

Member Function Documentation

◆ operator==()

constexpr bool donut::graphics::ShaderConfiguration::operator== ( const ShaderConfiguration other) const
constexprdefault

Compare two sets of shader options for equality.

Parameters
otherthe shader options to compare these to.
Returns
true if the configurations are equal, false otherwise.

◆ operator<=>()

constexpr std::strong_ordering donut::graphics::ShaderConfiguration::operator<=> ( const ShaderConfiguration other) const
constexprdefault

Compare two sets of shader options.

Parameters
otherthe shader options to compare these to.
Returns
a strong ordering between the two configurations.

Member Data Documentation

◆ depthBufferMode

DepthBufferMode donut::graphics::ShaderConfiguration::depthBufferMode = DepthBufferMode::USE_DEPTH_TEST

How to treat the depth buffer for each pixel being rendered.

See also
depthTestPredicate

◆ depthTestPredicate

DepthTestPredicate donut::graphics::ShaderConfiguration::depthTestPredicate = DepthTestPredicate::LESS

The condition to check when evaluating the depth test.

See also
depthBufferMode

◆ stencilBufferMode

StencilBufferMode donut::graphics::ShaderConfiguration::stencilBufferMode = StencilBufferMode::IGNORE

◆ stencilTestPredicate

StencilTestPredicate donut::graphics::ShaderConfiguration::stencilTestPredicate = StencilTestPredicate::ALWAYS_PASS

◆ stencilTestReferenceValue

std::int32_t donut::graphics::ShaderConfiguration::stencilTestReferenceValue = 0

The reference value to compare the stencil buffer value against when evaluating the stencil test.

See also
stencilBufferMode
stencilTestPredicate
stencilTestMask
stencilBufferOperationOnStencilTestFail
stencilBufferOperationOnDepthTestFail
stencilBufferOperationOnPass

◆ stencilTestMask

std::uint32_t donut::graphics::ShaderConfiguration::stencilTestMask = 0xFFFFFFFF

The bit pattern to mask the reference value and stencil value with before performing the stencil test.

The set bits in the mask indicate the relevant bits that will be compared.

See also
stencilBufferMode
stencilTestPredicate
stencilTestReferenceValue
stencilBufferOperationOnStencilTestFail
stencilBufferOperationOnDepthTestFail
stencilBufferOperationOnPass

◆ stencilBufferOperationOnStencilTestFail

StencilBufferOperation donut::graphics::ShaderConfiguration::stencilBufferOperationOnStencilTestFail = StencilBufferOperation::KEEP

◆ stencilBufferOperationOnDepthTestFail

StencilBufferOperation donut::graphics::ShaderConfiguration::stencilBufferOperationOnDepthTestFail = StencilBufferOperation::KEEP

The operation to perform on the stencil buffer if the stencil test passes, but the depth test fails.

See also
stencilBufferMode
stencilTestPredicate
stencilTestReferenceValue
stencilTestMask
stencilBufferOperationOnStencilTestFail
stencilBufferOperationOnPass

◆ stencilBufferOperationOnPass

StencilBufferOperation donut::graphics::ShaderConfiguration::stencilBufferOperationOnPass = StencilBufferOperation::KEEP

The operation to perform on the stencil buffer if the stencil test and the depth test both pass.

See also
stencilBufferMode
stencilTestPredicate
stencilTestReferenceValue
stencilTestMask
stencilBufferOperationOnStencilTestFail
stencilBufferOperationOnDepthTestFail

◆ faceCullingMode

FaceCullingMode donut::graphics::ShaderConfiguration::faceCullingMode = FaceCullingMode::CULL_BACK_FACES

How to treat the facing of primitives while rendering.

The facing is determined by the winding order of the vertices on each rendered face. The face is considered to be front-facing if it has the winding order specified by frontFace.

See also
frontFace

◆ frontFace

FrontFace donut::graphics::ShaderConfiguration::frontFace = FrontFace::COUNTERCLOCKWISE

The winding order of front-facing faces.

See also
faceCullingMode

◆ alphaMode

AlphaMode donut::graphics::ShaderConfiguration::alphaMode = AlphaMode::IGNORE

How to treat the alpha channel of the output pixel color while rendering.


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