From 3bf9df6b2785fa6d951086978a3e66f49427166a Mon Sep 17 00:00:00 2001 From: FluorescentCIAAfricanAmerican <0934gj3049fk@protonmail.com> Date: Wed, 22 Apr 2020 12:56:21 -0400 Subject: 1 --- materialsystem/stdshaders/writez_dx8.cpp | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 materialsystem/stdshaders/writez_dx8.cpp (limited to 'materialsystem/stdshaders/writez_dx8.cpp') diff --git a/materialsystem/stdshaders/writez_dx8.cpp b/materialsystem/stdshaders/writez_dx8.cpp new file mode 100644 index 0000000..0262ea5 --- /dev/null +++ b/materialsystem/stdshaders/writez_dx8.cpp @@ -0,0 +1,60 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#include "BaseVSShader.h" + +#include "writez.inc" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +DEFINE_FALLBACK_SHADER( WriteZ, WriteZ_DX8 ) + +BEGIN_VS_SHADER_FLAGS( WriteZ_DX8, "Help for WriteZ", SHADER_NOT_EDITABLE ) + + BEGIN_SHADER_PARAMS + END_SHADER_PARAMS + + SHADER_INIT_PARAMS() + { + } + + SHADER_FALLBACK + { + if ( IsPC() && g_pHardwareConfig->GetDXSupportLevel() < 80 ) + return "WriteZ_DX6"; + + return 0; + } + + SHADER_INIT + { + } + + SHADER_DRAW + { + SHADOW_STATE + { + pShaderShadow->EnableColorWrites( false ); + pShaderShadow->EnableAlphaWrites( false ); + + writez_Static_Index vshIndex; + pShaderShadow->SetVertexShader( "writez", vshIndex.GetIndex() ); + + pShaderShadow->SetPixelShader( "white" ); + pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 1, 0, 0 ); + } + DYNAMIC_STATE + { + writez_Dynamic_Index vshIndex; + vshIndex.SetDOWATERFOG( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z ); + pShaderAPI->SetVertexShaderIndex( vshIndex.GetIndex() ); + } + Draw(); + } +END_SHADER + -- cgit v1.2.3