//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 AmbientDirVector;
//   float4 AmbientLightAtt;
//   float4 AmbientLightColor;
//   float4 CameraPos;
//   sampler2D Depth_RT;
//   sampler2D Diffuse_RT;
//   float4 DirVector;
//   float4 FixedLightColor;
//   float4 FixedLightColorC;
//   float4 Levels;
//   float4 LightColor;
//   float4 LightPos;
//   sampler2D Normal_RT;
//   sampler2D Specular_RT;
//   row_major float4x4 matViewProjectionInv;
//
//
// Registers:
//
//   Name                 Reg   Size
//   -------------------- ----- ----
//   matViewProjectionInv c0       4
//   CameraPos            c4       1
//   LightPos             c5       1
//   Levels               c6       1
//   LightColor           c7       1
//   DirVector            c8       1
//   AmbientDirVector     c9       1
//   AmbientLightAtt      c10      1
//   AmbientLightColor    c11      1
//   FixedLightColor      c12      1
//   FixedLightColorC     c13      1
//   Depth_RT             s0       1
//   Normal_RT            s1       1
//   Diffuse_RT           s2       1
//   Specular_RT          s3       1
//

    ps_3_0
    def c14, 1.99608612, 2, -1, -0
    def c15, 0.5, 0.500100017, 0.499900013, 1
    def c16, 0.330000013, 0, 0, 0
def c220, 0, 0, 0.0625, 0
dcl_2d s13

    dcl_texcoord2 v0.xyw
    dcl_2d s0
    dcl_2d s1
    dcl_2d s2
    dcl_2d s3
    rcp r0.x, v0.w
    mul r0.xy, r0.x, v0
    mad r1.xy, r0, c15.x, c15.yzzw
    add r1.z, -r1.y, c15.w
    texld r2, r1.xzzw, s0
    mul r3, r0.y, c1
    mad r0, r0.x, c0, r3
    mad r0, r2.x, c2, r0
    add r0, r0, c3


mov r11,r0
rcp r11.w, r11.w
mul r11, r11, r11.w
mul r10, r11.y, c151
mad r10, r11.x, c150, r10
mad r10, r11.z, c152, r10
add r10, r10, c153
texldl r20, c220.z, s13
add r20.y, r10.w, -r20.y
mul r20.x, r20.x, r20.y
add r10.x, r10.x, -r20.x
rcp r11.w, r10.w
mul r10, r10, r11.w
mul r11, r10.y, c155
mad r11, r10.x, c154, r11
mad r11, r10.z, c156, r11
add r11, r11, c157
rcp r10.w, r11.w
mul r11, r11, r10.w
mul r11, r11, r0.w
mov r0, r11
    rcp r0.w, r0.w

    mad r2.xyz, r0, -r0.w, c5
    abs r1.y, c8.w
    cmp r2.xyz, -r1.y, r2, c8
    texld_pp r3, r1.xzzw, s2
    add_pp r3.xyz, r3, r3
    mul_pp r1.y, r3.w, c14.x
    frc_pp r1.y, r1.y
    mad r1.y, r3.w, c14.x, -r1.y
    texld_pp r4, r1.xzzw, s1
    mad_pp r4.xyz, r4, c14.y, c14.z
    nrm_pp r5.xyz, r4
    mad r0.xyz, r0, -r0.w, c4
    dp3 r0.w, r0, r0
    rsq r0.w, r0.w
    texld_pp r4, r1.xzzw, s3
    nrm_pp r6.xyz, r2
    mad_pp r0.xyz, r0, r0.w, r6
    nrm_pp r2.xyz, r0
    dp3_sat_pp r0.x, r5, r6
    dp3_sat_pp r0.y, r5, r2
    mul r0.z, r4.w, c6.z
    pow_sat_pp r1.x, r0.y, r0.z
    mul_pp r0.yzw, r4.xxyz, r1.x
    mul_pp r0.yzw, r0, c6.w
    mad_pp r1.xzw, r0.x, r3.xyyz, r0.yyzw
    mul r1.xzw, r1, c7.xyyz
    mul_sat r2.xy, r3.w, c6.yxzw
    add r2.xy, -r2, c15.w
    mov r4.xyz, c13
    mad_pp r4.xyz, r4, r1.y, c12
    dp3_pp r0.x, r5, c9
    mov r2.w, c15.w
    lrp_sat_pp r1.y, r0.x, r2.w, c10.x
    mad_pp r4.xyz, r1.y, c11, r4
    mul_pp r3.xyz, r3, r4
    mul r2.yzw, r2.y, r3.xxyz
    mad_pp r1.xyz, r1.xzww, r2.x, r2.yzww
    dp3 r0.x, r1, c15.w
    cmp r2, -r0_abs.x, c14.z, c14.w
    texkill r2
    dp3_pp oC0.w, r0.yzww, c16.x
    mov_pp oC0.xyz, r1

// approximately 60 instruction slots used (4 texture, 56 arithmetic)
 
