//HUD
// ---- Created with 3Dmigoto v1.2.21 on Sun Jan 03 02:05:05 2016

cbuffer para : register(b0)
{
  float4 world0 : packoffset(c0);
  float4 world1 : packoffset(c1);
  float4 x_off : packoffset(c2);
  float4 texgen_s : packoffset(c3);
  float4 texgen_t : packoffset(c4);
  float4 x3d : packoffset(c5);
  float4 y3d : packoffset(c6);
  float4 w3d : packoffset(c7);
}



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


void main( 
  float4 v0 : POSITION0,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = dot(v0.xyzw, world1.xyzw);
  r0.xyz = y3d.xyz * r0.xxx;
  r0.w = dot(v0.xyzw, world0.xyzw);
  r0.xyz = r0.www * x3d.xyz + r0.xyz;
  r0.xyz = w3d.xyz + r0.xyz;
  r0.z = 1 / r0.z;
  o0.xy = r0.xy * r0.zz;
  o0.z = world0.z;
  o0.w = 1;
  
float4 stereo = StereoParams.Load(0);
float4 ini = IniParams.Load(0);
float4 button_text = IniParams.Load(int2(4,0));
float4 tex_filter = IniParams.Load(int2(2,0));
float4 KBXB = IniParams.Load(int2(2,0));
float4 KBXB2 = IniParams.Load(int2(3,0));








if (KBXB.w == 1.0)
{
  if (tex_filter.x == 2)
    {
    o0.x += stereo.x * ini.x*1.01;
    }

  if (tex_filter.x == 3)
    {
    o0.x += stereo.x * ini.x*0;
    }

    else
    {
    o0.x += stereo.x * ini.x;
    }  

}

if (KBXB.w == 0.0)
{
  if (KBXB2.w == 0.0)
  {
  if(o0.x < 0.65 && o0.x > -0.65 && o0.y < 0.8 && o0.y > -0.6)
    {
       if (tex_filter.x == 3)
        { 
        o0.x += stereo.x * ini.x*0;
        }
      if (tex_filter.x == 4)
        { 
        o0.x += stereo.x * ini.x*0;
        }

    }

     else
        {
        if (o0.y < -0.6)
{
o0.x += stereo.x * ini.x*-4.0;
}
else
{
o0.x += stereo.x * ini.x*0;
}
}
}

  if (KBXB2.w == 1.0)
{
  o0.x += stereo.x * ini.x*0;
}
}

  
  r0.x = dot(texgen_s.xyzw, v0.xyzw);
  r0.y = dot(texgen_t.xyzw, v0.xyzw);
  o1.xy = r0.xy * r0.zz;
  o1.w = r0.z;
  o1.z = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.21 on Sun Jan 03 02:05:05 2016
//
//
// Buffer Definitions: 
//
// cbuffer para
// {
//
//   float4 world0;                     // Offset:    0 Size:    16
//   float4 world1;                     // Offset:   16 Size:    16
//   float4 x_off;                      // Offset:   32 Size:    16 [unused]
//   float4 texgen_s;                   // Offset:   48 Size:    16
//   float4 texgen_t;                   // Offset:   64 Size:    16
//   float4 x3d;                        // Offset:   80 Size:    16
//   float4 y3d;                        // Offset:   96 Size:    16
//   float4 w3d;                        // Offset:  112 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// para                              cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[8], immediateIndexed
dcl_input v0.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_temps 1
dp4 r0.x, v0.xyzw, cb0[1].xyzw
mul r0.xyz, r0.xxxx, cb0[6].xyzx
dp4 r0.w, v0.xyzw, cb0[0].xyzw
mad r0.xyz, r0.wwww, cb0[5].xyzx, r0.xyzx
add r0.xyz, r0.xyzx, cb0[7].xyzx
div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z
mul o0.xy, r0.zzzz, r0.xyxx
mov o0.z, cb0[0].z
mov o0.w, l(1.000000)
dp4 r0.x, cb0[3].xyzw, v0.xyzw
dp4 r0.y, cb0[4].xyzw, v0.xyzw
mul o1.xy, r0.zzzz, r0.xyxx
mov o1.w, r0.z
mov o1.z, l(1.000000)
ret 
// Approximately 15 instruction slots used
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/