// HUD 5 - crosshair

 cbuffer CBufferGlobalConstant_Z : register(b0)
 {

   struct
   {
     float4 c[90];
   } Global : packoffset(c0);

 }



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


 void main(
   float4 v0 : POSITION0,
   float4 v1 : COLOR0,
   float2 v2 : TEXCOORD0,
   out float4 o0 : SV_Position0,
   out float4 o1 : PREVIOUS_POSITION0,
   out float4 o2 : COLOR0,
   out float3 o3 : TEXCOORD0,
   out float p3 : INSTANCE_COLOR0,
   out uint2 o4 : INSTANCE_INDEXES0)
 {
   float4 r0;
   uint4 bitmask, uiDest;
   float4 fDest;

   r0.xyz = v0.xyz;
   r0.w = 1;
   o0.x = dot(r0.xyzw, Global.c[49].xyzw);
   o0.y = dot(r0.xyzw, Global.c[50].xyzw);
   o0.z = dot(r0.xyzw, Global.c[51].xyzw);
   o0.w = dot(r0.xyzw, Global.c[52].xyzw);
   o1.xyzw = float4(0,0,0,0);
   o2.xyzw = v1.xyzw;
   o3.xy = v2.xy;
   o3.z = 0;
   p3.x = 1;
   o4.xy = float2(0,0);
   
   //Fix
  float4 stereo = StereoParams.Load(0);
  float4 iniParams = IniParams.Load(0);
  float4 iniParams2 = IniParams.Load(int2(20,0));

  float4 Crosshairdepth = IniParams.Load(int2(21,0));
  
  float4 tex_filter = IniParams.Load(int2(2,0));
  

o0.x -= stereo.x * (o0.w - stereo.y);


  if (tex_filter.x == 3)
	  {
	  //o0.x -= stereo.x * (o0.w - stereo.y) * (1 - iniParams.x );
	  o0.x += stereo.x * iniParams.x * 30;
	  //o0.x += stereo.x * iniParams.z;
	  }

  if (tex_filter.x == 4)
    {
    o0.x += stereo.x*0.024*70.0*Crosshairdepth.x;
    //o0.x += stereo.x * iniParams.x * 40;
    }

else
o0.x += stereo.x*0.024*70.0*Crosshairdepth.x;

   
   return;
 }
 

