// sight 
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 difColor;
//   sampler2D mySampler;
//
//
// Registers:
//
//   Name         Reg   Size
//   ------------ ----- ----
//   difColor     c0       1
//   mySampler    s0       1
//
//
// Default values:
//
//   difColor
//     c0   = { 0, 0, 0, 0 };
//

    ps_3_0
//    def c1, -0.996999979, 333, 0, 1.5
	def c1, -0.996999979, 333, 0, 1.5
    def c2, 4, 1, 85.3333359, 10	
// key for scale : 0=> std; 1 => /2, 2 => /3
def c3, 0, 1, 2, 0
//standard settings
// unused, scale, dx, dy
def c4, 1, 0, 0, 1
// divide by 2 settings (BF109)
def c5, 1.0, 0, 2, 3.0
// divide by 2 settings (Lagg)
def c6, 1.0, -1.0, 4, 5

    dcl_texcoord1 v1.xyz
    dcl_texcoord v0.xy
    dcl_texcoord2 v2.xyz
	dcl vPos.xy
    dcl_2d s0
    texld r0, v0, s0
    nrm r1.xyz, v1
    nrm r2.xyz, v2
    dp3 r1.x, r1, r2
    add r1.y, -r1.x, c1.x
    mul_sat r1.y, r1.y, c1.y
    cmp r1.x, -r1.x, r1.y, c1.z
    pow r2.x, r1.x, c1.w
    mad r1.x, r2.x, c2.x, c2.y
    mul r0.xyz, r0, r1.x
    mad r0.w, r0.w, -c2.z, c2.y
    mul_sat r0.w, r0.w, c2.w
    mul r0.xyz, r0, c0
    mul r0.xyz, r0.w, r0
    mov r0.w, c1.z
    mov oC0, r0
// set sight clipping info regarding value of c221.y (const2)
// by befault c3 (no corrections)
mov r6, c4
mov r5.y, c221.y
if_eq r5.y, c3.y
// const=1 => div by 2 scale
mov r6, c5
endif
if_eq r5.y, c3.z
// const=2 => div by 3 scale
mov r6, c6
endif	
	
// mov r3.xy, vPos.xy
mov r3.xy, v0.xy
if_ge r3.x, r6.x
mov oC0, c1.zzzz
endif
if_le r3.x, r6.y
mov oC0, c1.zzzz
endif
if_le r3.y, r6.z
mov oC0, c1.zzzz
endif
if_ge r3.y, r6.w
mov oC0, c1.zzzz
endif
// mov oC0, c2.yyyy
// mov oC0, c1.zzzz
// approximately 22 instruction slots used (1 texture, 21 arithmetic)
