1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-07 09:43:40 +08:00
hl2sdk/materialsystem/stdshaders/haloadd_ps2x.fxc
Scott Ehlert fdd0bbf277 SDK sync.
2012-07-06 20:35:59 -05:00

27 lines
687 B
Plaintext

//========== Copyright (c) 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;
}