diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /materialsystem/stdshaders/BufferClearObeyStencil_dx6.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'materialsystem/stdshaders/BufferClearObeyStencil_dx6.cpp')
| -rw-r--r-- | materialsystem/stdshaders/BufferClearObeyStencil_dx6.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/BufferClearObeyStencil_dx6.cpp b/materialsystem/stdshaders/BufferClearObeyStencil_dx6.cpp new file mode 100644 index 0000000..b0f1696 --- /dev/null +++ b/materialsystem/stdshaders/BufferClearObeyStencil_dx6.cpp @@ -0,0 +1,51 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Clears color/depth, but obeys stencil while doing so +// +// $Header: $ +// $NoKeywords: $ +//=============================================================================// + +#include "shaderlib/cshader.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +DEFINE_FALLBACK_SHADER( BufferClearObeyStencil, BufferClearObeyStencil_DX6 ) + +BEGIN_SHADER_FLAGS( BufferClearObeyStencil_DX6, "Help for BufferClearObeyStencil_DX6", SHADER_NOT_EDITABLE ) + + BEGIN_SHADER_PARAMS + SHADER_PARAM( CLEARCOLOR, SHADER_PARAM_TYPE_INTEGER, "1", "activates clearing of color" ) + SHADER_PARAM( CLEARDEPTH, SHADER_PARAM_TYPE_INTEGER, "1", "activates clearing of depth" ) + END_SHADER_PARAMS + + SHADER_INIT_PARAMS() + { + } + + SHADER_INIT + { + } + + SHADER_DRAW + { + SHADOW_STATE + { + pShaderShadow->DepthFunc( SHADER_DEPTHFUNC_ALWAYS ); + bool bEnableDepthWrites = params[CLEARDEPTH]->GetIntValue() != 0; + pShaderShadow->EnableDepthWrites( bEnableDepthWrites ); + bool bEnableColorWrites = params[CLEARCOLOR]->GetIntValue() != 0; + pShaderShadow->EnableColorWrites( bEnableColorWrites ); + pShaderShadow->EnableAlphaWrites( bEnableColorWrites ); + + pShaderShadow->DrawFlags( SHADER_DRAW_POSITION | SHADER_DRAW_COLOR ); + + DisableFog(); + } + DYNAMIC_STATE + { + } + Draw( ); + } +END_SHADER |