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/introscreenspaceeffect_dx80.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'materialsystem/stdshaders/introscreenspaceeffect_dx80.cpp')
| -rw-r--r-- | materialsystem/stdshaders/introscreenspaceeffect_dx80.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/introscreenspaceeffect_dx80.cpp b/materialsystem/stdshaders/introscreenspaceeffect_dx80.cpp new file mode 100644 index 0000000..3769da3 --- /dev/null +++ b/materialsystem/stdshaders/introscreenspaceeffect_dx80.cpp @@ -0,0 +1,69 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#include "BaseVSShader.h" + +#include "ScreenSpaceEffect_vs11.inc" +#include "IntroScreenSpaceEffect_ps11.inc" + +DEFINE_FALLBACK_SHADER( IntroScreenSpaceEffect, IntroScreenSpaceEffect_dx80 ) + +BEGIN_VS_SHADER_FLAGS( IntroScreenSpaceEffect_dx80, "Help for IntroScreenSpaceEffect_dx80", SHADER_NOT_EDITABLE ) + BEGIN_SHADER_PARAMS + SHADER_PARAM( MODE, SHADER_PARAM_TYPE_INTEGER, "0", "" ) + END_SHADER_PARAMS + + SHADER_INIT_PARAMS() + { + SET_FLAGS2( MATERIAL_VAR2_NEEDS_FULL_FRAME_BUFFER_TEXTURE ); + } + + SHADER_INIT + { + } + + SHADER_FALLBACK + { + // Requires DX9 + above + if ( IsPC() && g_pHardwareConfig->GetDXSupportLevel() < 80 ) + return "introscreenspaceeffect_dx60"; + return 0; + } + + SHADER_DRAW + { + SHADOW_STATE + { + pShaderShadow->EnableTexture( SHADER_SAMPLER0, true ); + pShaderShadow->EnableTexture( SHADER_SAMPLER1, true ); + int fmt = VERTEX_POSITION; + pShaderShadow->VertexShaderVertexFormat( fmt, 1, 0, 0 ); + DECLARE_STATIC_VERTEX_SHADER( screenspaceeffect_vs11 ); + SET_STATIC_VERTEX_SHADER( screenspaceeffect_vs11 ); + + DECLARE_STATIC_PIXEL_SHADER( introscreenspaceeffect_ps11 ); + SET_STATIC_PIXEL_SHADER( introscreenspaceeffect_ps11 ); + + pShaderShadow->EnableBlending( true ); + pShaderShadow->BlendFunc( SHADER_BLEND_SRC_ALPHA, SHADER_BLEND_ONE ); + } + DYNAMIC_STATE + { + pShaderAPI->BindStandardTexture( SHADER_SAMPLER0, TEXTURE_FRAME_BUFFER_FULL_TEXTURE_0 ); + pShaderAPI->BindStandardTexture( SHADER_SAMPLER1, TEXTURE_FRAME_BUFFER_FULL_TEXTURE_1 ); + DECLARE_DYNAMIC_VERTEX_SHADER( screenspaceeffect_vs11 ); + SET_DYNAMIC_VERTEX_SHADER( screenspaceeffect_vs11 ); + + DECLARE_DYNAMIC_PIXEL_SHADER( introscreenspaceeffect_ps11 ); + SET_DYNAMIC_PIXEL_SHADER_COMBO( MODE, params[MODE]->GetIntValue() ); + SET_DYNAMIC_PIXEL_SHADER( introscreenspaceeffect_ps11 ); + + SetPixelShaderConstant( 0, ALPHA ); + } + Draw(); + } +END_SHADER |