diff options
Diffstat (limited to 'materialsystem/stdshaders/eyeglint_dx9.cpp')
| -rw-r--r-- | materialsystem/stdshaders/eyeglint_dx9.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/eyeglint_dx9.cpp b/materialsystem/stdshaders/eyeglint_dx9.cpp new file mode 100644 index 0000000..d2662e6 --- /dev/null +++ b/materialsystem/stdshaders/eyeglint_dx9.cpp @@ -0,0 +1,66 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Run procedural glint generation inner loop in pixel shader +// +// $Header: $ +// $NoKeywords: $ +//===========================================================================// + +#include "BaseVSShader.h" +#include "shaderlib/cshader.h" + +#include "eyeglint_vs20.inc" +#include "eyeglint_ps20.inc" +#include "eyeglint_ps20b.inc" + +DEFINE_FALLBACK_SHADER( EyeGlint, EyeGlint_dx9 ) +BEGIN_VS_SHADER( EyeGlint_dx9, "Help for EyeGlint" ) + +BEGIN_SHADER_PARAMS +END_SHADER_PARAMS + +SHADER_INIT +{ +} + +SHADER_FALLBACK +{ + if ( g_pHardwareConfig->GetDXSupportLevel() < 90 ) + { + return "Wireframe"; + } + return 0; +} + +SHADER_DRAW +{ + SHADOW_STATE + { + pShaderShadow->EnableDepthWrites( false ); + + pShaderShadow->EnableBlending( true ); + pShaderShadow->BlendFunc( SHADER_BLEND_ONE, SHADER_BLEND_ONE ); // Additive blending + + int pTexCoords[3] = { 2, 2, 3 }; + pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 3, pTexCoords, 0 ); + + pShaderShadow->EnableCulling( false ); + + pShaderShadow->EnableSRGBWrite( false ); // linear texture + + DECLARE_STATIC_VERTEX_SHADER( eyeglint_vs20 ); + SET_STATIC_VERTEX_SHADER( eyeglint_vs20 ); + + SET_STATIC_PS2X_PIXEL_SHADER_NO_COMBOS( eyeglint ); + } + + DYNAMIC_STATE + { + DECLARE_DYNAMIC_VERTEX_SHADER( eyeglint_vs20 ); + SET_DYNAMIC_VERTEX_SHADER( eyeglint_vs20 ); + + SET_DYNAMIC_PS2X_PIXEL_SHADER_NO_COMBOS( eyeglint ); + } + Draw(); +} +END_SHADER |