//Dirt screen VS.
// ---- Created with 3Dmigoto v1.2.45 on Sat Oct 29 10:19:04 2016
cbuffer cb2 : register(b2)
{
  float4 cb2[5];
}




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


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

  float4 stereo = StereoParams.Load(0);
  float4 iniparams = IniParams.Load(0);
  float4 iniparams1 = IniParams.Load(int2(1,0));
  float separation = stereo.x;
  float convergence = stereo.y;
  
  r0.xy = v0.xy;
  r0.z = 1;
  r1.x = dot(cb2[0].xyw, r0.xyz);
  r1.y = dot(cb2[1].xyw, r0.xyz);
  o0.xy = r1.xy*iniparams.w;
  r1.xy = -cb2[4].xy + r1.xy;
  r1.xy = cb2[4].ww * r1.xy;
  o2.xy = -r1.xy * float2(-0.5,0.5) + v1.xy;
  o0.z = dot(cb2[2].xyw, r0.xyz);
  o0.w = dot(cb2[3].xyw, r0.xyz);
  //o0.x+=separation*iniparams.x;
if (o0.y<0)
{
	//o0.y+=iniparams1.y*o0.x*-o0.x*iniparams.x*(o0.y*-o0.y)*0.25;
}
else
{
	//o0.y+=iniparams1.y*o0.x*-o0.x*iniparams.x*(o0.y*o0.y)*0.25;
}
if (o0.x<0)
{
	o0.x+=iniparams1.z*iniparams1.x*separation*iniparams.x*(o0.x*-o0.x)*0.5+separation*iniparams.x+iniparams1.z*iniparams1.y*o0.x*-o0.x*iniparams.x*(o0.y*o0.y)*0.25;
}
else
{
	o0.x+=iniparams1.z*iniparams1.x*separation*iniparams.x*(o0.x*-o0.x)*0.5+separation*iniparams.x+iniparams1.z*iniparams1.y*o0.x*-o0.x*iniparams.x*(o0.y*-o0.y)*0.25;
}
  o1.xy = v1.xy;
  o1.z = v0.z;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.45 on Sat Oct 29 10:19:04 2016
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz 
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz 
// TEXCOORD                 1   xy          2     NONE   float   xy  
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xy
dcl_temps 2
mov r0.xy, v0.xyxx
mov r0.z, l(1.000000)
dp3 r1.x, cb2[0].xywx, r0.xyzx
dp3 r1.y, cb2[1].xywx, r0.xyzx
mov o0.xy, r1.xyxx
add r1.xy, r1.xyxx, -cb2[4].xyxx
mul r1.xy, r1.xyxx, cb2[4].wwww
mad o2.xy, -r1.xyxx, l(-0.500000, 0.500000, 0.000000, 0.000000), v1.xyxx
dp3 o0.z, cb2[2].xywx, r0.xyzx
dp3 o0.w, cb2[3].xywx, r0.xyzx
mov o1.xy, v1.xyxx
mov o1.z, v0.z
ret 
// Approximately 0 instruction slots used

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