// red light beams fix finally!!!
// hlsltool.py --install-to c:\py\1 --auto-fix-vertex-halo --only-autofixed --no-validate --ignore-other-errors 45b0db6397be922c-vs_replace.txt
// ---- Created with 3Dmigoto v1.2.62 on Sun Jul 16 13:11:39 2017
cbuffer cb2 : register(b2)
{
  float4 cb2[16];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[6];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[20];
}




// 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,
  out float3 o2 : TEXCOORD1)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

float4 stereo = StereoParams.Load(0);
float separation = stereo.x, convergence = stereo.y, eye = stereo.z;

  r0.xyzw = cb0[17].xyzw * v0.yyyy;
  r0.xyzw = cb0[16].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb0[18].xyzw * v0.zzzz + r0.xyzw;
  r0.xyzw = cb0[19].xyzw * v0.wwww + r0.xyzw;
  o0.xyzw = r0.xyzw;

// Automatic vertex shader halo fix inserted with DarkStarSword's hlsltool.py:
// hlsltool.py --install-to c:\py\1 --auto-fix-vertex-halo --only-autofixed --no-validate --ignore-other-errors 45b0db6397be922c-vs_replace.txt
if (r0.w != 1.0) { r0.x += separation * (r0.w - convergence); }

  r1.xyz = float3(0.5,0.5,0.5) * r0.xyw;
  o1.zw = r0.zw;
  r1.w = cb1[5].x * r1.y;
  o1.xy = r1.xw + r1.zz;
  r0.xyz = cb2[13].xyz * v0.yyy;
  r0.xyz = cb2[12].xyz * v0.xxx + r0.xyz;
  r0.xyz = cb2[14].xyz * v0.zzz + r0.xyz;
  o2.xyz = cb2[15].xyz * v0.www + r0.xyz;
  

//o0.x += separation * 9; 
// red beams fix
if (o0.w != 1.0) { o0.x += separation * (r0.w - convergence); }
 
  
  
  
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// 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
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
//
vs_4_0
dcl_constantbuffer cb0[20], immediateIndexed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[16], immediateIndexed
dcl_input v0.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_temps 2
mul r0.xyzw, v0.yyyy, cb0[17].xyzw
mad r0.xyzw, cb0[16].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb0[18].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb0[19].xyzw, v0.wwww, r0.xyzw
mov o0.xyzw, r0.xyzw
mul r1.xyz, r0.xywx, l(0.500000, 0.500000, 0.500000, 0.000000)
mov o1.zw, r0.zzzw
mul r1.w, r1.y, cb1[5].x
add o1.xy, r1.zzzz, r1.xwxx
mul r0.xyz, v0.yyyy, cb2[13].xyzx
mad r0.xyz, cb2[12].xyzx, v0.xxxx, r0.xyzx
mad r0.xyz, cb2[14].xyzx, v0.zzzz, r0.xyzx
mad o2.xyz, cb2[15].xyzx, v0.wwww, r0.xyzx
ret 
// Approximately 0 instruction slots used

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