//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.08.299.0000
//
//   vsa shaderdump19/WATERDISPLACE002.pso
//    /Fcshaderdump19/WATERDISPLACE002.pso.dis
//
//
// Parameters:
//
#define rr TESR_ReciprocalResolutionWater.x

float4 BlendAmount : register(c1);
float4 TextureOffset : register(c2);
float4 fDamp : register(c3);
float4 RainVars : register(c4);
float4 WadingVars : register(c5);
float4 TESR_ReciprocalResolutionWater : register(c6);
float4 TESR_Tick : register(c7);
float4 TESR_WaveParams : register(c8);

sampler2D HeightMap : register(s0);
sampler2D HeightMap2 : register(s1);
//
//
// Registers:
//
//   Name         Reg   Size
//   ------------ ----- ----
//   WadingVars   const_5       1
//   HeightMap    texture_0       1
//


// Structures:

struct VS_OUTPUT {
    float2 HeightUV : TEXCOORD0;
};

struct PS_OUTPUT {
    float4 color_0 : COLOR0;
};

// Code:

PS_OUTPUT main(VS_OUTPUT IN) {
    PS_OUTPUT OUT;

    const float4 const_0 = {0, -rr, 4, -0.5};
    const float4 const_1 = {-rr, 0, 0, 0};

    float4 r0;
    float4 r1;
    float4 r2;
    float4 r3;
    float4 r4;

    r0.xyzw = tex2D(HeightMap, IN.HeightUV.xy);
    r1.xyzw = tex2D(HeightMap, IN.HeightUV.xy - const_1.xy);
    r4.xyzw = tex2D(HeightMap, IN.HeightUV.xy - const_0.xy);
    r2.xyzw = tex2D(HeightMap, IN.HeightUV.xy + const_1.xy);
    r3.xyzw = tex2D(HeightMap, IN.HeightUV.xy + const_0.xy);
    r1.w = (r1.x + (r2.x + (r3.x + r4.x))) - (r0.x * 4);
    r0.xyzw = r0.xyzw - 0.5;
    r0.y = (WadingVars.x * r1.w) + r0.y;
    r0.x = (WadingVars.y * r0.y) + r0.x;
    r0.xyzw = (WadingVars.z * r0.xyzw) + 0.5;
    OUT.color_0.a = r0.w;
    OUT.color_0.rgb = r0.xyz;

    return OUT;
};

// approximately 19 instruction slots used (5 texture, 14 arithmetic)
