summaryrefslogtreecommitdiff
path: root/materialsystem/stdshaders/haloadd_ps2x.fxc
diff options
context:
space:
mode:
Diffstat (limited to 'materialsystem/stdshaders/haloadd_ps2x.fxc')
-rw-r--r--materialsystem/stdshaders/haloadd_ps2x.fxc26
1 files changed, 26 insertions, 0 deletions
diff --git a/materialsystem/stdshaders/haloadd_ps2x.fxc b/materialsystem/stdshaders/haloadd_ps2x.fxc
new file mode 100644
index 0000000..9496f59
--- /dev/null
+++ b/materialsystem/stdshaders/haloadd_ps2x.fxc
@@ -0,0 +1,26 @@
+//======= Copyright � 1996-2006, Valve Corporation, All rights reserved. ======
+
+#include "common_ps_fxc.h"
+
+sampler TexSampler : register( s0 );
+
+float g_flDimValue : register( c0 );
+
+struct PS_INPUT
+{
+ HALF2 baseTexCoord : TEXCOORD0; // Base texture coordinate
+};
+
+float4 main( PS_INPUT i ) : COLOR
+{
+ float4 result = tex2D( TexSampler, i.baseTexCoord );
+
+ // Scale by dim value before computing luminance below
+ result.rgb *= saturate( g_flDimValue );
+
+ // Store max color component in alpha for alpha blend of one/invSrcAlpha
+ float flLuminance = max( result.r, max( result.g, result.b ) );
+ result.a = pow( flLuminance, 0.8f );
+
+ return result.rgba;
+}