//hud
cbuffer cb_object : register(b0)
{
  float4x4 u_mvpMatrix : packoffset(c0);
  float4 u_tex0ScaleOffset : packoffset(c4);
}

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main(
  float4 v0 : POSITION0,
  float4 v1 : COLOR0,
  float2 v2 : TEXCOORD0,
  out float4 o0 : SV_Position0,
  out float4 o1 : COLOR0,
  out float2 o2 : TEXCOORD0)
{
float4 r9,r10,r11,r12,r13;
  r10.x = dot(v0.xyzw, u_mvpMatrix._m00_m10_m20_m30);
  r10.y = dot(v0.xyzw, u_mvpMatrix._m01_m11_m21_m31);
  r10.z = dot(v0.xyzw, u_mvpMatrix._m02_m12_m22_m32);
  r10.w = dot(v0.xyzw, u_mvpMatrix._m03_m13_m23_m33);

r9 = r10;

if(r9.x < -0.99){r10.x = r9.x * 1.03;}
if(r9.x > 0.99){r10.x = r9.x * 1.03;}

r11 = r10;
r12 = r10;
r13 = r10;

if(r9.w == 1){

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


r12.x += stereo.x * iniParams.x;
r11.x += stereo.x * iniParams.y;
r13.x += stereo.x * 0.58;

r10 = r12;

//gun crosshair
if(stereo.y <= 1 && r9.x > -0.05 && r9.x < 0.05 && r9.y > 0.01 && r9.y < 0.19 ){
r10 = r11;
}
if(stereo.y > 1 && stereo.y < 3.5 && iniParams.z == 1){
r10 = r13;

if(r9.y < -0.55){r10 = r12;}
if(r9.y > 0.56 && r9.x < -0.68){
//r10 = r12;
}
if(r9.y > 0.48 && r9.x > 0.59){
//r10 = r12;
}

}
}


o0 = r10;

  o1.xyzw = v1.xyzw;
  o2.xy = v2.xy * u_tex0ScaleOffset.xy + u_tex0ScaleOffset.zw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions: 
//
// cbuffer cb_object
// {
//
//   float4x4 u_mvpMatrix;              // Offset:    0 Size:    64
//   float4 u_tex0ScaleOffset;          // Offset:   64 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cb_object                         cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// 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 cb0[5], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xy
dp4 o0.x, v0.xyzw, cb0[0].xyzw
dp4 o0.y, v0.xyzw, cb0[1].xyzw
dp4 o0.z, v0.xyzw, cb0[2].xyzw
dp4 o0.w, v0.xyzw, cb0[3].xyzw
mov o1.xyzw, v1.xyzw
mad o2.xy, v2.xyxx, cb0[4].xyxx, cb0[4].zwzz
ret 
// Approximately 7 instruction slots used

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