//hud, ui, bloom
// ---- Created with 3Dmigoto v1.2.67 on Fri Dec 01 16:17:55 2017



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


void main(
  float4 v0 : POSITION0,
  uint4 v1 : COLOR0,
  uint4 v2 : COLOR1,
  float4 v3 : TEXCOORD0,
  float2 v4 : TEXCOORD1,
  out float4 o0 : TEXCOORD6,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : SV_Position0)
{
  float4 r0,r9,r10,r11,r12,r13,r14,r15;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = (uint4)v1.zyxw;
  o0.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r0.xyzw;
  o1.xy = v3.xy;
  o1.zw = float2(1,1);
  r0.xyz = v0.xyz;
  r0.w = 1;
  r10.xyzw = r0.xyzw / v0.wwww;

r9 = r10;
r12 = r10;
r13 = r10;
r14 = r10; 
r15 = r10; 

float4 params = IniParams.Load(0);
float4 stereo = StereoParams.Load(0);
float4 hud = IniParams.Load(int2(2, 0));

r11.x = 1 + abs(0.99 * 0.1175);
r11.y = 1 + abs(params.z * 0.1175);
r11.z = 1 + abs(params.w * 0.1175);

if(stereo.x !=0){
r12.x = r12.x * r11.x;
if(r9.x < -0.997){r13.x = r13.x * r11.y;}
if(r9.x > 0.997){r13.x = r13.x * r11.y;}
}

r12.x+=stereo.x * 0.99;
r13.x+=stereo.x*params.z;
r14.x+=stereo.x*params.w;
r15.x+=stereo.x * 0.99;

//hud & ui
if(hud.x == 1){
r10 = r13;
}

//bloom & sun
if(hud.x == 0 && hud.y == 0){
r10 = r15;
}

//red bloom & yellow circle highlight
if(hud.y == 40){
r10 = r15;
}

//blood splatter effect
if(hud.y == 2){
r10 = r9;
}

//crosshair----------------
if(hud.y == 3 && r9.x > -0.2 && r9.x < 0.2 && r9.y > -0.2 && r9.y < 0.2){
r10 = r14;
}
//--------------------------------------


o2 = r10;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.67 on Fri Dec 01 16:17:55 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// COLOR                    0   xyzw        1     NONE    uint   xyzw
// COLOR                    1   xyzw        2     NONE    uint       
// TEXCOORD                 0   xy          3     NONE   float   xy  
// TEXCOORD                 1   xy          4     NONE   float       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 6   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// SV_Position              0   xyzw        2      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_input v3.xy
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output_siv o2.xyzw, position
dcl_temps 1
utof r0.xyzw, v1.zyxw
mul o0.xyzw, r0.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886)
mov o1.xy, v3.xyxx
mov o1.zw, l(0,0,1.000000,1.000000)
mov r0.xyz, v0.xyzx
mov r0.w, l(1.000000)
div o2.xyzw, r0.xyzw, v0.wwww
ret 
// Approximately 0 instruction slots used

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