home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar 2006 April
/
Gamestar_83_2006-04_dvd.iso
/
Dema
/
demowot_english.exe
/
InfDX
/
Shaders
/
deferred-heathaze-pixel.hlsl
< prev
next >
Wrap
Text File
|
2005-09-07
|
856b
|
35 lines
struct VS_OUTPUT
{
float2 UV : TEXCOORD0;
float2 TiledUV : TEXCOORD1;
};
struct HeatHaze
{
float4 mDistort;
float4 mPlanes;
};
sampler DISTORT0 : register(s0);
sampler DISTORT1 : register(s1);
sampler BLURTARGET2 : register(s2);
sampler PIXELDEPTH : register(s3);
HeatHaze T_CONST_HEATHAZE;
float4 main(VS_OUTPUT In) : COLOR
{
float4 FinalColor;
float2 Distort0=tex2D(DISTORT0, In.TiledUV).rg;
float2 Distort1=tex2D(DISTORT1, In.TiledUV).rg;
float2 Distort=lerp(Distort0, Distort1, T_CONST_HEATHAZE.mDistort.z)*T_CONST_HEATHAZE.mPlanes.z+T_CONST_HEATHAZE.mPlanes.w;
float3 Blurred=tex2D(BLURTARGET2, In.UV+Distort).rgb;
float Depth=tex2D(PIXELDEPTH, In.UV).r;
FinalColor.rgb=Blurred;
FinalColor.a = saturate(Depth*T_CONST_HEATHAZE.mPlanes.x+T_CONST_HEATHAZE.mPlanes.y);
return FinalColor;
}