//Depth of field real 2.
// ---- Created with 3Dmigoto v1.3.16 on Sat May 11 20:40:31 2019

cbuffer _Globals : register(b0)
{
  float2 fParam_DepthCastScaleOffset : packoffset(c0) = {1,0};
  float4 fParam_DepthOfFieldFactorScaleOffset : packoffset(c1) = {0.5,0.5,2,-1};
  float4 fParam_HDRFormatFactor_LOGRGB : packoffset(c2);
  float4 fParam_HDRFormatFactor_RGBALUM : packoffset(c3);
  float4 fParam_HDRFormatFactor_REINHARDRGB : packoffset(c4);
  float2 fParam_ScreenSpaceScale : packoffset(c5) = {1,-1};
  float4x4 m44_ModelViewProject : packoffset(c6);
  float4 fParam_GammaCorrection : packoffset(c10) = {0.454545468,0.454545468,0.454545468,0.454545468};
  float4 fParam_DitherOffsetScale : packoffset(c11) = {0.00392156886,0.00392156886,-0.00392156886,0};
  float4 fParam_TonemapMaxMappingLuminance : packoffset(c12) = {1,1,1.015625,1};
  float4 fParam_BrightPass_LensDistortion : packoffset(c13);
  float4 afRGBA_Modulate[32] : packoffset(c14);
  float4 afRGBA_Offset[16] : packoffset(c46);
  float4 afUV_TexCoordOffsetV16[16] : packoffset(c62);
  float4x4 m44_ColorTransformMatrix : packoffset(c78);
  float4x4 m44_PreTonemapColorTransformMatrix : packoffset(c82);
  float4x4 m44_PreTonemapGlareColorTransformMatrix : packoffset(c86);
  float4 fParam_VignetteSimulate : packoffset(c90);
  float4 fParam_VignettePowerOfCosine : packoffset(c91);
  float4 afUVWQ_TexCoordScaleOffset[4] : packoffset(c92);
  float4 fParam_PerspectiveFactor : packoffset(c96);
  float fParam_FocusDistance : packoffset(c97);
  float4 fParam_DepthOfFieldConvertDepthFactor : packoffset(c98);
  float2 afXY_DepthOfFieldLevelBlendFactor16[16] : packoffset(c99);
  float fParam_DepthOfFieldLayerMaskThreshold : packoffset(c114.z) = {0.25};
  float fParam_DepthOfFieldFactorThreshold : packoffset(c114.w) = {0.00039999999};
  float4 afParam_TexCoordScaler8[8] : packoffset(c115);
  float4 fRGBA_Constant : packoffset(c123);
  float4 afRGBA_Constant[4] : packoffset(c124);
  float4x4 am44_TransformMatrix[8] : packoffset(c128);
  float4 afUV_TexCoordOffsetP32[96] : packoffset(c160);
}

SamplerState asamp2D_Texture_s : register(s0);
Texture2D<float4> atex2D_Texture : register(t0);


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


