//Depth of field 3.
// ---- Created with 3Dmigoto v1.2.64 on Sat Sep 09 19:31:48 2017

cbuffer _Globals : register(b0)
{
  float _sp_alpha : packoffset(c0);
}

SamplerState _tex_color_samplerstate_s : register(s0);
SamplerState _tex_saturation_samplerstate_s : register(s1);
Texture2D<float4> _tex_color : register(t0);
Texture2D<float4> _tex_saturation : 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;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 iniparams = IniParams.Load(0);
  if (iniparams.y==1)
  {
	//discard;
  }
  
  r0.xyz = _tex_color.Sample(_tex_color_samplerstate_s, v1.xy).xyz;
  r0.w = min(r0.y, r0.z);
  r0.w = min(r0.x, r0.w);
  r0.w = -0.00100000005 + r0.w;
  r1.x = max(r0.y, r0.z);
  r1.x = max(r1.x, r0.x);
  r0.w = r1.x + -r0.w;
  r0.w = r0.w / r1.x;
  r1.x = r0.w * 0.875 + 0.0625;
  r1.y = 0.5;
  r1.xyz = _tex_saturation.Sample(_tex_saturation_samplerstate_s, r1.xy).xyz;
  r1.xyz = r1.xyz / r0.www;
  r2.xyz = r1.xyz * r0.xyz;
  r1.xyz = float3(1,1,1) + -r1.xyz;
  r0.w = dot(r0.xyz, float3(0.212500006,0.715399981,0.0720999986));
  r1.xyz = r0.www * r1.xyz + r2.xyz;
  r1.xyz = _sp_alpha * r1.xyz;
  r0.w = 1 + -_sp_alpha;
  o0.xyz = r0.xyz * r0.www + r1.xyz;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20789
//
//   using 3Dmigoto v1.2.64 on Sat Sep 09 19:31:48 2017
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float _sp_alpha;                   // Offset:    0 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// _tex_color_samplerstate           sampler      NA          NA    0        1
// _tex_saturation_samplerstate      sampler      NA          NA    1        1
// _tex_color                        texture  float4          2d    0        1
// _tex_saturation                   texture  float4          2d    1        1
// $Globals                          cbuffer      NA          NA    0        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 cb0[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 3
sample_indexable(texture2d)(float,float,float,float) r0.xyz, v1.xyxx, t0.xyzw, s0
min r0.w, r0.z, r0.y
min r0.w, r0.w, r0.x
add r0.w, r0.w, l(-0.001000)
max r1.x, r0.z, r0.y
max r1.x, r0.x, r1.x
add r0.w, -r0.w, r1.x
div r0.w, r0.w, r1.x
mad r1.x, r0.w, l(0.875000), l(0.062500)
mov r1.y, l(0.500000)
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t1.xyzw, s1
div r1.xyz, r1.xyzx, r0.wwww
mul r2.xyz, r0.xyzx, r1.xyzx
add r1.xyz, -r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
dp3 r0.w, r0.xyzx, l(0.212500, 0.715400, 0.072100, 0.000000)
mad r1.xyz, r0.wwww, r1.xyzx, r2.xyzx
mul r1.xyz, r1.xyzx, cb0[0].xxxx
add r0.w, -cb0[0].x, l(1.000000)
mad o0.xyz, r0.xyzx, r0.wwww, r1.xyzx
mov o0.w, l(1.000000)
ret 
// Approximately 21 instruction slots used

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