summaryrefslogtreecommitdiff
path: root/materialsystem/stdshaders/windowimposter_dx80.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/windowimposter_dx80.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'materialsystem/stdshaders/windowimposter_dx80.cpp')
-rw-r--r--materialsystem/stdshaders/windowimposter_dx80.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/windowimposter_dx80.cpp b/materialsystem/stdshaders/windowimposter_dx80.cpp
new file mode 100644
index 0000000..970c3c6
--- /dev/null
+++ b/materialsystem/stdshaders/windowimposter_dx80.cpp
@@ -0,0 +1,70 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include "BaseVSShader.h"
+
+#include "windowimposter_vs11.inc"
+#include "windowimposter_ps11.inc"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+DEFINE_FALLBACK_SHADER( WindowImposter, WindowImposter_DX80 )
+
+BEGIN_VS_SHADER( WindowImposter_DX80,
+ "Help for WindowImposter_DX80" )
+
+ BEGIN_SHADER_PARAMS
+ SHADER_PARAM( ENVMAP, SHADER_PARAM_TYPE_TEXTURE, "shadertest/shadertest_env", "envmap" )
+ END_SHADER_PARAMS
+
+ // Set up anything that is necessary to make decisions in SHADER_FALLBACK.
+ SHADER_INIT_PARAMS()
+ {
+ }
+
+ SHADER_FALLBACK
+ {
+ if ( IsPC() && g_pHardwareConfig->GetDXSupportLevel() < 80)
+ return "WindowImposter_DX60";
+
+ return NULL;
+ }
+
+ SHADER_INIT
+ {
+ LoadCubeMap( ENVMAP );
+ }
+
+ SHADER_DRAW
+ {
+ SHADOW_STATE
+ {
+ pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
+
+ windowimposter_vs11_Static_Index vshIndex;
+ pShaderShadow->SetVertexShader( "windowimposter_vs11", vshIndex.GetIndex() );
+
+ pShaderShadow->SetPixelShader("windowimposter_ps11");
+ pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 1, 0, 0 );
+ pShaderShadow->EnableBlending( true );
+ pShaderShadow->BlendFunc( SHADER_BLEND_SRC_ALPHA, SHADER_BLEND_ONE_MINUS_SRC_ALPHA );
+ pShaderShadow->EnableDepthWrites( false );
+ FogToFogColor();
+ }
+ DYNAMIC_STATE
+ {
+ windowimposter_vs11_Dynamic_Index vshIndex;
+ vshIndex.SetDOWATERFOG( pShaderAPI->GetSceneFogMode() == MATERIAL_FOG_LINEAR_BELOW_FOG_Z );
+ pShaderAPI->SetVertexShaderIndex( vshIndex.GetIndex() );
+
+ BindTexture( SHADER_SAMPLER0, ENVMAP, -1 );
+ SetModulationVertexShaderDynamicState();
+ }
+ Draw();
+ }
+
+END_SHADER