void main(
  float2 v0 : TEXCOORD0,
  out float4 o0 : SV_TARGET0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 iniparams = IniParams.Load(0);
  if (iniparams.z==1)
  {
	o0.xyzw = 0;
	return;
  }
  
  r0.xyzw = atex2D_Texture.SampleLevel(asamp2D_Texture_s, v0.xy, 0).xyzw;
  r0.w = r0.w * afRGBA_Modulate[0].w + afRGBA_Modulate[1].w;
  o0.xyz = r0.xyz;
  r0.x = max(0, r0.w);
  r0.x = r0.x * r0.x;
  r0.x = 0.25 * r0.x;
  o0.w = min(1, r0.x);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.3.16 on Sat May 11 20:40:31 2019
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float2 fParam_DepthCastScaleOffset;// Offset:    0 Size:     8 [unused]
//      = 0x3f800000 0x00000000
//   float4 fParam_DepthOfFieldFactorScaleOffset;// Offset:   16 Size:    16 [unused]
//      = 0x3f000000 0x3f000000 0x40000000 0xbf800000
//   float4 fParam_HDRFormatFactor_LOGRGB;// Offset:   32 Size:    16 [unused]
//   float4 fParam_HDRFormatFactor_RGBALUM;// Offset:   48 Size:    16 [unused]
//   float4 fParam_HDRFormatFactor_REINHARDRGB;// Offset:   64 Size:    16 [unused]
//   float2 fParam_ScreenSpaceScale;    // Offset:   80 Size:     8 [unused]
//      = 0x3f800000 0xbf800000
//   float4x4 m44_ModelViewProject;     // Offset:   96 Size:    64 [unused]
//   float4 fParam_GammaCorrection;     // Offset:  160 Size:    16 [unused]
//      = 0x3ee8ba2f 0x3ee8ba2f 0x3ee8ba2f 0x3ee8ba2f
//   float4 fParam_DitherOffsetScale;   // Offset:  176 Size:    16 [unused]
//      = 0x3b808081 0x3b808081 0xbb808081 0x00000000
//   float4 fParam_TonemapMaxMappingLuminance;// Offset:  192 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f820000 0x3f800000
//   float4 fParam_BrightPass_LensDistortion;// Offset:  208 Size:    16 [unused]
//   float4 afRGBA_Modulate[32];        // Offset:  224 Size:   512
//   float4 afRGBA_Offset[16];          // Offset:  736 Size:   256 [unused]
//   float4 afUV_TexCoordOffsetV16[16]; // Offset:  992 Size:   256 [unused]
//   float4x4 m44_ColorTransformMatrix; // Offset: 1248 Size:    64 [unused]
//   float4x4 m44_PreTonemapColorTransformMatrix;// Offset: 1312 Size:    64 [unused]
//   float4x4 m44_PreTonemapGlareColorTransformMatrix;// Offset: 1376 Size:    64 [unused]
//   float4 fParam_VignetteSimulate;    // Offset: 1440 Size:    16 [unused]
//   float4 fParam_VignettePowerOfCosine;// Offset: 1456 Size:    16 [unused]
//   float4 afUVWQ_TexCoordScaleOffset[4];// Offset: 1472 Size:    64 [unused]
//   float4 fParam_PerspectiveFactor;   // Offset: 1536 Size:    16 [unused]
//   float fParam_FocusDistance;        // Offset: 1552 Size:     4 [unused]
//   float4 fParam_DepthOfFieldConvertDepthFactor;// Offset: 1568 Size:    16 [unused]
//   float2 afXY_DepthOfFieldLevelBlendFactor16[16];// Offset: 1584 Size:   248 [unused]
//   float fParam_DepthOfFieldLayerMaskThreshold;// Offset: 1832 Size:     4 [unused]
//      = 0x3e800000
//   float fParam_DepthOfFieldFactorThreshold;// Offset: 1836 Size:     4 [unused]
//      = 0x39d1b717
//   float4 afParam_TexCoordScaler8[8]; // Offset: 1840 Size:   128 [unused]
//   float4 fRGBA_Constant;             // Offset: 1968 Size:    16 [unused]
//   float4 afRGBA_Constant[4];         // Offset: 1984 Size:    64 [unused]
//   float4x4 am44_TransformMatrix[8];  // Offset: 2048 Size:   512 [unused]
//   float4 afUV_TexCoordOffsetP32[96]; // Offset: 2560 Size:  1536 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// asamp2D_Texture                   sampler      NA          NA    0        1
// atex2D_Texture                    texture  float4          2d    0        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer cb0[16], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xy
dcl_output o0.xyzw
dcl_temps 1
sample_l r0.xyzw, v0.xyxx, t0.xyzw, s0, l(0.000000)
mad r0.w, r0.w, cb0[14].w, cb0[15].w
mov o0.xyz, r0.xyzx
max r0.x, r0.w, l(0.000000)
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, l(0.250000)
min o0.w, r0.x, l(1.000000)
ret
// Approximately 8 instruction slots used

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