//water sea reflection
Texture2D<float4> t9 : register(t9);

Texture2D<float4> t3 : register(t3);

Texture2D<float4> t0 : register(t0);

SamplerState s9_s : register(s9);

SamplerState s3_s : register(s3);

SamplerState s0_s : register(s0);

cbuffer cb4 : register(b4)
{
  float4 cb4[236];
}

cbuffer cb3 : register(b3)
{
  float4 cb3[77];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : TEXCOORD8,
  linear centroid float4 v2 : COLOR0,
  float4 v3 : COLOR1,
  float4 v4 : TEXCOORD9,
  float4 v5 : TEXCOORD0,
  float4 v6 : TEXCOORD1,
  float4 v7 : TEXCOORD2,
  float4 v8 : TEXCOORD3,
  float4 v9 : TEXCOORD4,
  float4 v10 : TEXCOORD5,
  float4 v11 : TEXCOORD6,
  float4 v12 : TEXCOORD7,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r19;
  uint4 bitmask, uiDest;
  float4 fDest;
  

float4 s = StereoParams.Load(0);
float4 testeo = IniParams.Load(int2(90,0));

 

  r0.xyzw = t9.Sample(s9_s, v5.xy).xyzw;
  r0.xyzw = asfloat(asuint(r0.xyzw) & asuint(cb3[62].xyzw));
  r0.xyzw = asfloat(asuint(r0.xyzw) | asuint(cb3[63].xyzw));
  r1.zw = v9.zw;
  r2.xy = float2(8,8) * v5.xy;
  r2.xyzw = t3.Sample(s3_s, r2.xy).xyzw;
  r2.xyzw = asfloat(asuint(r2.xyzw) & asuint(cb3[50].xyzw));
  r2.xyzw = asfloat(asuint(r2.xyzw) | asuint(cb3[51].xyzw));
  r3.x = r2.w * 2 + -1;
  r3.y = r2.y * 2 + -1;
  r1.xy = r3.xy * float2(0.349999994,0.349999994) + v9.xy;
  r4.xyzw = r1.xyzw / r1.wwww;
  
r4.x += s.x * (1 - s.y / r1.w) * 0.5;   
  
  r1.xyzw = t0.Sample(s0_s, r4.xy).xyzw;
  r1.xyzw = asfloat(asuint(r1.xyzw) & asuint(cb3[44].xyzw));
  r1.xyzw = asfloat(asuint(r1.xyzw) | asuint(cb3[45].xyzw));
  r4.y = log2(abs(r1.x));
  r4.x = (asuint(r4.y) == 0xff800000u) ? 1 : 0;
  r2.x = r4.x ? -9.99999993e+36 : r4.y;
  r4.y = log2(abs(r1.y));
  r4.x = (asuint(r4.y) == 0xff800000u) ? 1 : 0;
  r2.y = r4.x ? -9.99999993e+36 : r4.y;
  r4.y = log2(abs(r1.z));
  r4.x = (asuint(r4.y) == 0xff800000u) ? 1 : 0;
  r2.z = r4.x ? -9.99999993e+36 : r4.y;
  r1.xyz = cb4[9].xxx * r2.xyz;
  r2.x = exp2(r1.x);
  r2.y = exp2(r1.y);
  r2.z = exp2(r1.z);
  r1.xyz = min(float3(4,4,4), r2.xyz);
  r4.y = log2(abs(r0.x));
  r4.x = (asuint(r4.y) == 0xff800000u) ? 1 : 0;
  r2.x = r4.x ? -9.99999993e+36 : r4.y;
  r4.y = log2(abs(r0.y));
  r4.x = (asuint(r4.y) == 0xff800000u) ? 1 : 0;
  r2.y = r4.x ? -9.99999993e+36 : r4.y;
  r4.y = log2(abs(r0.z));
  r4.x = (asuint(r4.y) == 0xff800000u) ? 1 : 0;
  r2.z = r4.x ? -9.99999993e+36 : r4.y;
  r4.xyzw = saturate(v2.xyzw);
  r0.w = r4.w * r0.w;
  r2.xyz = float3(2.20000005,2.20000005,2.20000005) * r2.xyz;
  r5.x = exp2(r2.x);
  r5.y = exp2(r2.y);
  r5.z = exp2(r2.z);
  r6.xyz = -r5.xyz + r1.xyz;
  r2.xyz = cb4[8].xxx * r6.xyz + r5.xyz;
  

 
  
  r6.w = dot(r3.xy, -r3.xy);
  r2.w = 1 + r6.w;
  r6.y = rsqrt(abs(r2.w));
  r6.x = (asuint(r6.y) == 0x7f800000u) ? 1 : 0;
  r2.w = r6.x ? 9.99999993e+36 : r6.y;
  r6.y = (0 < abs(r2.w)) ? 1 : 0;
  r6.x = rcp(r2.w);
  r3.z = r6.y ? r6.x : 9.99999993e+36;
  r2.w = saturate(dot(r3.xyz, v6.xyz));
  r1.xyz = r2.www * r2.xyz;
  

  
  r6.x = dot(v8.xyz, v8.xyz);
  r6.x = rsqrt(r6.x);
  r6.x = (asuint(r6.x) != 0x7f800000u) ? r6.x : 0;
  r2.xyz = v8.xyz * r6.xxx;
  r1.w = saturate(dot(r2.xyz, r3.xyz));
  r1.w = 1 + -r1.w;
  r2.x = r1.w * r1.w;
  r2.x = r2.x * r2.x;
  r1.w = r2.x * r1.w;
  r1.w = r1.w * 0.979600012 + 0.0204000007;
  r2.xyz = r1.www * r4.xyz + r4.xyz;
  r1.xyz = r2.xyz * r1.xyz;
  r6.y = log2(abs(r1.x));
  r6.x = (asuint(r6.y) == 0xff800000u) ? 1 : 0;
  r2.x = r6.x ? -9.99999993e+36 : r6.y;
  r6.y = log2(abs(r1.y));
  r6.x = (asuint(r6.y) == 0xff800000u) ? 1 : 0;
  r2.y = r6.x ? -9.99999993e+36 : r6.y;
  r6.y = log2(abs(r1.z));
  r6.x = (asuint(r6.y) == 0xff800000u) ? 1 : 0;
  r2.z = r6.x ? -9.99999993e+36 : r6.y;
  r1.xyz = cb4[10].xxx * r2.xyz;
  r0.x = exp2(r1.x);
  r0.y = exp2(r1.y);
  r0.z = exp2(r1.z);
  r6.xyzw = r0.xyzw;
  r0.w = saturate(v4.x);
  r0.xyz = -cb3[0].xyz + r6.xyz;
  r6.xyz = r0.www * r0.xyz + cb3[0].xyz;
  o0.xyzw = r6.xyzw;
  return;
}