VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
visutwin::canvas::DepthState Class Reference

#include <platform/graphics/depthState.h>

Public Member Functions

bool depthTest () const
bool depthWrite () const
uint32_t key () const
void setDepthTest (bool value)
void setDepthWrite (bool value)

Static Public Member Functions

static DepthState noWrite ()

Detailed Description

DepthState is a descriptor that defines how the depth value of the fragment is used by the rendering pipeline. A depth state can be set on a material using Material#depthState, or in some cases on the graphics device using GraphicsDevice#setDepthState.

For the best performance, do not modify the depth state after it has been created, but create multiple depth states and assign them to the material or graphics device as needed.

Definition at line 20 of file depthState.h.

Member Function Documentation

◆ depthTest()

bool visutwin::canvas::DepthState::depthTest ( ) const
inline

Definition at line 36 of file depthState.h.

◆ depthWrite()

bool visutwin::canvas::DepthState::depthWrite ( ) const
inline

Definition at line 30 of file depthState.h.

◆ key()

uint32_t visutwin::canvas::DepthState::key ( ) const
inline

A unique number representing the depth state. You can use this number to quickly compare two depth states for equality. The key is always maintained valid without a dirty flag to avoid condition check at runtime, considering these changes rarely.

Definition at line 28 of file depthState.h.

◆ noWrite()

DepthState visutwin::canvas::DepthState::noWrite ( )
inlinestatic

Create a DepthState with depth write disabled. Useful for transparent materials that should not write to the depth buffer.

Definition at line 46 of file depthState.h.

References setDepthWrite().

Referenced by visutwin::canvas::ShadowCatcher::initialize(), visutwin::canvas::GlbParser::parse(), and visutwin::canvas::ElementInput::syncTextElements().

◆ setDepthTest()

void visutwin::canvas::DepthState::setDepthTest ( bool value)
inline

Definition at line 37 of file depthState.h.

◆ setDepthWrite()

void visutwin::canvas::DepthState::setDepthWrite ( bool value)
inline

Definition at line 31 of file depthState.h.

Referenced by noWrite().


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