summaryrefslogtreecommitdiff
path: root/materialsystem/stdshaders/portalstaticoverlay_ps11.fxc
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/portalstaticoverlay_ps11.fxc
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'materialsystem/stdshaders/portalstaticoverlay_ps11.fxc')
-rw-r--r--materialsystem/stdshaders/portalstaticoverlay_ps11.fxc68
1 files changed, 68 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/portalstaticoverlay_ps11.fxc b/materialsystem/stdshaders/portalstaticoverlay_ps11.fxc
new file mode 100644
index 0000000..d049970
--- /dev/null
+++ b/materialsystem/stdshaders/portalstaticoverlay_ps11.fxc
@@ -0,0 +1,68 @@
+// STATIC: "HASALPHAMASK" "0..1"
+// STATIC: "HASSTATICTEXTURE" "0..1"
+
+// DYNAMIC: "HDRENABLED" "0..1"
+// DYNAMIC: "PIXELFOGTYPE" "0..1"
+
+#include "common_ps_fxc.h"
+
+const HALF3 g_StaticAmount : register( c0 ); //x is static, y is 1.0 - static
+
+#if( HASSTATICTEXTURE )
+ sampler StaticTextureSampler : register( s0 );
+# if( HASALPHAMASK )
+ sampler AlphaMaskSampler : register( s1 );
+# endif
+#else
+# if( HASALPHAMASK )
+ sampler AlphaMaskSampler : register( s0 );
+# endif
+#endif
+
+struct PS_INPUT
+{
+ float4 vProjPos : POSITION;
+
+ //vStaticTexCoord and vAlphaMaskTexCoord are the same numbers, but we need to map TEXCOORD0 to sampler 0, and TEXCOORD1 to sampler1. ps11 compatibility issue
+#if( HASSTATICTEXTURE )
+ float2 vStaticTexCoord : TEXCOORD0;
+# if( HASALPHAMASK )
+ float2 vAlphaMaskTexCoord : TEXCOORD1;
+# endif
+#else
+# if( HASALPHAMASK )
+ float2 vAlphaMaskTexCoord : TEXCOORD0;
+# else
+ float2 vUnusedTexCoord1 : TEXCOORD0;
+# endif
+ float2 vUnusedTexCoord2 : TEXCOORD1;
+#endif
+};
+
+
+
+
+HALF4 main( PS_INPUT i ) : COLOR
+{
+ HALF4 result;
+
+# if( HASSTATICTEXTURE )
+ result.rgb = tex2D( StaticTextureSampler, i.vStaticTexCoord ).rgb;
+# else
+ result.rgb = 0.25; //without a static texture, just be gray
+# endif
+
+
+
+# if( HASALPHAMASK )
+ result.a = min( g_StaticAmount.x, tex2D( AlphaMaskSampler, i.vAlphaMaskTexCoord ).a ); //when static reaches 0, fades away completely, also never exceeds the mask's alpha
+# else
+ result.a = g_StaticAmount.x; //when static reaches 0, fades away completely
+# endif
+
+ //result.r = 1.0;
+ //result.gb = 0.0;
+ //result.a = 0.5;
+
+ return result;
+} \ No newline at end of file