// ---- Created with 3Dmigoto v1.2.43 on Sat Aug 27 19:12:26 2016
//Moon to infinity...The_Nephilim



cbuffer cb5 : register(b5)
{
  float4 cb5[4];
}

cbuffer cb4 : register(b4)
{
  float4 cb4[15];
}

cbuffer cb2 : register(b2)
{
  float4 cb2[5];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[6];
}

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




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


void main( 
  float4 v0 : POSITION0,
  int2 v1 : TEXCOORD0,
  uint4 v2 : COLOR0,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD6,
  out float4 o2 : TEXCOORD7,
  out float4 o3 : TEXCOORD4,
  out float4 o4 : TEXCOORD5,
  out float4 o5 : COLOR0,
  out float4 o6 : COLOR1,
  out float3 o7 : TEXCOORD10,
  out float p7 : TEXCOORD11,
  out float4 o8 : TEXCOORD0)
{
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = (uint)v2.w;
  r0.y = cb5[3].y * cb1[4].w;
  r0.x = r0.x * r0.y;
  r0.y = dot(cb2[4].xyz, float3(0.298999995,0.587000012,0.114));
  r0.x = r0.x * r0.y;
  r0.y = 0.00100000005 + r0.y;
  r1.xyz = cb2[4].xyz / r0.yyy;
  r0.x = 5.88235309e-008 * r0.x;
  r0.z = sqrt(r0.x);
  r2.x = r0.z * r0.z;
  r2.x = 27777.7773 * r2.x;
  r2.x = max(1, r2.x);
  r0.y = min(3, r2.x);
  r2.x = cmp(0.00600000005 < r0.z);
  r0.xw = float2(0.00600000005,1);
  r0.xy = r2.xx ? r0.xy : r0.zw;
  r2.xy = cb0[4].zw * r0.xx;
  r0.zw = cb0[4].yx * r2.yx;
  r2.x = r0.w * r0.y;
  r2.x = 0.333333343 * r2.x;
  r3.xy = cmp(r0.wz < float2(3,3));
  r2.yw = float2(3,3);
  r0.xy = r3.xx ? r2.xy : r0.yw;
  r2.x = r0.z * r0.x;
  r2.z = 0.333333343 * r2.x;
  r0.xw = r3.yy ? r2.zw : r0.xz;
  r2.xy = float2(1,1) / cb0[4].xy;
  r0.yz = r2.xy * r0.yw;
  r2.xy = (int2)v1.xy;
  r3.xy = float2(-0.5,-0.5) + r2.xy;
  r0.yz = r3.xy * r0.yz;
  r3.y = dot(v0.xyzw, cb4[5].xyzw);
  r4.xyzw = cb2[1].xyzw * r3.yyyy;
  r3.x = dot(v0.xyzw, cb4[4].xyzw);
  r4.xyzw = cb2[0].xyzw * r3.xxxx + r4.xyzw;
  r3.z = dot(v0.xyzw, cb4[6].xyzw);
  r4.xyzw = cb2[2].xyzw * r3.zzzz + r4.xyzw;
  r0.w = dot(r3.xyz, r3.xyz);
  r0.w = sqrt(r0.w);
  r0.w = 9.99999975e-006 + r0.w;
  r3.xyzw = cb2[3].xyzw + r4.xyzw;
  r0.yz = r3.ww * r0.yz;
  o0.xy = r0.yz * float2(2,2) + r3.xy;
  o0.zw = r3.zw;
  r1.w = 1;
  r1.xyzw = r1.xyzw * r0.xxxx;
  r0.y = dot(v0.xyzw, cb4[1].xyzw);
  r2.w = -cb4[14].y + r0.y;
  r3.x = abs(r2.w) / r0.w;
  r0.w = r2.w / r0.w;
  r0.w = cb0[8].z * r0.w;
  r2.w = cb1[5].x * r3.x;
  r3.x = -28853.9004 * r2.w;
  r3.x = exp2(r3.x);
  r3.x = 1 + -r3.x;
  r3.x = r3.x / r2.w;
  r2.w = cmp(r2.w == 0.000000);
  r2.w = r2.w ? 20000 : r3.x;
  r3.x = min(cb4[14].y, r0.y);
  r3.x = -cb1[5].x * r3.x;
  r3.x = 1.44269502 * r3.x;
  r3.x = exp2(r3.x);
  r3.x = -cb1[5].y * r3.x;
  r2.w = r3.x * r2.w;
  r2.w = 1.44269502 * r2.w;
  r2.w = exp2(r2.w);
  r2.w = min(1, r2.w);
  r3.x = -28853.9004 * r0.w;
  r3.x = exp2(r3.x);
  r3.x = 1 + -r3.x;
  r3.x = r3.x / r0.w;
  r0.w = cmp(r0.w == 0.000000);
  r0.w = r0.w ? 20000 : r3.x;
  r3.x = cb4[14].y + -cb0[8].x;
  r3.x = -cb0[8].z * r3.x;
  r3.x = 1.44269502 * r3.x;
  r3.x = exp2(r3.x);
  r3.x = -cb0[8].y * r3.x;
  r0.w = r3.x * r0.w;
  r0.w = 1.44269502 * r0.w;
  r0.w = exp2(r0.w);
  r0.w = min(1, r0.w);
  r0.w = r2.w * r0.w;
  o1.w = saturate(r1.w * r0.w);
  o1.xyz = r1.xyz;
  o2.xyzw = float4(0,0,0,1);
  o3.xyzw = float4(0,0,0,1);
  o4.xyzw = float4(0,0,0,0);
  r0.x = dot(v0.xyzw, cb4[0].xyzw);
  r0.z = dot(v0.xyzw, cb4[2].xyzw);
  o6.xyzw = r0.xyzy;
  o7.xyzw = float4(0,0,0,1);
  r2.z = 1 + -r2.y;
  o8.xy = r2.xz;
  
  //stars to infinity 
float4 params = IniParams.Load(0);
 float4 stereo = StereoParams.Load(0);
 o0.x+=stereo.x*stereo.y;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.43 on Sat Aug 27 19:12:26 2016
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE     int   xy  
// COLOR                    0   xyzw        2     NONE    uint      w
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 6   xyzw        1     NONE   float   xyzw
// TEXCOORD                 7   xyzw        2     NONE   float   xyzw
// TEXCOORD                 4   xyzw        3     NONE   float   xyzw
// TEXCOORD                 5   xyzw        4     NONE   float   xyzw
// COLOR                    0   xyzw        5     NONE   float       
// COLOR                    1   xyzw        6     NONE   float   xyzw
// TEXCOORD                10   xyz         7     NONE   float   xyz 
// TEXCOORD                11      w        7     NONE   float      w
// TEXCOORD                 0   xyzw        8     NONE   float   xy  
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[9], immediateIndexed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_constantbuffer cb4[15], immediateIndexed
dcl_constantbuffer cb5[4], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.w
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o6.xyzw
dcl_output o7.xyz
dcl_output o7.w
dcl_output o8.xy
dcl_temps 5
utof r0.x, v2.w
mul r0.y, cb1[4].w, cb5[3].y
mul r0.x, r0.y, r0.x
dp3 r0.y, cb2[4].xyzx, l(0.299000, 0.587000, 0.114000, 0.000000)
mul r0.x, r0.y, r0.x
add r0.y, r0.y, l(0.001000)
div r1.xyz, cb2[4].xyzx, r0.yyyy
mul r0.x, r0.x, l(5.882353094E-008)
sqrt r0.z, r0.x
mul r2.x, r0.z, r0.z
mul r2.x, r2.x, l(27777.777344)
max r2.x, r2.x, l(1.000000)
min r0.y, r2.x, l(3.000000)
lt r2.x, l(0.006000), r0.z
mov r0.xw, l(0.006000,0,0,1.000000)
movc r0.xy, r2.xxxx, r0.xyxx, r0.zwzz
mul r2.xy, r0.xxxx, cb0[4].zwzz
mul r0.zw, r2.yyyx, cb0[4].yyyx
mul r2.x, r0.y, r0.w
mul r2.x, r2.x, l(0.333333343)
lt r3.xy, r0.wzww, l(3.000000, 3.000000, 0.000000, 0.000000)
mov r2.yw, l(0,3.000000,0,3.000000)
movc r0.xy, r3.xxxx, r2.xyxx, r0.ywyy
mul r2.x, r0.x, r0.z
mul r2.z, r2.x, l(0.333333343)
movc r0.xw, r3.yyyy, r2.zzzw, r0.xxxz
div r2.xy, l(1.000000, 1.000000, 1.000000, 1.000000), cb0[4].xyxx
mul r0.yz, r0.yywy, r2.xxyx
itof r2.xy, v1.xyxx
add r3.xy, r2.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
mul r0.yz, r0.yyzy, r3.xxyx
dp4 r3.y, v0.xyzw, cb4[5].xyzw
mul r4.xyzw, r3.yyyy, cb2[1].xyzw
dp4 r3.x, v0.xyzw, cb4[4].xyzw
mad r4.xyzw, cb2[0].xyzw, r3.xxxx, r4.xyzw
dp4 r3.z, v0.xyzw, cb4[6].xyzw
mad r4.xyzw, cb2[2].xyzw, r3.zzzz, r4.xyzw
dp3 r0.w, r3.xyzx, r3.xyzx
sqrt r0.w, r0.w
add r0.w, r0.w, l(0.000010)
add r3.xyzw, r4.xyzw, cb2[3].xyzw
mul r0.yz, r0.yyzy, r3.wwww
mad o0.xy, r0.yzyy, l(2.000000, 2.000000, 0.000000, 0.000000), r3.xyxx
mov o0.zw, r3.zzzw
mov r1.w, l(1.000000)
mul r1.xyzw, r0.xxxx, r1.xyzw
dp4 r0.y, v0.xyzw, cb4[1].xyzw
add r2.w, r0.y, -cb4[14].y
div r3.x, |r2.w|, r0.w
div r0.w, r2.w, r0.w
mul r0.w, r0.w, cb0[8].z
mul r2.w, r3.x, cb1[5].x
mul r3.x, r2.w, l(-28853.900391)
exp r3.x, r3.x
add r3.x, -r3.x, l(1.000000)
div r3.x, r3.x, r2.w
eq r2.w, r2.w, l(0.000000)
movc r2.w, r2.w, l(20000.000000), r3.x
min r3.x, r0.y, cb4[14].y
mul r3.x, r3.x, -cb1[5].x
mul r3.x, r3.x, l(1.442695)
exp r3.x, r3.x
mul r3.x, r3.x, -cb1[5].y
mul r2.w, r2.w, r3.x
mul r2.w, r2.w, l(1.442695)
exp r2.w, r2.w
min r2.w, r2.w, l(1.000000)
mul r3.x, r0.w, l(-28853.900391)
exp r3.x, r3.x
add r3.x, -r3.x, l(1.000000)
div r3.x, r3.x, r0.w
eq r0.w, r0.w, l(0.000000)
movc r0.w, r0.w, l(20000.000000), r3.x
add r3.x, -cb0[8].x, cb4[14].y
mul r3.x, r3.x, -cb0[8].z
mul r3.x, r3.x, l(1.442695)
exp r3.x, r3.x
mul r3.x, r3.x, -cb0[8].y
mul r0.w, r0.w, r3.x
mul r0.w, r0.w, l(1.442695)
exp r0.w, r0.w
min r0.w, r0.w, l(1.000000)
mul r0.w, r0.w, r2.w
mul_sat o1.w, r0.w, r1.w
mov o1.xyz, r1.xyzx
mov o2.xyzw, l(0,0,0,1.000000)
mov o3.xyzw, l(0,0,0,1.000000)
mov o4.xyzw, l(0,0,0,0)
dp4 r0.x, v0.xyzw, cb4[0].xyzw
dp4 r0.z, v0.xyzw, cb4[2].xyzw
mov o6.xyzw, r0.xyzy
mov o7.xyzw, l(0,0,0,1.000000)
add r2.z, -r2.y, l(1.000000)
mov o8.xy, r2.xzxx
ret 
// Approximately 0 instruction slots used

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