summaryrefslogtreecommitdiff
path: root/materialsystem/stdshaders/eyeglint_dx9.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /materialsystem/stdshaders/eyeglint_dx9.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'materialsystem/stdshaders/eyeglint_dx9.cpp')
-rw-r--r--materialsystem/stdshaders/eyeglint_dx9.cpp66
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