//DMC3 bloom 2 PS.
// ---- Created with 3Dmigoto v1.3.7 on Sat Mar 31 18:39:51 2018

SamplerState sampler_COLtexture_s : register(s0);
SamplerState sampler_colScale_s : register(s1);
SamplerState sampler_objID_s : register(s2);
Texture2D<float4> COLtexture : register(t0);
Texture2D<float4> colScale : register(t1);
Texture2D<float4> objID : 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;
  uint4 bitmask, uiDest;
  float4 fDest;

  //float4 iniparams2 = IniParams.Load(int2(2,0));
  //if (iniparams2.x==0 && v0.z<0.0001 && v0.z>-0.0001)
  //{
	//discard;
  //}
  
  r0.xyzw = COLtexture.Sample(sampler_COLtexture_s, v1.xy).xyzw;
  r1.x = colScale.Sample(sampler_colScale_s, r0.yy).w;
  r1.x = r1.x;
  r0.xyz = r1.xxx * r0.xyz;
  r1.xyz = int3(2,2,2);
  r0.xyz = r1.xyz * r0.xyz;
  r0.xyz = max(float3(0,0,0), r0.xyz);
  r0.xyz = min(float3(1,1,1), r0.xyz);
  r0.w = objID.Sample(sampler_objID_s, r0.ww).w;
  r0.w = r0.w;
  r0.xyz = r0.xyz * r0.www;
  r1.xyz = int3(2,2,2);
  r0.xyz = r1.xyz * r0.xyz;
  r0.xyz = max(float3(0,0,0), r0.xyz);
  r0.xyz = min(float3(1,1,1), r0.xyz);
  r0.w = 1;
  o0.xyz = r0.xyz;
  o0.w = r0.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.7 on Sat Mar 31 18:39:51 2018
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sampler_COLtexture                sampler      NA          NA    0        1
// sampler_colScale                  sampler      NA          NA    1        1
// sampler_objID                     sampler      NA          NA    2        1
// COLtexture                        texture  float4          2d    0        1
// colScale                          texture  float4          2d    1        1
// objID                             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 | skipOptimization
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 2
//
// 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.texcoord.x; v1.y <- pi.texcoord.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 18 "C:\dev\dmc\dmc3\code\dmc3\source\dmc3nb\shaders\hlsl\ps\FX_GLOW_SETUP.hlsl"
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, v1.xyxx, t0.xyzw, s0  // r0.x <- col.x; r0.y <- col.y; r0.z <- col.z; r0.w <- col.w

#line 21
sample_indexable(texture2d)(float,float,float,float) r1.x, r0.yyyy, t1.wxyz, s1
mov r1.x, r1.x  // r1.x <- a
mul r0.xyz, r0.xyzx, r1.xxxx
itof r1.xyz, l(2, 2, 2, 0)
mul r0.xyz, r0.xyzx, r1.xyzx
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min r0.xyz, r0.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)  // r0.x <- color.x; r0.y <- color.y; r0.z <- color.z
sample_indexable(texture2d)(float,float,float,float) r0.w, r0.wwww, t2.xyzw, s2
mov r0.w, r0.w  // r0.w <- b
mul r0.xyz, r0.wwww, r0.xyzx
itof r1.xyz, l(2, 2, 2, 0)
mul r0.xyz, r0.xyzx, r1.xyzx
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min r0.xyz, r0.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)  // r0.x <- color.x; r0.y <- color.y; r0.z <- color.z
itof r0.w, l(1)  // r0.w <- color.w
mov o0.xyz, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 19 instruction slots used

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