//Motion blur PS.
// ---- Created with 3Dmigoto v1.3.16 on Sun Dec 25 20:49:32 2022



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


void main(
  float4 v0 : SV_Position0,
  float2 v1 : TEXCOORD0,
  float2 w1 : TEXCOORD1,
  float3 v2 : POSITION0,
  float w2 : MASK0,
  float4 v3 : POSITION1,
  float4 v4 : POSITION2,
  float4 v5 : STYLES0,
  float4 v6 : PLANE0,
  out float4 o1 : SV_Target1,
  out float o2 : SV_Target2)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  float4 prev = StereoParams.Load(int3(2,0,0));
  
  v3.x+=stereo.x*(v3.w-stereo.y);
  if (prev.x>5.0) {
    v4.x+=stereo.x*(v4.w-stereo.y);
  } else {
    v4.x+=prev.x*(v4.w-prev.y);
  }
  
  r0.xy = v3.xy / v3.ww;
  r0.zw = v4.xy / v4.ww;
  r1.xy = r0.xw + -r0.zy;
  r0.xy = r1.xy * float2(0.5,0.5) + float2(0.5,0.5);
  r0.zw = r0.xy * r0.xy;
  o1.xy = r0.xy * r0.zw;
  o2.x = w2.x;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Sun Dec 25 20:49:32 2022
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xy          1     NONE   float
// TEXCOORD                 1     zw        1     NONE   float
// POSITION                 0   xyz         2     NONE   float
// MASK                     0      w        2     NONE   float      w
// POSITION                 1   xyzw        3     NONE   float   xy w
// POSITION                 2   xyzw        4     NONE   float   xy w
// STYLES                   0   xyzw        5     NONE   float
// PLANE                    0   xyzw        6     NONE   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                1   xyzw        1   TARGET   float   xy
// SV_Target                2   x           2   TARGET   float   x
//
ps_4_0
dcl_input_ps linear v2.w
dcl_input_ps linear v3.xyw
dcl_input_ps linear v4.xyw
dcl_output o1.xy
dcl_output o2.x
dcl_temps 2
div r0.xy, v3.xyxx, v3.wwww
div r0.zw, v4.xxxy, v4.wwww
add r1.xy, -r0.zyzz, r0.xwxx
mad r0.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
mul r0.zw, r0.xxxy, r0.xxxy
mul o1.xy, r0.zwzz, r0.xyxx
mov o2.x, v2.w
ret
// Approximately 8 instruction slots used

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