//hud & ui-- subtitles, menu text
// ---- Created with 3Dmigoto v1.2.56 on Mon Mar 20 08:10:04 2017

cbuffer SceneBuffer : register(b0)
{
  float4x4 g_View : packoffset(c0);
  float4x4 g_Proj : packoffset(c4);
  float4x4 g_ViewProjection : packoffset(c8);
  float4x4 g_ViewInverseMatrix : packoffset(c12);
}

cbuffer UIParam : register(b1)
{
  float4x4 g_WorldMatrix : packoffset(c0);
  float4 g_Color0 : packoffset(c4);
  float4 g_Color1 : packoffset(c5);
  float4 g_DispRate : packoffset(c6);
}



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


void main( 
  float4 v0 : POSITION0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float4 v3 : TEXCOORD2,
  float4 v4 : COLOR0,
  out float4 o0 : SV_POSITION0,
  out float2 o1 : TEXCOORD0,
  out float2 p1 : TEXCOORD1,
  out float4 o2 : TEXCOORD2,
  out float4 o3 : TEXCOORD3,
  out float4 o4 : COLOR0,
  out float4 o5 : COLOR1,
  out float4 o6 : COLOR2,
  out float4 o7 : COLOR3)
{
  float4 r0,r1,r10,r11;
  uint4 bitmask, uiDest;
  float4 fDest;

 r10.z = 0;
  r0.x = dot(v0.xyzw, g_WorldMatrix._m00_m10_m20_m30);
  r0.y = dot(v0.xyzw, g_WorldMatrix._m01_m11_m21_m31);
  r0.z = dot(v0.xyzw, g_WorldMatrix._m02_m12_m22_m32);
  r0.w = dot(v0.xyzw, g_WorldMatrix._m03_m13_m23_m33);
  r1.x = dot(r0.xyzw, g_ViewProjection._m00_m10_m20_m30);
  r1.y = dot(r0.xyzw, g_ViewProjection._m01_m11_m21_m31);
 r10.w = dot(r0.xyzw, g_ViewProjection._m03_m13_m23_m33);
 r10.xy = r1.xy;
r11 = r10;

float4 stereo = StereoParams.Load(0);
float4 iniParams = IniParams.Load(0);

//if(o0.y > -0.6)
//{
//}

if(iniParams.w == 1.0)
{
	if(r11.w == 1)
	{
	r11.x += stereo.x * iniParams.x * 1.3;
	}
	else
	{
	r11.x += stereo.x * iniParams.x * 1300;
	}
}
else if(iniParams.w == 2.0)
{	
	if(r11.w == 1)
	{
	r11.x += stereo.x * iniParams.x *2.4;
	}
	else
	{
	r11.x += stereo.x * iniParams.x * 2400;
	}
}

//HUD & UI toggle
if(iniParams.w == 0.0)
{
r11 = 0;
}

o0 = r11;


  r0.x = 1 + r11.x;
  o2.x = 0.5 * r0.x;
  r0.x = 1 + -r1.y;
  o2.y = 0.5 * r0.x;
  o1.xy = v1.xy;
  p1.xy = v2.xy;
  o3.xyzw = v3.xyzw;
  o4.xyzw = v4.xyzw;
  o5.xyzw = g_Color0.xyzw;
  o6.xyzw = g_Color1.xyzw;
  o7.xyzw = g_DispRate.xyzw;

  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.56 on Mon Mar 20 08:10:04 2017
//
//
// Buffer Definitions: 
//
// cbuffer SceneBuffer
// {
//
//   float4x4 g_View;                   // Offset:    0 Size:    64 [unused]
//   float4x4 g_Proj;                   // Offset:   64 Size:    64 [unused]
//   float4x4 g_ViewProjection;         // Offset:  128 Size:    64
//   float4x4 g_ViewInverseMatrix;      // Offset:  192 Size:    64 [unused]
//
// }
//
// cbuffer UIParam
// {
//
//   float4x4 g_WorldMatrix;            // Offset:    0 Size:    64
//   float4 g_Color0;                   // Offset:   64 Size:    16
//   float4 g_Color1;                   // Offset:   80 Size:    16
//   float4 g_DispRate;                 // Offset:   96 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SceneBuffer                       cbuffer      NA          NA    0        1
// UIParam                           cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// TEXCOORD                 1   xy          2     NONE   float   xy  
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// COLOR                    0   xyzw        4     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// TEXCOORD                 1     zw        1     NONE   float     zw
// TEXCOORD                 2   xy          2     NONE   float   xy  
// TEXCOORD                 3   xyzw        3     NONE   float   xyzw
// COLOR                    0   xyzw        4     NONE   float   xyzw
// COLOR                    1   xyzw        5     NONE   float   xyzw
// COLOR                    2   xyzw        6     NONE   float   xyzw
// COLOR                    3   xyzw        7     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[12], immediateIndexed
dcl_constantbuffer cb1[7], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xy
dcl_input v3.xyzw
dcl_input v4.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o1.zw
dcl_output o2.xy
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_temps 2
mov o0.z, l(0)
dp4 r0.x, v0.xyzw, cb1[0].xyzw
dp4 r0.y, v0.xyzw, cb1[1].xyzw
dp4 r0.z, v0.xyzw, cb1[2].xyzw
dp4 r0.w, v0.xyzw, cb1[3].xyzw
dp4 r1.x, r0.xyzw, cb0[8].xyzw
dp4 r1.y, r0.xyzw, cb0[9].xyzw
dp4 o0.w, r0.xyzw, cb0[11].xyzw
mov o0.xy, r1.xyxx
add r0.x, r1.x, l(1.000000)
mul o2.x, r0.x, l(0.500000)
add r0.x, -r1.y, l(1.000000)
mul o2.y, r0.x, l(0.500000)
mov o1.xy, v1.xyxx
mov o1.zw, v2.xxxy
mov o3.xyzw, v3.xyzw
mov o4.xyzw, v4.xyzw
mov o5.xyzw, cb1[4].xyzw
mov o6.xyzw, cb1[5].xyzw
mov o7.xyzw, cb1[6].xyzw
ret 
// Approximately 21 instruction slots used

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