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

37 lines
973 B
Plaintext

//========== Copyright (c) Valve Corporation, All rights reserved. ==========//
// STATIC: "FLASHLIGHTDEPTHFILTERMODE" "0..2" [ps20b] [PC]
// STATIC: "FLASHLIGHTDEPTHFILTERMODE" "0..0" [ps20b] [XBOX]
// STATIC: "DEPTH_IN_ALPHA" "0..1"
#include "common_ps_fxc.h"
const float4 g_Parameters : register( c0 );
sampler DepthTextureSampler : register( s0 ); // Scalar shadow depth map
float4 main( float2 baseTexCoord : TEXCOORD0 ) : COLOR
{
float fDepth = 0;
# if (DEPTH_IN_ALPHA == 1)
{
fDepth = tex2D( DepthTextureSampler, baseTexCoord ).a;
}
# else
{
# if !(defined(SHADER_MODEL_PS_1_1) || defined(SHADER_MODEL_PS_1_4) || defined(SHADER_MODEL_PS_2_0)) //Minimum requirement of ps2b
{
fDepth = tex2D( DepthTextureSampler, baseTexCoord ).r;
}
# endif
}
# endif
fDepth = pow( fDepth, g_Parameters.x );
return FinalOutput( float4( fDepth, fDepth, fDepth, 1.0f ), 0, PIXEL_FOG_TYPE_NONE, TONEMAP_SCALE_NONE );
}