//Shadows VS.
// ---- Created with 3Dmigoto v1.3.6 on Fri Mar 16 23:58:58 2018

//cbuffer VS_CONSTANT_BUFFER : register(b0)
//{
//  float4x4 mOTP : packoffset(c0);
//}
cbuffer cb0 : register(b0)
{
  float4 cb0[50];
}

cbuffer cb13 : register(b13)
{
  float4 cb13[50];
}


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


void main(
  float3 v0 : POSITION0,
  float3 v1 : NORMAL0,
  float4 v2 : COLOR0,
  float2 v3 : TEXCOORD0,
  out float4 o0 : SV_POSITION0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);
  float4 iniparams1 = IniParams.Load(int2(1,0));
  
  r0.xyzw = cb0[1].xyzw * v0.yyyy;
  r0.xyzw = cb0[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb0[2].xyzw * v0.zzzz + r0.xyzw;
  r0.xyzw = cb0[3].xyzw + r0.xyzw;
  
  if (cb13[11].x>0.1560 && cb13[11].x<0.1563) {
    v0.x+=stereo.x*(1-stereo.y*(r0.w-r0.z)*0.025);
  } else {
    v0.x+=stereo.x*(1-stereo.y*(r0.w-r0.z)*0.0125);
  }
  
  r0.xyzw = cb0[1].xyzw * v0.yyyy;
  r0.xyzw = cb0[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb0[2].xyzw * v0.zzzz + r0.xyzw;
  r0.xyzw = cb0[3].xyzw + r0.xyzw;
  
  //r0.x+=stereo.x*((r0.w-r0.z)-stereo.y);
  
  o0.z = r0.w + -r0.z;
  o0.xyw = float3(1,-1,1) * r0.xyw;
  //o0.x+=stereo.x;
  //r0.z=r0.z*10-9;
  //o0.x-=stereo.x*(1-r0.z)*stereo.y*iniparams1.x*-0.1;
  //o0.x-=stereo.x*(o0.z)*stereo.y*iniparams1.x*-1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.6 on Fri Mar 16 23:58:58 2018
//
//
// Buffer Definitions:
//
// cbuffer VS_CONSTANT_BUFFER
// {
//
//   float4x4 mOTP;                     // Offset:    0 Size:    64
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// VS_CONSTANT_BUFFER                cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
// NORMAL                   0   xyz         1     NONE   float
// COLOR                    0   xyzw        2     NONE   float
// TEXCOORD                 0   xy          3     NONE   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[4], immediateIndexed
dcl_input v0.xyz
dcl_output_siv o0.xyzw, position
dcl_temps 1
mul r0.xyzw, v0.yyyy, cb0[1].xyzw
mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb0[2].xyzw, v0.zzzz, r0.xyzw
add r0.xyzw, r0.xyzw, cb0[3].xyzw
add o0.z, -r0.z, r0.w
mul o0.xyw, r0.xyxw, l(1.000000, -1.000000, 0.000000, 1.000000)
ret
// Approximately 7 instruction slots used

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