sampler TxBase : register(s0);
float4 FogColor;

struct PS_INPUT
{
  float2 uv0 :TEXCOORD0;
  float4 dif :TEXCOORD1;
  float fog: TEXCOORD2;
};

float4 main (PS_INPUT IN): COLOR0
{
  float4 tex=tex2D(TxBase, IN.uv0)*IN.dif;
  return float4(float3(tex.xyz*(1-IN.fog) + FogColor.xyz*IN.fog).xyz,tex.a);
}