// ---- Created with 3Dmigoto v1.3.1 on Tue Jun 05 23:11:25 2018 // Shadowmove ps

cbuffer shadowmove_v2_PSConstants : register(b0)
{
  float4 m_tint : packoffset(c0);
  float2 m_forwardMotionDir : packoffset(c1);
  float2 m_viewportScale : packoffset(c1.z);
}

SamplerState coreBuffer_sampler_s : register(s0);
SamplerState colorTexture_sampler_s : register(s1);
SamplerState refractionBuffer_sampler_s : register(s2);
SamplerState wispBuffer_sampler_s : register(s3);
Texture2D<float4> coreBuffer : register(t0);
Texture2D<float4> colorTexture : register(t1);
Texture2D<float4> refractionBuffer : register(t2);
Texture2D<float4> wispBuffer : register(t3);


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


void main(
  float4 v0 : TEXCOORD0,
  float4 v1 : SV_POSITION0,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  r0.xy = m_viewportScale.xy * v0.xy;
  r1.z = 15;
  r2.xyzw = coreBuffer.Sample(coreBuffer_sampler_s, v0.xy).yzxw;
  r3.xyzw = float4(0.25,-0.5,-0.5,-0.800000012) + r2.wxyw;
  r1.xy = r3.yz + r3.yz;
  r0.z = dot(r1.xyz, r1.xyz);
  r0.z = rsqrt(r0.z);
  r1.xz = r1.xy * r0.zz;
  r0.z = r1.y * r0.z + 0.0399999991;
  r0.z = r0.z * 20 + 1;
  r1.xy = r1.xz * float2(1.10000002,-1.10000002) + r0.xy;
  r4.xyzw = refractionBuffer.Sample(refractionBuffer_sampler_s, r0.xy).xyzw;
  r0.xyw = refractionBuffer.Sample(refractionBuffer_sampler_s, r1.xy).xyz;
  r1.x = dot(r0.xyw, float3(0.300000012,0.589999974,0.109999999));
  r0.xyw = r0.xyw + -r4.xyz;
  r0.xyw = r2.zzz * r0.xyw + r4.xyz;
  o0.w = r4.w;
  r1.x = r1.x * 2 + -1;
  r1.x = 2.1991148 * r1.x;
  r1.x = sin(-r1.x);
  r1.x = -1 + r1.x;
  r1.x = 0.150000006 * r1.x;
  r1.y = r2.w + -r2.z;
  r1.y = r1.y * 0.529999971 + r2.z;
  r3.x = saturate(r3.x);
  r1.z = saturate(5.00000048 * r3.w);
  r2.x = saturate(r1.x * r3.x + r1.y);
  r2.yw = float2(1,1);
  r1.xyw = colorTexture.SampleLevel(colorTexture_sampler_s, r2.xy, 0).xyz;
  r2.x = colorTexture.SampleLevel(colorTexture_sampler_s, r2.zw, 0).w;
  r1.xyw = r1.xyw * r0.zzz;
  r0.z = r1.z * -2 + 3;
  r1.z = r1.z * r1.z;
  r0.z = r1.z * r0.z;
  r0.z = r0.z * 0.100000001 + 1;
  r1.xyz = r1.xyw * r0.zzz + -r0.xyw;
  r0.xyz = r2.xxx * r1.xyz + r0.xyw;
  r1.xy = saturate(v0.xy);
  r1.xy = wispBuffer.Sample(wispBuffer_sampler_s, r1.xy).xy;
  r2.x = saturate(r1.x);
  r2.y = 0;
  r2.xyzw = colorTexture.SampleLevel(colorTexture_sampler_s, r2.xy, 0).xyzw;
  r1.xyzw = r2.xyzw * r1.yyyy;
  r1.xyz = saturate(float3(4,4,4) * r1.xyz);
  r1.xyz = r1.xyz + -r0.xyz;
  o0.xyz = r1.www * r1.xyz + r0.xyz;
float4 params = IniParams.Load(0);
o0 = 0;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//   using 3Dmigoto v1.3.1 on Tue Jun 05 23:11:25 2018
//
//
// Buffer Definitions:
//
// cbuffer shadowmove_v2_PSConstants
// {
//
//   float4 m_tint;                     // Offset:    0 Size:    16 [unused]
//   float2 m_forwardMotionDir;         // Offset:   16 Size:     8 [unused]
//   float2 m_viewportScale;            // Offset:   24 Size:     8
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// coreBuffer_sampler                sampler      NA          NA    0        1
// colorTexture_sampler              sampler      NA          NA    1        1
// refractionBuffer_sampler          sampler      NA          NA    2        1
// wispBuffer_sampler                sampler      NA          NA    3        1
// coreBuffer                        texture  float4          2d    0        1
// colorTexture                      texture  float4          2d    1        1
// refractionBuffer                  texture  float4          2d    2        1
// wispBuffer                        texture  float4          2d    3        1
// shadowmove_v2_PSConstants         cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xyzw        0     NONE   float   xy
// SV_POSITION              0   xyzw        1      POS   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[2], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, 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_output o0.xyzw
dcl_temps 5
mul r0.xy, v0.xyxx, cb0[1].zwzz
mov r1.z, l(15.000000)
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v0.xyxx, t0.yzxw, s0
add r3.xyzw, r2.wxyw, l(0.250000, -0.500000, -0.500000, -0.800000)
add r1.xy, r3.yzyy, r3.yzyy
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xz, r0.zzzz, r1.xxyx
mad r0.z, r1.y, r0.z, l(0.040000)
mad r0.z, r0.z, l(20.000000), l(1.000000)
mad r1.xy, r1.xzxx, l(1.100000, -1.100000, 0.000000, 0.000000), r0.xyxx
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r0.xyxx, t2.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r0.xyw, r1.xyxx, t2.xywz, s2
dp3 r1.x, r0.xywx, l(0.300000, 0.590000, 0.110000, 0.000000)
add r0.xyw, -r4.xyxz, r0.xyxw
mad r0.xyw, r2.zzzz, r0.xyxw, r4.xyxz
mov o0.w, r4.w
mad r1.x, r1.x, l(2.000000), l(-1.000000)
mul r1.x, r1.x, l(2.19911480)
sincos r1.x, null, -r1.x
add r1.x, r1.x, l(-1.000000)
mul r1.x, r1.x, l(0.150000)
add r1.y, -r2.z, r2.w
mad r1.y, r1.y, l(0.530000), r2.z
mov_sat r3.x, r3.x
mul_sat r1.z, r3.w, l(5.00000048)
mad_sat r2.x, r1.x, r3.x, r1.y
mov r2.yw, l(0,1.000000,0,1.000000)
sample_l_indexable(texture2d)(float,float,float,float) r1.xyw, r2.xyxx, t1.xywz, s1, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r2.x, r2.zwzz, t1.wxyz, s1, l(0.000000)
mul r1.xyw, r0.zzzz, r1.xyxw
mad r0.z, r1.z, l(-2.000000), l(3.000000)
mul r1.z, r1.z, r1.z
mul r0.z, r0.z, r1.z
mad r0.z, r0.z, l(0.100000), l(1.000000)
mad r1.xyz, r1.xywx, r0.zzzz, -r0.xywx
mad r0.xyz, r2.xxxx, r1.xyzx, r0.xywx
mov_sat r1.xy, v0.xyxx
sample_indexable(texture2d)(float,float,float,float) r1.xy, r1.xyxx, t3.xyzw, s3
mov_sat r2.x, r1.x
mov r2.y, l(0)
sample_l_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.xyxx, t1.xyzw, s1, l(0.000000)
mul r1.xyzw, r1.yyyy, r2.xyzw
mul_sat r1.xyz, r1.xyzx, l(4.000000, 4.000000, 4.000000, 0.000000)
add r1.xyz, -r0.xyzx, r1.xyzx
mad o0.xyz, r1.wwww, r1.xyzx, r0.xyzx
ret
// Approximately 47 instruction slots used

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