// flashing on ground
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 g_vKSettings;
//
//
// Registers:
//
//   Name         Reg   Size
//   ------------ ----- ----
//   g_vKSettings c0       1
//
//
// Default values:
//
//   g_vKSettings
//     c0   = { 0, 0, 0, 0 };
//

    // preshader
    // add r0.x, c0.x, (-0.5)
    // cmp ob0.x, r0.x, (0), (1)

// approximately 2 instructions used
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   sampler2D AlphaSampler;
//   float4 ControlData;
//   sampler2D DPattern0Sampler;
//   sampler2D DPattern1Sampler;
//   sampler2D DPattern2Sampler;
//   sampler2D DamageSampler;
//   sampler2D DiffuseSampler;
//   float4x4 g_mPrevObjViewProj;
//   float4x4 g_mViewProj;
//   float4 g_vKSettings;
//
//
// Registers:
//
//   Name               Reg   Size
//   ------------------ ----- ----
//   g_mPrevObjViewProj c0       4
//   g_mViewProj        c4       4
//   g_vKSettings       c8       1
//   ControlData        c9       1
//   DPattern0Sampler   s0       1
//   DPattern1Sampler   s1       1
//   DPattern2Sampler   s2       1
//   DamageSampler      s3       1
//   DiffuseSampler     s4       1
//   AlphaSampler       s5       1
//
//
// Default values:
//
//   g_mPrevObjViewProj
//     c0   = { 0, 0, 0, 0 };
//     c1   = { 0, 0, 0, 0 };
//     c2   = { 0, 0, 0, 0 };
//     c3   = { 0, 0, 0, 0 };
//
//   g_mViewProj
//     c4   = { 0, 0, 0, 0 };
//     c5   = { 0, 0, 0, 0 };
//     c6   = { 0, 0, 0, 0 };
//     c7   = { 0, 0, 0, 0 };
//
//   g_vKSettings
//     c8   = { 0, 0, 0, 0 };
//
//   ControlData
//     c9   = { 0, 0, 0, 0 };
//

    ps_3_0
    def c10, 0, 1, 0.330000013, 0.660000026
    def c11, 0, 1, 0.5, 0.600000024
    def c12, 0.25, 0.5, 0.75, -1
    def c13, 0.300000012, 0, 0, 0
    dcl_texcoord v0.xy
    dcl_texcoord1 v1.xyz
    dcl_texcoord2 v2.xyz
    dcl_texcoord5 v3.xyz
    dcl_texcoord7 v4.xyz
    dcl_texcoord8 v5
    dcl_2d s0
    dcl_2d s1
    dcl_2d s2
    dcl_2d s3
    dcl_2d s4
    dcl_2d s5
    if_ge v1.z, c12.x
      texld r0, v0, s3
      if_ge v1.z, c12.y
        max r1.x, r0.x, r0.y
        mov r0.x, r1.x
      endif
      if_ge v1.z, c12.z
        max r1.x, r0.x, r0.z
        mov r0.x, r1.x
      endif
      add r0.y, -r0.x, c12.z
      cmp r0.y, r0.y, c10.x, c10.y
      if_lt c12.z, r0.x
        mov r0.z, c12.w
        mov r1.x, c10.x
      else
        mov r0.z, c10.x
        if_lt r0.w, c10.z
          texld r2, v1, s0
          mov r1.x, r2.w
        else
          if_lt c10.w, r0.w
            texld r2, v1, s2
            mov r1.x, r2.w
          else
            texld r2, v1, s1
            mov r1.x, r2.w
          endif
        endif
        add r1.z, r0.x, r0.x
        min r0.x, r1.z, -c12.w
      endif
    else
      mov r1.x, c10.x
      mov r0.xyz, c10.x
    endif
    if_ne r0.y, -r0.y
      mov r0.x, r0.z
    endif
    mov r1.y, c12.y
    texld r1, r1.yxzw, s5
    texld r2, v0, s4
    mad r0.yz, r2.w, c11.xxyw, c11.xzxw
    texld r2, r0.yzzw, s5
    add r0.y, r0.x, c12.y
    nrm r3.xyz, v5
    mad r3.xyz, r3, c12.y, c12.y
    if_lt c11.w, r2.z
      lrp r4.x, r0.x, r1.y, r2.y
      nrm r1.xyz, v3
      nrm r5.xyz, v2
      dp3 r0.x, r1, r5
      mov r0.w, c12.w
      mad r0.z, r0.x, -c9.z, -r0.w
      mul r0.x, r0.x, c9.z
      cmp r0.x, r0.x, r0.z, -c12.w
      mul r0.x, r0.x, r0.x
      mul r0.x, r0.x, c9.y
      mul r0.x, r4.x, r0.x
      mad r3.w, r0.x, c12.y, c12.y
    else
      mul r3.w, r2.z, c12.y
    endif
    if b0
      mov r0.xz, c10.x
    else
      mad r1, v4.xyzx, c10.yyyx, c10.xxxy
      dp4 r2.x, r1, c3
      rcp r2.x, r2.x
      dp4 r4.x, r1, c0
      dp4 r4.y, r1, c1
      mul r2.xy, r2.x, r4
      dp4 r2.z, r1, c7
      rcp r2.z, r2.z
      dp4 r4.x, r1, c4
      dp4 r4.y, r1, c5
      mad r0.xw, r4.xyzy, r2.z, -r2.xyzy
      mul r0.z, -r0.w, c8.y
      dp2add r0.w, r0.xzzw, r0.xzzw, c10.x
      rsq r0.w, r0.w
      rcp r1.x, r0.w
      if_lt c13.x, r1.x
        mul r0.w, r0.w, c13.x
        mul r0.xz, r0.w, r0
      endif
    endif
    cmp oC0, r0.y, r3, c10.x
    mul r1, c10.yxxx, v5.w
    cmp oC1, r0.y, r1, c10.x
    cmp oC2.xy, r0.y, r0.xzzw, c10.x
    mov oC2.zw, c10.x

// desactivate oC0 regarding value of c221.z (const3)
mov r5.z, c221.z
if_ne r5.z, c10.x
mov oC0.xyzw, c10.xxxx
endif	
	
// approximately 118 instruction slots used (7 texture, 111 arithmetic)
