// Markers DEcals
cbuffer cb1 : register(b1)
{
  float4 cb1[14];
}

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


// Copied from the directional lighting shader using 3DMigoto
cbuffer UnityPerCameraRare : register(b13)
{
  uniform float4 unity_CameraWorldClipPlanes[6];

  // Projection matrices of the camera. Note that this might be different from projection matrix
  // that is set right now, e.g. while rendering shadows the matrices below are still the projection
  // of original camera.
  row_major uniform float4x4 unity_CameraProjection;
  row_major uniform float4x4 unity_CameraInvProjection;
}

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


void main(
  float4 v0 : POSITION0,
  float3 v1 : NORMAL0,
  float4 v2 : TEXCOORD0,
  float2 v3 : TEXCOORD1,
  float4 v4 : TANGENT0,
  float4 v5 : COLOR0,
  out float4 o0 : SV_POSITION0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : TEXCOORD2,
  out float4 o4 : TEXCOORD3,
  out float fov : TEXCOORD4) // New output to pass FOV to pixel shaders
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = cb1[1].xyzw * v0.yyyy;
  r0.xyzw = cb1[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb1[2].xyzw * v0.zzzz + r0.xyzw;
  r0.xyzw = cb1[3].xyzw * v0.wwww + r0.xyzw;
   
  
  o0.xyzw = r0.xyzw;
  
  float4 stereo = StereoParams.Load(0);
  r0.x += stereo.x * (r0.w - stereo.y);
  
  o1.xy = v2.xy;
  o1.zw = float2(0,0);
  r0.y = cb0[5].x * r0.y;
  r1.xzw = float3(0.5,0.5,0.5) * r0.xwy;
  o2.zw = r0.zw;
  o2.xy = r1.xw + r1.zz;
  r0.x = dot(cb1[13].xyz, cb1[13].xyz);
  r0.x = rsqrt(r0.x);
  o3.xyz = cb1[13].xyz * r0.xxx;
  o4.xyzw = float4(0,0,0,0);
  
  fov = unity_CameraInvProjection[0].x;
  
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.12 on Thu Dec 06 15:32:03 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float
// TEXCOORD                 0   xy          2     NONE   float   xy
// TEXCOORD                 1   xy          3     NONE   float
// TANGENT                  0   xyzw        4     NONE   float
// COLOR                    0   xyzw        5     NONE   float
//
//
// 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   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyz         3     NONE   float   xyz
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[6], immediateIndexed
dcl_constantbuffer cb1[14], immediateIndexed
dcl_input v0.xyzw
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyz
dcl_output o4.xyzw
dcl_temps 2
mul r0.xyzw, v0.yyyy, cb1[1].xyzw
mad r0.xyzw, cb1[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb1[2].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb1[3].xyzw, v0.wwww, r0.xyzw
mov o0.xyzw, r0.xyzw
mov o1.xy, v2.xyxx
mov o1.zw, l(0,0,0,0)
mul r0.y, r0.y, cb0[5].x
mul r1.xzw, r0.xxwy, l(0.500000, 0.000000, 0.500000, 0.500000)
mov o2.zw, r0.zzzw
add o2.xy, r1.zzzz, r1.xwxx
dp3 r0.x, cb1[13].xyzx, cb1[13].xyzx
rsq r0.x, r0.x
mul o3.xyz, r0.xxxx, cb1[13].xyzx
mov o4.xyzw, l(0,0,0,0)
ret
// Approximately 0 instruction slots used

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