// ---- Created with 3Dmigoto v1.3.16 on Sat May 22 16:45:28 2021
Texture2D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb1 : register(b1)
{
  float4 cb1[142];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[3];
}




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


void main(
  float2 v0 : TEXCOORD0,
  float4 v1 : SV_POSITION0,
  out float4 o0 : SV_Target0,
  out float2 o1 : SV_Target1)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  
  r0.xyz = cb0[1].xyz + -cb0[0].xyz;
  r1.xy = v0.xy;
  r2.xy = (int2)v1.xy;
  r2.zw = float2(0,0);
  
  
  
  r1.z = t0.Load(r2.xyw).x;
  r2.xyz = t1.Load(r2.xyz).xyz;
  r0.w = dot(r2.xyz, cb0[2].xyz);
  r0.xyz = r1.xyz * r0.xyz + cb0[0].xyz;
  o0.y = r1.z;
  r0.xy = cb1[138].yy * r0.xy;
  r0.z = r0.z * cb1[138].y + -cb1[138].z;
  r0.xy = -cb1[141].zw * r0.zz + r0.xy;
  r1.xy = float2(-1,1) * cb1[141].yx;
  
  //r1.x+=stereo.x*2560;
  
  r1.y = dot(r1.xy, r0.xy);
  r1.x = dot(cb1[141].xy, r0.xy);
  r0.x = cb1[140].w * cb1[138].y;
  r0.y = cb1[139].w * cb1[138].y;
  r0.xy = r1.xy + -r0.xy;
  r1.xy = float2(1,1) + abs(r0.xy);
  r0.xy = r0.xy / r1.xy;
  r0.xy = r0.xy * float2(0.5,0.5) + float2(0.5,0.5);
  r0.x = t3.SampleLevel(s0_s, r0.xy, 0).x;
  r0.x = r0.x * r0.x;
  r0.x = saturate(r0.x * 4 + 0.0250000004);
  r0.y = saturate(-r0.w * 2 + 2);
  r1.x = r0.w + r0.w;
  r1.x = saturate(r1.x);
  r1.z = r0.x * r0.y;
  o0.xz = r1.xz;
  o1.xy = r1.xz;
  
  r0.xyzw = v0.xyxy * float4(2,2,2,2) + float4(-0.5,-0.5,-1,-1);
  r0.z = max(abs(r0.z), abs(r0.w));
  r0.x = t2.SampleLevel(s1_s, r0.xy, 0).x;
  r0.y = saturate(r0.z * 4 + -1);
  r0.z = 1 + -r0.x;
  o0.w = r0.y * r0.z + r0.x;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Sat May 22 16:45:28 2021
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy
// SV_POSITION              0   xyzw        1      POS   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xy          1   TARGET   float   xy
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[3], immediateIndexed
dcl_constantbuffer cb1[142], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_ps linear v0.xy
dcl_input_ps_siv linear noperspective v1.xy, position
dcl_output o0.xyzw
dcl_output o1.xy
dcl_temps 3
add r0.xyz, -cb0[0].xyzx, cb0[1].xyzx
mov r1.xy, v0.xyxx
ftoi r2.xy, v1.xyxx
mov r2.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.z, r2.xyww, t0.yzxw
ld_indexable(texture2d)(float,float,float,float) r2.xyz, r2.xyzw, t1.xyzw
dp3 r0.w, r2.xyzx, cb0[2].xyzx
mad r0.xyz, r1.xyzx, r0.xyzx, cb0[0].xyzx
mov o0.y, r1.z
mul r0.xy, r0.xyxx, cb1[138].yyyy
mad r0.z, r0.z, cb1[138].y, -cb1[138].z
mad r0.xy, -cb1[141].zwzz, r0.zzzz, r0.xyxx
mul r1.xy, cb1[141].yxyy, l(-1.000000, 1.000000, 0.000000, 0.000000)
dp2 r1.y, r1.xyxx, r0.xyxx
dp2 r1.x, cb1[141].xyxx, r0.xyxx
mul r0.x, cb1[138].y, cb1[140].w
mul r0.y, cb1[138].y, cb1[139].w
add r0.xy, -r0.xyxx, r1.xyxx
add r1.xy, |r0.xyxx|, l(1.000000, 1.000000, 0.000000, 0.000000)
div r0.xy, r0.xyxx, r1.xyxx
mad r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t3.xyzw, s0, l(0.000000)
mul r0.x, r0.x, r0.x
mad_sat r0.x, r0.x, l(4.000000), l(0.025000)
mad_sat r0.y, -r0.w, l(2.000000), l(2.000000)
add r1.x, r0.w, r0.w
mov_sat r1.x, r1.x
mul r1.z, r0.y, r0.x
mov o0.xz, r1.xxzx
mov o1.xy, r1.xzxx
mad r0.xyzw, v0.xyxy, l(2.000000, 2.000000, 2.000000, 2.000000), l(-0.500000, -0.500000, -1.000000, -1.000000)
max r0.z, |r0.w|, |r0.z|
sample_l_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t2.xyzw, s1, l(0.000000)
mad_sat r0.y, r0.z, l(4.000000), l(-1.000000)
add r0.z, -r0.x, l(1.000000)
mad o0.w, r0.y, r0.z, r0.x
ret
// Approximately 0 instruction slots used

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
