//Cutscenes blur in DMC3.
// ---- Created with 3Dmigoto v1.3.7 on Sun Mar 25 13:18:25 2018

SamplerState sampler_Ztexture_s : register(s0);
SamplerState sampler_COLtexture_s : register(s1);
Texture2D<float4> Ztexture : register(t0);
Texture2D<float4> COLtexture : register(t1);


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


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : COLOR0,
  float4 v2 : TEXCOORD0,
  float4 v3 : TEXCOORD1,
  float2 v4 : TEXCOORD2,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 iniparams1 = IniParams.Load(int2(1,0));
  if (iniparams1.w==0)
  {
	discard;
  }
  
  r0.x = Ztexture.Sample(sampler_Ztexture_s, v4.xy).x;
  r0.x = r0.x;
  r0.x = r0.x;
  r0.xy = v3.xz * r0.xx;
  r0.xy = v3.yw + r0.xy;
  r0.xy = max(float2(0,0), r0.xy);
  r0.xy = min(float2(1,1), r0.xy);
  r0.x = r0.x + r0.y;
  r0.y = r0.x * r0.x;
  r0.x = r0.y * r0.x;
  r0.x = max(0, r0.x);
  r0.w = min(1, r0.x);
  r1.zw = int2(0,0);
  r1.xy = float2(-0.00033333333,-0.00059259258);
  r1.xyzw = v2.xyxy + r1.xyzw;
  r2.xyz = COLtexture.Sample(sampler_COLtexture_s, r1.xy).xyz;
  r2.xyz = r2.xyz;
  r1.xyz = COLtexture.Sample(sampler_COLtexture_s, r1.zw).xyz;
  r1.xyz = r2.xyz + r1.xyz;
  r0.xyz = float3(0.5,0.5,0.5) * r1.xyz;
  r0.xyzw = v1.xyzw * r0.xyzw;
  o0.xyzw = r0.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.7 on Sun Mar 25 13:18:25 2018
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sampler_Ztexture                  sampler      NA          NA    0        1
// sampler_COLtexture                sampler      NA          NA    1        1
// Ztexture                          texture  float4          2d    0        1
// COLtexture                        texture  float4          2d    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xyzw        2     NONE   float   xy
// TEXCOORD                 1   xyzw        3     NONE   float   xyzw
// TEXCOORD                 2   xy          4     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 | skipOptimization
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.xyzw
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v4.xy
dcl_output o0.xyzw
dcl_temps 3
//
// Initial variable locations:
//   v0.x <- pi.pos.x; v0.y <- pi.pos.y; v0.z <- pi.pos.z; v0.w <- pi.pos.w;
//   v1.x <- pi.rgba.x; v1.y <- pi.rgba.y; v1.z <- pi.rgba.z; v1.w <- pi.rgba.w;
//   v2.x <- pi.texcoord.x; v2.y <- pi.texcoord.y; v2.z <- pi.texcoord.z; v2.w <- pi.texcoord.w;
//   v3.x <- pi.limits.x; v3.y <- pi.limits.y; v3.z <- pi.limits.z; v3.w <- pi.limits.w;
//   v4.x <- pi.screenUV.x; v4.y <- pi.screenUV.y;
//   o0.x <- <main return value>.x; o0.y <- <main return value>.y; o0.z <- <main return value>.z; o0.w <- <main return value>.w
//
#line 45 "C:\dev\dmc\dmc3\code\dmc3\source\dmc3nb\shaders\hlsl\ps\FX_DOF.hlsl"
sample_indexable(texture2d)(float,float,float,float) r0.x, v4.xyxx, t0.xyzw, s0
mov r0.x, r0.x  // r0.x <- z.x
mov r0.x, r0.x  // r0.x <- d

#line 51
mul r0.xy, r0.xxxx, v3.xzxx
add r0.xy, r0.xyxx, v3.ywyy
max r0.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
min r0.xy, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)  // r0.x <- c.x; r0.y <- c.y

#line 54
add r0.x, r0.y, r0.x  // r0.x <- color.w
mul r0.y, r0.x, r0.x
mul r0.x, r0.x, r0.y
max r0.x, r0.x, l(0.000000)
min r0.w, r0.x, l(1.000000)  // r0.w <- color.w
itof r1.zw, l(0, 0, 0, 0)
mov r1.xy, l(-0.000333,-0.000593,0,0)
add r1.xyzw, r1.xyzw, v2.xyxy  // r1.x <- temp.x; r1.y <- temp.y; r1.z <- temp.z; r1.w <- temp.w
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r1.xyxx, t1.xyzw, s1
mov r2.xyz, r2.xyzx  // r2.x <- col.x; r2.y <- col.y; r2.z <- col.z
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.zwzz, t1.xyzw, s1
add r1.xyz, r1.xyzx, r2.xyzx  // r1.x <- col.x; r1.y <- col.y; r1.z <- col.z
mul r0.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)  // r0.x <- color.x; r0.y <- color.y; r0.z <- color.z

#line 70
mul r0.xyzw, r0.xyzw, v1.xyzw
mov o0.xyzw, r0.xyzw
ret
// Approximately 23 instruction slots used

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