//Bloom.
// ---- Created with 3Dmigoto v1.2.64 on Fri Sep 08 20:36:40 2017

SamplerState src_texture_samplerstate_s : register(s0);
SamplerState additive_texture_samplerstate_s : register(s1);
SamplerState shadow_color_texture_samplerstate_s : register(s2);
Texture2D<float4> src_texture : register(t0);
Texture2D<float4> additive_texture : register(t1);
Texture2D<float4> shadow_color_texture : register(t2);


// 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.w==1)
  {
	discard;
  }
  
  r0.x = additive_texture.Sample(additive_texture_samplerstate_s, v1.xy).w;
  r0.x = r0.x * r0.x;
  r1.xyzw = shadow_color_texture.Sample(shadow_color_texture_samplerstate_s, v1.xy).xyzw;
  r2.xyzw = float4(1,1,1,1) + -r1.xyzw;
  r0.xyzw = r0.xxxx * r2.xyzw + r1.xyzw;
  r1.x = cmp(0 != r1.w);
  r2.xyzw = src_texture.Sample(src_texture_samplerstate_s, v1.xy).xyzw;
  r0.xyzw = r2.xyzw * r0.xyzw;
  o0.xyzw = r1.xxxx ? r0.xyzw : r2.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20789
//
//   using 3Dmigoto v1.2.64 on Fri Sep 08 20:36:40 2017
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// src_texture_samplerstate          sampler      NA          NA    0        1
// additive_texture_samplerstate     sampler      NA          NA    1        1
// shadow_color_texture_samplerstate    sampler      NA          NA    2        1
// src_texture                       texture  float4          2d    0        1
// additive_texture                  texture  float4          2d    1        1
// shadow_color_texture              texture  float4          2d    2        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_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, 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_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 3
sample_indexable(texture2d)(float,float,float,float) r0.x, v1.xyxx, t1.wxyz, s1
mul r0.x, r0.x, r0.x
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v1.xyxx, t2.xyzw, s2
add r2.xyzw, -r1.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
mad r0.xyzw, r0.xxxx, r2.xyzw, r1.xyzw
ne r1.x, l(0.000000, 0.000000, 0.000000, 0.000000), r1.w
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v1.xyxx, t0.xyzw, s0
mul r0.xyzw, r0.xyzw, r2.xyzw
movc o0.xyzw, r1.xxxx, r0.xyzw, r2.xyzw
ret 
// Approximately 10 instruction slots used

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