//
// Generated by Microsoft (R) D3DX9 Shader Compiler 
//
// Parameters:
//
//   float4 Ambient;
//   float alphaFadeZbias;
//   float alphaFadeZbiasScale;
//   float4 baseColor;
//   float distortionBufferScale;
//   float distortionStrength;
//   float4 fogColor;
//   float3 fogTransform;
//   
//   struct
//   {
//       float4 worldVector;
//       float4 color;
//       float4 channelMask;
//
//   } lights;
//   
//   sampler2D mtbSampleSlot1;
//   sampler2D mtbSampleSlot2;
//   float normalMapStrength;
//   float4 nvidiaHack;
//   float2 reflectivityConst;
//   sampler2D s_distortion;
//   sampler2D s_distortion2;
//   sampler2D s_luminanceMap1;
//   sampler2D s_sceneDepth;
//   sampler2D s_shadowMask;
//   float sceneDepthAlphaMask;
//   row_major float3x4 screenDataToCamera;
//   row_major float4x4 screenToWorld;
//   float3 specularColor;
//   float specularPower;
//   float2 specularReflectivityConst;
//   float4 tangentColor;
//   float4 waterDiffuseColor;
//   float waterOpacity;
//   float3 worldEyePos;
//
//
// Registers:
//
//   Name                      Reg   Size
//   ------------------------- ----- ----
//   screenToWorld             c0       4
//   screenDataToCamera        c4       3
//   lights                    c7       3
//   fogColor                  c10      1
//   fogTransform              c11      1
//   sceneDepthAlphaMask       c12      1
//   distortionBufferScale     c13      1
//   waterDiffuseColor         c14      1
//   baseColor                 c15      1
//   tangentColor              c16      1
//   normalMapStrength         c17      1
//   distortionStrength        c18      1
//   reflectivityConst         c19      1
//   specularReflectivityConst c20      1
//   specularPower             c21      1
//   specularColor             c22      1
//   waterOpacity              c23      1
//   alphaFadeZbias            c24      1
//   alphaFadeZbiasScale       c25      1
//   Ambient                   c26      1
//   worldEyePos               c27      1
//   nvidiaHack                c31      1
//   s_distortion              s0       1
//   s_distortion2             s1       1
//   s_sceneDepth              s2       1
//   mtbSampleSlot1            s3       1
//   mtbSampleSlot2            s4       1
//   s_luminanceMap1           s5       1
//   s_shadowMask              s6       1
//
//
// Default values:
//
//   screenToWorld
//     c0   = { 0, 0, 0, 0 };
//     c1   = { 0, 0, 0, 0 };
//     c2   = { 0, 0, 0, 0 };
//     c3   = { 0, 0, 0, 0 };
//
//   screenDataToCamera
//     c4   = { 0, 0, 0, 0 };
//     c5   = { 0, 0, 0, 0 };
//     c6   = { 0, 0, 0, 0 };
//
//   lights
//     c7   = { 0, 0, 0, 0 };
//     c8   = { 0, 0, 0, 0 };
//     c9   = { 0, 0, 0, 0 };
//
//   fogColor
//     c10  = { 0, 0, 0, 0 };
//
//   fogTransform
//     c11  = { 0, 0, 0, 0 };
//
//   sceneDepthAlphaMask
//     c12  = { 0, 0, 0, 0 };
//
//   distortionBufferScale
//     c13  = { 0, 0, 0, 0 };
//
//   waterDiffuseColor
//     c14  = { 0, 0, 0, 0 };
//
//   baseColor
//     c15  = { 0, 0, 0, 0 };
//
//   tangentColor
//     c16  = { 0, 0, 0, 0 };
//
//   normalMapStrength
//     c17  = { 0, 0, 0, 0 };
//
//   distortionStrength
//     c18  = { 0, 0, 0, 0 };
//
//   reflectivityConst
//     c19  = { 0, 0, 0, 0 };
//
//   specularReflectivityConst
//     c20  = { 0, 0, 0, 0 };
//
//   specularPower
//     c21  = { 0, 0, 0, 0 };
//
//   specularColor
//     c22  = { 0, 0, 0, 0 };
//
//   waterOpacity
//     c23  = { 0, 0, 0, 0 };
//
//   alphaFadeZbias
//     c24  = { 0, 0, 0, 0 };
//
//   alphaFadeZbiasScale
//     c25  = { 0, 0, 0, 0 };
//
//   Ambient
//     c26  = { 0, 0, 0, 0 };
//
//   worldEyePos
//     c27  = { 0, 0, 0, 0 };
//
//   nvidiaHack
//     c31  = { 0, 0, 0, 0 };
//

    ps_3_0
    def c28, 0, 1, 0.5, 1.00000001e-007
    def c29, 2, -1, 1, -0.00100000005
    def c30, 1.44269502, 0, 0, 0
  dcl_texcoord8 v9.x
    dcl_texcoord v0
    dcl_texcoord2 v1
    dcl_color1 v2
    dcl_texcoord6 v3
    dcl_texcoord7 v4.xyz
    dcl_texcoord3_pp v5
    dcl_texcoord4_pp v6
    dcl_texcoord5_pp v7.xyz
    dcl_2d s0
    dcl_2d s1
    dcl_2d s2
    dcl_2d s3
    dcl_2d s4
    dcl_2d s5
    dcl_2d s6
    texld_pp r0, v0, s4
    mad_pp r0.xyz, r0.wyzw, c29.x, c29.y
    texld_pp r1, v0.zwzw, s4
    mad_pp r0.xyz, r1.wyzw, c29.x, r0
    add_pp r0.xyz, r0, c29.y
    mul_pp r1.xy, r0, c17.x
    mov r1.zw, c29
    add r0.w, r1.z, -c24.x
    mul r2.x, r0.w, c25.x
    mad r0.w, r0.w, c25.x, r1.w
    cmp r0.w, r0.w, r2.x, -c29.w
    rcp r0.w, r0.w
    texldp_pp r2, v3, s2
    add r1.w, r2.w, -v3.w
    mul_sat_pp r0.w, r0.w, r1.w
    mul_pp r0.xy, r1, r0.w
    dp3 r1.x, v4, r0
    nrm_pp r2.xyz, r0
    cmp r0.x, -r1.x, c28.x, c28.y
    cmp r0.y, r1.x, c28.x, c28.y
    add_pp r0.x, r0.x, -r0.y
    mul_pp r0.xyz, r2, r0.x
    mad r1.xy, c18.x, -r0, v3
    mul r1.w, c13.x, v3.w
    min r2.xy, r1.w, r1
    mov r2.zw, v3
    texldp_pp r3, r2, s0
    texldp_pp r2, r2, s1
    mad_pp r1.xyw, r3.xyzz, r2.w, r2.xyzz
    nrm_pp r2.xyz, v4
    dp3_pp r2.x, r0, r2
    add r2.xy, -r2.x, c29.z
    mov_sat r2.x, r2.x
    mov_pp r3, c15
    add_pp r3, -r3, c16
    mad r3, r2.x, r3, c15
    add r3, r3, c29.y
    mad r3, r0.w, r3, c29.z
    mad r1.xyw, r3.xyzz, r1, -r3.xyzz
    mad r1.xyw, r3.w, r1, r3.xyzz
    dp3 r2.x, v7, r0
    mad_sat_pp r2.x, r2.x, c28.z, c28.z
    mul_pp r2.x, r2.x, r2.x
    lrp_pp r3.x, r2.x, r1.z, c26.w
    texld_pp r4, v1, s3
    texld_pp r5, v1.zwzw, s3
    lrp r2.xzw, c28.z, r5.xyyz, r4.xyyz
    mul r2.xzw, r2, c23.x
    mul r2.xzw, r0.w, r2
    mul_pp r2.xzw, r2, c14.xyyz
    mul_pp r3.xyz, r3.x, r2.xzww
    mad r3.xyz, c26, r3, -r1.xyww
    mul_pp r1.z, r2_abs.y, r2_abs.y
    mul_pp r1.z, r1.z, r1.z
    mul_pp r1.z, r2_abs.y, r1.z
    mad_sat_pp r2.y, c19.y, r1.z, c19.x
    mad_sat_pp r1.z, c20.y, r1.z, c20.x
    mul r2.y, r0.w, r2.y
    mad r1.xyw, r2.y, r3.xyzz, r1
    mad r3, v3.xywx, c28.yyyx, c28.xxxy
    dp4 r4.x, c4, r3
    dp4 r4.y, c5, r3
    dp4 r4.z, c6, r3
    dp3 r2.y, r4, r4
    rsq r2.y, r2.y
    rcp r2.y, r2.y
    mad r2.y, r2.y, c11.x, c11.y
    mul r2.y, r2.y, c30.x
    exp_sat r2.y, r2.y
    mad_pp r2.y, c10.w, -r2.y, c10.w
    mul_pp r2.y, r2.y, c11.z
    mul r2.y, r0.w, r2.y
    lrp_pp r3.xyz, r2.y, c10, r1.xyww
    mul_pp r1.xyw, r0.y, v6.xyzz
    mad_pp r1.xyw, r0.x, v5.xyzz, r1
    mad_pp r0.xyz, r0.z, v7, r1.xyww
    nrm_pp r4.xyz, r0
    nrm_pp r0.xyz, r4
    mul r1.xyw, c1.xyzz, v3.y
    mad r1.xyw, v9.x, c0.xyzz, r1
    mad r1.xyw, v3.w, c2.xyzz, r1
    add r1.xyw, r1, c3.xyzz
    add r5.xyz, -r1.xyww, c27
    mad r1.xyw, r1, -c7.w, c7.xyzz
    dp3 r2.y, r5, r5
    rsq r2.y, r2.y
    nrm_pp r6.xyz, r1.xyww
    mad_pp r1.xyw, r5.xyzz, r2.y, r6.xyzz
    dp3_sat_pp r2.y, r6, r4
    nrm_pp r4.xyz, r1.xyww
    dp3_sat_pp r0.x, r0, r4
    mov r1.w, c28.w
    add_pp r0.y, r1.w, c21.x
    pow_pp r1.x, r0.x, r0.y
    mov_pp r0.x, v5.w
    mov_pp r0.y, v6.w
    texld_pp r4, r0, s5
    texldp_pp r5, v3, s6
    dp4_sat_pp r0.x, r5, c9
    add_pp r0.x, -r0.x, c29.z
    mul_sat_pp r0.x, r4.y, r0.x
    mul_pp r0.xyz, r0.x, c8
    mul_pp r1.xyw, r1.x, r0.xyzz
    mul_pp r0.xyz, r2.y, r0
    mul_pp r0.xyz, r2.xzww, r0
    texld_pp r2, v2, s3
    texld_pp r4, v2.zwzw, s3
    lrp r3.w, c28.z, r4.x, r2.x
    mul_pp r2.xyz, r3.w, c22
    mul_pp r2.xyz, r1.z, r2
    mul_pp r2.xyz, r0.w, r2
    mad_pp r0.xyz, r2, r1.xyww, r0
    add_pp oC0.xyz, r3, r0
    add r0.x, -c31.x, v3.w
    mov_pp r1.x, c31.x
    mad_pp oC0.w, c12.x, r0.x, r1.x

// approximately 130 instruction slots used (11 texture, 119 arithmetic)
 

