// ---- Created with 3Dmigoto v1.2.57 on Wed May 10 00:39:39 2017

cbuffer HPixel_Buffer : register(b12)
{
  float4 g_TargetUvParam : packoffset(c0);
}

cbuffer CB : register(b8)
{
  float4 BlurParam : packoffset(c0);
}

SamplerState g_ScatterSampler_s : register(s0);
SamplerState g_Z_TexSampler_s : register(s1);
Texture2D<float4> g_Scatter : register(t0);
Texture2D<float4> g_Z_Tex : register(t1);


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


void main( 
  float4 v0 : SV_POSITION0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = g_Scatter.Sample(g_ScatterSampler_s, v1.xy).xyz;
  r1.w = 0.100000001;
  r0.w = 1;
  r2.xz = float2(0,0);
  r3.xyzw = float4(-3,2,-2,-1) / g_TargetUvParam.wwww;
  r2.yw = r3.xz;
  r2.xyzw = v1.xyxy + r2.xyzw;
  r1.xyz = g_Scatter.Sample(g_ScatterSampler_s, r2.xy).xyz;
  r2.x = g_Z_Tex.Sample(g_Z_TexSampler_s, r2.xy).x;
  r2.y = g_Z_Tex.Sample(g_Z_TexSampler_s, v1.xy).x;
  r2.x = r2.x + -r2.y;
  r2.x = saturate(-abs(r2.x) * BlurParam.x + 1);
  r2.x = log2(r2.x);
  r2.x = BlurParam.y * r2.x;
  r4.w = exp2(r2.x);
  r4.xyz = float3(0.100000001,0.100000001,0.100000001) * r4.www;
  r0.xyzw = r1.xyzw * r4.xyzw + r0.xyzw;
  r1.w = 0.400000006;
  r1.xyz = g_Scatter.Sample(g_ScatterSampler_s, r2.zw).xyz;
  r2.x = g_Z_Tex.Sample(g_Z_TexSampler_s, r2.zw).x;
  r2.x = r2.x + -r2.y;
  r2.x = saturate(-abs(r2.x) * BlurParam.x + 1);
  r2.x = log2(r2.x);
  r2.x = BlurParam.y * r2.x;
  r4.w = exp2(r2.x);
  r4.xyz = float3(0.400000006,0.400000006,0.400000006) * r4.www;
  r0.xyzw = r1.xyzw * r4.xyzw + r0.xyzw;
  r1.w = 0.800000012;
  r4.y = r3.w;
  r4.xz = float2(0,0);
  r2.xz = v1.xy + r4.xy;
  r1.xyz = g_Scatter.Sample(g_ScatterSampler_s, r2.xz).xyz;
  r2.x = g_Z_Tex.Sample(g_Z_TexSampler_s, r2.xz).x;
  r2.x = r2.x + -r2.y;
  r2.x = saturate(-abs(r2.x) * BlurParam.x + 1);
  r2.x = log2(r2.x);
  r2.x = BlurParam.y * r2.x;
  r5.w = exp2(r2.x);
  r5.xyz = float3(0.800000012,0.800000012,0.800000012) * r5.www;
  r0.xyzw = r1.xyzw * r5.xyzw + r0.xyzw;
  r4.w = 1 / g_TargetUvParam.w;
  r1.xy = v1.xy + r4.zw;
  r4.xyz = g_Scatter.Sample(g_ScatterSampler_s, r1.xy).xyz;
  r1.x = g_Z_Tex.Sample(g_Z_TexSampler_s, r1.xy).x;
  r1.x = r1.x + -r2.y;
  r1.x = saturate(-abs(r1.x) * BlurParam.x + 1);
  r1.x = log2(r1.x);
  r1.x = BlurParam.y * r1.x;
  r1.w = exp2(r1.x);
  r4.w = 0.800000012;
  r1.xyz = float3(0.800000012,0.800000012,0.800000012) * r1.www;
  r0.xyzw = r4.xyzw * r1.xyzw + r0.xyzw;
  r1.w = 0.400000006;
  r3.xz = float2(0,0);
  r2.xz = v1.xy + r3.xy;
  r1.xyz = g_Scatter.Sample(g_ScatterSampler_s, r2.xz).xyz;
  r2.x = g_Z_Tex.Sample(g_Z_TexSampler_s, r2.xz).x;
  r2.x = r2.x + -r2.y;
  r2.x = saturate(-abs(r2.x) * BlurParam.x + 1);
  r2.x = log2(r2.x);
  r2.x = BlurParam.y * r2.x;
  r4.w = exp2(r2.x);
  r4.xyz = float3(0.400000006,0.400000006,0.400000006) * r4.www;
  r0.xyzw = r1.xyzw * r4.xyzw + r0.xyzw;
  r3.w = 3 / g_TargetUvParam.w;
  r1.xy = v1.xy + r3.zw;
  r3.xyz = g_Scatter.Sample(g_ScatterSampler_s, r1.xy).xyz;
  r1.x = g_Z_Tex.Sample(g_Z_TexSampler_s, r1.xy).x;
  r1.x = r1.x + -r2.y;
  r1.x = saturate(-abs(r1.x) * BlurParam.x + 1);
  r1.x = log2(r1.x);
  r1.x = BlurParam.y * r1.x;
  r1.w = exp2(r1.x);
  r3.w = 0.100000001;
  r1.xyz = float3(0.100000001,0.100000001,0.100000001) * r1.www;
  r0.xyzw = r3.xyzw * r1.xyzw + r0.xyzw;
  o0.xyzw = r0.xyzw / r0.wwww;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.57 on Wed May 10 00:39:39 2017
//
//
// Buffer Definitions: 
//
// cbuffer HPixel_Buffer
// {
//
//   float4 g_TargetUvParam;            // Offset:    0 Size:    16
//
// }
//
// cbuffer CB
// {
//
//   float4 BlurParam;                  // Offset:    0 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_ScatterSampler                  sampler      NA          NA    0        1
// g_Z_TexSampler                    sampler      NA          NA    1        1
// g_Scatter                         texture  float4          2d    0        1
// g_Z_Tex                           texture  float4          2d    1        1
// CB                                cbuffer      NA          NA    8        1
// HPixel_Buffer                     cbuffer      NA          NA   12        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float       
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
//
// 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 cb12[1], immediateIndexed
dcl_constantbuffer cb8[1], 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_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 6
sample_indexable(texture2d)(float,float,float,float) r0.xyz, v1.xyxx, t0.xyzw, s0
mov r1.w, l(0.100000)
mov r0.w, l(1.000000)
mov r2.xz, l(0,0,0,0)
div r3.xyzw, l(-3.000000, 2.000000, -2.000000, -1.000000), cb12[0].wwww
mov r2.yw, r3.xxxz
add r2.xyzw, r2.xyzw, v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r2.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t1.xyzw, s1
sample_indexable(texture2d)(float,float,float,float) r2.y, v1.xyxx, t1.yxzw, s1
add r2.x, -r2.y, r2.x
mad_sat r2.x, -|r2.x|, cb8[0].x, l(1.000000)
log r2.x, r2.x
mul r2.x, r2.x, cb8[0].y
exp r4.w, r2.x
mul r4.xyz, r4.wwww, l(0.100000, 0.100000, 0.100000, 0.000000)
mad r0.xyzw, r1.xyzw, r4.xyzw, r0.xyzw
mov r1.w, l(0.400000)
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r2.zwzz, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.zwzz, t1.xyzw, s1
add r2.x, -r2.y, r2.x
mad_sat r2.x, -|r2.x|, cb8[0].x, l(1.000000)
log r2.x, r2.x
mul r2.x, r2.x, cb8[0].y
exp r4.w, r2.x
mul r4.xyz, r4.wwww, l(0.400000, 0.400000, 0.400000, 0.000000)
mad r0.xyzw, r1.xyzw, r4.xyzw, r0.xyzw
mov r1.w, l(0.800000)
mov r4.y, r3.w
mov r4.xz, l(0,0,0,0)
add r2.xz, r4.xxyx, v1.xxyx
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r2.xzxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xzxx, t1.xyzw, s1
add r2.x, -r2.y, r2.x
mad_sat r2.x, -|r2.x|, cb8[0].x, l(1.000000)
log r2.x, r2.x
mul r2.x, r2.x, cb8[0].y
exp r5.w, r2.x
mul r5.xyz, r5.wwww, l(0.800000, 0.800000, 0.800000, 0.000000)
mad r0.xyzw, r1.xyzw, r5.xyzw, r0.xyzw
div r4.w, l(1.000000, 1.000000, 1.000000, 1.000000), cb12[0].w
add r1.xy, r4.zwzz, v1.xyxx
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r1.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t1.xyzw, s1
add r1.x, -r2.y, r1.x
mad_sat r1.x, -|r1.x|, cb8[0].x, l(1.000000)
log r1.x, r1.x
mul r1.x, r1.x, cb8[0].y
exp r1.w, r1.x
mov r4.w, l(0.800000)
mul r1.xyz, r1.wwww, l(0.800000, 0.800000, 0.800000, 0.000000)
mad r0.xyzw, r4.xyzw, r1.xyzw, r0.xyzw
mov r1.w, l(0.400000)
mov r3.xz, l(0,0,0,0)
add r2.xz, r3.xxyx, v1.xxyx
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r2.xzxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xzxx, t1.xyzw, s1
add r2.x, -r2.y, r2.x
mad_sat r2.x, -|r2.x|, cb8[0].x, l(1.000000)
log r2.x, r2.x
mul r2.x, r2.x, cb8[0].y
exp r4.w, r2.x
mul r4.xyz, r4.wwww, l(0.400000, 0.400000, 0.400000, 0.000000)
mad r0.xyzw, r1.xyzw, r4.xyzw, r0.xyzw
div r3.w, l(3.000000), cb12[0].w
add r1.xy, r3.zwzz, v1.xyxx
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r1.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t1.xyzw, s1
add r1.x, -r2.y, r1.x
mad_sat r1.x, -|r1.x|, cb8[0].x, l(1.000000)
log r1.x, r1.x
mul r1.x, r1.x, cb8[0].y
exp r1.w, r1.x
mov r3.w, l(0.100000)
mul r1.xyz, r1.wwww, l(0.100000, 0.100000, 0.100000, 0.000000)
mad r0.xyzw, r3.xyzw, r1.xyzw, r0.xyzw
div o0.xyzw, r0.xyzw, r0.wwww
ret 
// Approximately 78 instruction slots used

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