//Sunlight.
// ---- Created with 3Dmigoto v1.2.45 on Sat Oct 29 12:11:36 2016
cbuffer cb2 : register(b2)
{
  float4 cb2[16];
}




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


void main( 
  float4 v0 : POSITION0,
  float4 v1 : COLOR0,
  out float4 o0 : SV_POSITION0,
  out float2 o1 : TEXCOORD3,
  out float4 o2 : COLOR0,
  out float4 o3 : POSITION1,
  out float4 o4 : POSITION2)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);
  float separation = stereo.x;
  float convergence = stereo.y;
  
  r0.xyz = v0.xyz;
  r0.w = 1;
  r1.x = dot(cb2[0].xyzw, r0.xyzw);
  r1.y = dot(cb2[1].xyzw, r0.xyzw);
  r1.z = dot(cb2[3].xyzw, r0.xyzw);
  o0.xyzw = r1.xyzz;
  o0.x+=separation*(convergence);
  r1.x = dot(v0.xyz, v0.xyz);
  r1.x = rsqrt(r1.x);
  r1.xyz = v0.xyz * r1.xxx;
  r1.w = abs(r1.x) * -0.0187292993 + 0.0742610022;
  r1.w = r1.w * abs(r1.x) + -0.212114394;
  r1.w = r1.w * abs(r1.x) + 1.57072878;
  r2.x = 1 + -abs(r1.x);
  r2.x = sqrt(r2.x);
  r2.y = r2.x * r1.w;
  r2.y = r2.y * -2 + 3.14159274;
  r1.x = cmp(r1.x < -r1.x);
  r1.y = r1.y + r1.z;
  r1.x = r1.x ? r2.y : 0;
  r1.x = r1.w * r2.x + r1.x;
  o1.x = 501 * r1.x;
  r1.x = abs(r1.y) * -0.0187292993 + 0.0742610022;
  r1.x = r1.x * abs(r1.y) + -0.212114394;
  r1.x = r1.x * abs(r1.y) + 1.57072878;
  r1.z = 1 + -abs(r1.y);
  r1.y = cmp(r1.y < -r1.y);
  r1.z = sqrt(r1.z);
  r1.w = r1.x * r1.z;
  r1.w = r1.w * -2 + 3.14159274;
  r1.y = r1.y ? r1.w : 0;
  r1.x = r1.x * r1.z + r1.y;
  r1.x = 1.57079637 + -r1.x;
  o1.y = 501 * r1.x;
  r1.xyz = cb2[14].xyz * v1.yyy;
  r1.xyz = cb2[13].xyz * v1.xxx + r1.xyz;
  r1.xyz = cb2[15].xyz * v1.zzz + r1.xyz;
  o2.xyz = cb2[12].www * r1.xyz;
  o2.w = cb2[13].w * v1.w;
  o3.x = dot(cb2[4].xyzw, r0.xyzw);
  o3.y = dot(cb2[5].xyzw, r0.xyzw);
  o3.z = dot(cb2[6].xyzw, r0.xyzw);
  o3.w = dot(cb2[7].xyzw, r0.xyzw);
  o4.x = dot(cb2[8].xyzw, r0.xyzw);
  o4.y = dot(cb2[9].xyzw, r0.xyzw);
  o4.z = dot(cb2[10].xyzw, r0.xyzw);
  o4.w = dot(cb2[11].xyzw, r0.xyzw);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.45 on Sat Oct 29 12:11:36 2016
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz 
// COLOR                    0   xyzw        1     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 3   xy          1     NONE   float   xy  
// COLOR                    0   xyzw        2     NONE   float   xyzw
// POSITION                 1   xyzw        3     NONE   float   xyzw
// POSITION                 2   xyzw        4     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb2[16], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_temps 3
mov r0.xyz, v0.xyzx
mov r0.w, l(1.000000)
dp4 r1.x, cb2[0].xyzw, r0.xyzw
dp4 r1.y, cb2[1].xyzw, r0.xyzw
dp4 r1.z, cb2[3].xyzw, r0.xyzw
mov o0.xyzw, r1.xyzz
dp3 r1.x, v0.xyzx, v0.xyzx
rsq r1.x, r1.x
mul r1.xyz, r1.xxxx, v0.xyzx
mad r1.w, |r1.x|, l(-0.0187292993), l(0.074261)
mad r1.w, r1.w, |r1.x|, l(-0.212114394)
mad r1.w, r1.w, |r1.x|, l(1.57072878)
add r2.x, -|r1.x|, l(1.000000)
sqrt r2.x, r2.x
mul r2.y, r1.w, r2.x
mad r2.y, r2.y, l(-2.000000), l(3.14159274)
lt r1.x, r1.x, -r1.x
add r1.y, r1.z, r1.y
and r1.x, r1.x, r2.y
mad r1.x, r1.w, r2.x, r1.x
mul o1.x, r1.x, l(501.000000)
mad r1.x, |r1.y|, l(-0.0187292993), l(0.074261)
mad r1.x, r1.x, |r1.y|, l(-0.212114394)
mad r1.x, r1.x, |r1.y|, l(1.57072878)
add r1.z, -|r1.y|, l(1.000000)
lt r1.y, r1.y, -r1.y
sqrt r1.z, r1.z
mul r1.w, r1.z, r1.x
mad r1.w, r1.w, l(-2.000000), l(3.14159274)
and r1.y, r1.y, r1.w
mad r1.x, r1.x, r1.z, r1.y
add r1.x, -r1.x, l(1.57079637)
mul o1.y, r1.x, l(501.000000)
mul r1.xyz, v1.yyyy, cb2[14].xyzx
mad r1.xyz, cb2[13].xyzx, v1.xxxx, r1.xyzx
mad r1.xyz, cb2[15].xyzx, v1.zzzz, r1.xyzx
mul o2.xyz, r1.xyzx, cb2[12].wwww
mul o2.w, v1.w, cb2[13].w
dp4 o3.x, cb2[4].xyzw, r0.xyzw
dp4 o3.y, cb2[5].xyzw, r0.xyzw
dp4 o3.z, cb2[6].xyzw, r0.xyzw
dp4 o3.w, cb2[7].xyzw, r0.xyzw
dp4 o4.x, cb2[8].xyzw, r0.xyzw
dp4 o4.y, cb2[9].xyzw, r0.xyzw
dp4 o4.z, cb2[10].xyzw, r0.xyzw
dp4 o4.w, cb2[11].xyzw, r0.xyzw
ret 
// Approximately 0 instruction slots used

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