// ---- Created with 3Dmigoto v1.2.67 on Fri Jan 05 22:01:18 2018

cbuffer UnityFFVertex : register(b0)
{
  float4x4 ff_matrix_mvp : packoffset(c0);
  float4x4 ff_matrix_mv : packoffset(c4);
  float4 ff_vec_color : packoffset(c8);
  float4 ff_vec_ambient : packoffset(c9);
  float4 ff_light_color[8] : packoffset(c10);
  float4 ff_light_pos[8] : packoffset(c18);
  float4 ff_light_atten[8] : packoffset(c26);
  float4 ff_light_spot[8] : packoffset(c34);
  float4 ff_mat_diffuse : packoffset(c42);
  float4 ff_mat_ambient : packoffset(c43);
  float4 ff_mat_spec : packoffset(c44);
  float4 ff_mat_emission : packoffset(c45);
  float4x4 ff_matrix_tex[4] : packoffset(c46);
  float4 ff_fog_vs : packoffset(c62);
}



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


void main(
  float4 v0 : POSITION0,
  float4 v1 : COLOR0,
  float4 v2 : TEXCOORD0,
  out float4 o0 : COLOR0,
  out float4 o1 : TEXCOORD0,
  out float o2 : FOG0,
  out float4 o3 : SV_Position0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = v1.xyzw;
  r2.xyz = ff_matrix_mv._m01_m11_m21 * v0.yyy;
  r2.xyz = ff_matrix_mv._m00_m10_m20 * v0.xxx + r2.xyz;
  r2.xyz = ff_matrix_mv._m02_m12_m22 * v0.zzz + r2.xyz;
  r1.xyz = ff_matrix_mv._m03_m13_m23 * v0.www + r2.xyz;
  r2.xyz = float3(0,0,0);
  o0.xyzw = saturate(r0.xyzw);
  r0.xyzw = ff_matrix_tex[0]._m01_m11_m21_m31 * v2.yyyy;
  r0.xyzw = ff_matrix_tex[0]._m00_m10_m20_m30 * v2.xxxx + r0.xyzw;
  r0.xyzw = ff_matrix_tex[0]._m02_m12_m22_m32 * v2.zzzz + r0.xyzw;
  o1.xyzw = ff_matrix_tex[0]._m03_m13_m23_m33 * v2.wwww + r0.xyzw;
  r0.x = dot(r1.xyz, r1.xyz);
  r0.x = sqrt(r0.x);
  o2.x = saturate(r0.x * ff_fog_vs.z + ff_fog_vs.w);
  r0.xyzw = ff_matrix_mvp._m01_m11_m21_m31 * v0.yyyy;
  r0.xyzw = ff_matrix_mvp._m00_m10_m20_m30 * v0.xxxx + r0.xyzw;
  r0.xyzw = ff_matrix_mvp._m02_m12_m22_m32 * v0.zzzz + r0.xyzw;
  o3.xyzw = ff_matrix_mvp._m03_m13_m23_m33 * v0.wwww + r0.xyzw;

float4 stereo = StereoParams.Load(0);
float4 iniParams = IniParams.Load(0);
if(o3.w == 1){
o3.x += stereo.x * iniParams.x;
}
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) Shader Linker
//
//   using 3Dmigoto v1.2.67 on Fri Jan 05 22:01:18 2018
//
//
// Buffer Definitions: 
//
// cbuffer UnityFFVertex
// {
//
//   float4x4 ff_matrix_mvp;            // Offset:    0 Size:    64
//   float4x4 ff_matrix_mv;             // Offset:   64 Size:    64
//   float4 ff_vec_color;               // Offset:  128 Size:    16
//   float4 ff_vec_ambient;             // Offset:  144 Size:    16
//   float4 ff_light_color[8];          // Offset:  160 Size:   128
//   float4 ff_light_pos[8];            // Offset:  288 Size:   128
//   float4 ff_light_atten[8];          // Offset:  416 Size:   128
//   float4 ff_light_spot[8];           // Offset:  544 Size:   128
//   float4 ff_mat_diffuse;             // Offset:  672 Size:    16
//   float4 ff_mat_ambient;             // Offset:  688 Size:    16
//   float4 ff_mat_spec;                // Offset:  704 Size:    16
//   float4 ff_mat_emission;            // Offset:  720 Size:    16
//   float4x4 ff_matrix_tex[4];         // Offset:  736 Size:   256
//   float4 ff_fog_vs;                  // Offset:  992 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// UnityFFVertex                     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   xyzw        2     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// FOG                      0   x           2     NONE   float   x   
// SV_Position              0   xyzw        3      POS   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[63], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_input v2.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.x
dcl_output_siv o3.xyzw, position
dcl_temps 3
mov r0.xyzw, v1.xyzw
mul r2.xyz, v0.yyyy, cb0[5].xyzx
mad r2.xyz, cb0[4].xyzx, v0.xxxx, r2.xyzx
mad r2.xyz, cb0[6].xyzx, v0.zzzz, r2.xyzx
mad r1.xyz, cb0[7].xyzx, v0.wwww, r2.xyzx
mov r2.xyz, l(0,0,0,0)
mov_sat o0.xyzw, r0.xyzw
mul r0.xyzw, v2.yyyy, cb0[47].xyzw
mad r0.xyzw, cb0[46].xyzw, v2.xxxx, r0.xyzw
mad r0.xyzw, cb0[48].xyzw, v2.zzzz, r0.xyzw
mad o1.xyzw, cb0[49].xyzw, v2.wwww, r0.xyzw
dp3 r0.x, r1.xyzx, r1.xyzx
sqrt r0.x, r0.x
mad_sat o2.x, r0.x, cb0[62].z, cb0[62].w
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
mad o3.xyzw, cb0[3].xyzw, v0.wwww, r0.xyzw
ret 
// Approximately 19 instruction slots used

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