//HUD
// ---- Created with 3Dmigoto v1.2.56 on Sat Sep 16 00:47:01 2017

cbuffer PerView : register(b12)
{
  row_major float4x4 global_View : packoffset(c0);
  row_major float4x4 global_Projection : packoffset(c4);
  row_major float4x4 global_ViewProjection : packoffset(c8);
  float4 global_ViewPos : packoffset(c12);
  float4 global_ViewInfo : packoffset(c13);
  float4 global_ScaleAndBias : packoffset(c14);
}

cbuffer CB_PerInstance : register(b0)
{
  row_major float4x4 WorldMatrix : packoffset(c0);
}



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


void main( 
  float3 v0 : POSITION0,
  float4 v1 : COLOR0,
  float2 v2 : TEXCOORD0,
  out float4 o0 : SV_Position0,
  out float4 o1 : COLOR0,
  out float2 o2 : TEXCOORD0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v0.xyz;
  r0.w = 1;
  r1.x = dot(WorldMatrix._m00_m01_m02_m03, r0.xyzw);
  r1.y = dot(WorldMatrix._m10_m11_m12_m13, r0.xyzw);
  r1.z = dot(WorldMatrix._m20_m21_m22_m23, r0.xyzw);
  r1.w = dot(WorldMatrix._m30_m31_m32_m33, r0.xyzw);
  o0.x = dot(global_ViewProjection._m00_m01_m02_m03, r1.xyzw);
  o0.y = dot(global_ViewProjection._m10_m11_m12_m13, r1.xyzw);
  o0.z = dot(global_ViewProjection._m20_m21_m22_m23, r1.xyzw);
  o0.w = dot(global_ViewProjection._m30_m31_m32_m33, r1.xyzw);
  




float4 s = StereoParams.Load(0);
float4 ini = IniParams.Load(0);
float4 KBXB = IniParams.Load(int2(2,0));
float4 KBXB2 = IniParams.Load(int2(3,0));


if (KBXB.w == 1.0)
{
o0.x += s.x * ini.x;
}


if (KBXB.w == 0.0)
{
  if (KBXB2.w == 0.0)
{

//auch anzuwenden auf die anderen shader um die untere bar nach vorne zu holen
if (o0.y < -0.6)
{
o0.x += s.x * ini.x*-4.0;
}
else
{
o0.x += s.x * ini.x*0;
}
}



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


  




  o1.xyzw = v1.xyzw;
  o2.xy = v2.xy;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.2.56 on Sat Sep 16 00:47:01 2017
//
//
// Buffer Definitions: 
//
// cbuffer PerView
// {
//
//   row_major float4x4 global_View;    // Offset:    0 Size:    64 [unused]
//   row_major float4x4 global_Projection;// Offset:   64 Size:    64 [unused]
//   row_major float4x4 global_ViewProjection;// Offset:  128 Size:    64
//   float4 global_ViewPos;             // Offset:  192 Size:    16 [unused]
//   float4 global_ViewInfo;            // Offset:  208 Size:    16 [unused]
//   float4 global_ScaleAndBias;        // Offset:  224 Size:    16 [unused]
//
// }
//
// cbuffer CB_PerInstance
// {
//
//   row_major float4x4 WorldMatrix;    // Offset:    0 Size:    64
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// CB_PerInstance                    cbuffer      NA          NA    0        1
// PerView                           cbuffer      NA          NA   12        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy  
//
vs_4_0
dcl_constantbuffer cb12[12], immediateIndexed
dcl_constantbuffer cb0[4], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyzw
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xy
dcl_temps 2
mov r0.xyz, v0.xyzx
mov r0.w, l(1.000000)
dp4 r1.x, cb0[0].xyzw, r0.xyzw
dp4 r1.y, cb0[1].xyzw, r0.xyzw
dp4 r1.z, cb0[2].xyzw, r0.xyzw
dp4 r1.w, cb0[3].xyzw, r0.xyzw
dp4 o0.x, cb12[8].xyzw, r1.xyzw
dp4 o0.y, cb12[9].xyzw, r1.xyzw
dp4 o0.z, cb12[10].xyzw, r1.xyzw
dp4 o0.w, cb12[11].xyzw, r1.xyzw
mov o1.xyzw, v1.xyzw
mov o2.xy, v2.xyxx
ret 
// Approximately 13 instruction slots used

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