// Sun halo at screen depth

cbuffer _Globals : register(b0)
{
  float3 g_vMoonLightDir : packoffset(c0);
  float4 g_vMoonColor : packoffset(c1);
  float4 g_vGlowColor : packoffset(c2);
  float4x4 g_mMoonMatrix : packoffset(c3);
  float4x4 g_mGlowMatrix : packoffset(c7);
  float4x4 g_mViewProj : packoffset(c11);
  float4x4 g_mView : packoffset(c15);
  float4x4 g_mProj : packoffset(c19);
  float4 g_vOrigin : packoffset(c23);
  float4 g_vSize : packoffset(c24);
  float4 g_vAppear : packoffset(c25);
  float4 g_avRND[4] : packoffset(c26);
  float4 g_avMASK[4] : packoffset(c30) = {
{1.0,0.0,0.0,0.0},
{0.0,1.0,0.0,0.0},
{0.0,0.0,1.0,0.0},
{0.0,0.0,0.0,1.0}};



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


void main( 
  float3 v0 : POSITION0,
  out float4 o0 : SV_Position0,
  out float4 o1 : COLOR0,
  out float3 o2 : TEXCOORD0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = cb0[34].x * v0.y;
  r0.x = v0.x * cb0[34].y + -r0.x;
  r0.y = dot(v0.xy, cb0[34].xyxx);
  r1.y = g_vSize.x * g_vSize.y;
  r1.x = g_vSize.x;
  o0.xy = r0.xy * r1.xy + cb0[35].xyxx;
  o0.zw = cb0[35].zzzw;
  o0.z = 1.0;
  o1.xyzw = float4(1,1,1,1);
  r0.x = saturate(v0.x);
  o2.x = r0.x * cb0[36].z + cb0[36].x;
  r0.x = saturate(1 + -v0.y);
  o2.y = r0.x * cb0[36].w + cb0[36].y;
  o2.z = 0;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.57 on Sun Jun 18 18:36:45 2017
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float3 g_vMoonLightDir;            // Offset:    0 Size:    12 [unused]
//   float4 g_vMoonColor;               // Offset:   16 Size:    16 [unused]
//   float4 g_vGlowColor;               // Offset:   32 Size:    16 [unused]
//   float4x4 g_mMoonMatrix;            // Offset:   48 Size:    64 [unused]
//   float4x4 g_mGlowMatrix;            // Offset:  112 Size:    64 [unused]
//   float4x4 g_mViewProj;              // Offset:  176 Size:    64 [unused]
//   float4x4 g_mView;                  // Offset:  240 Size:    64 [unused]
//   float4x4 g_mProj;                  // Offset:  304 Size:    64 [unused]
//   float4 g_vOrigin;                  // Offset:  368 Size:    16 [unused]
//   float4 g_vSize;                    // Offset:  384 Size:    16
//   float4 g_vAppear;                  // Offset:  400 Size:    16 [unused]
//   float4 g_avRND[4];                 // Offset:  416 Size:    64 [unused]
//   float4 g_avMASK[4];                // Offset:  480 Size:    64 [unused]
//      = 0x3f800000 0x00000000 0x00000000 0x00000000 
//        0x00000000 0x3f800000 0x00000000 0x00000000 
//        0x00000000 0x00000000 0x3f800000 0x00000000 
//        0x00000000 0x00000000 0x00000000 0x3f800000 
//   float4 g_vRotation;                // Offset:  544 Size:    16
//   float4 g_vScreenPos;               // Offset:  560 Size:    16
//   float4 g_vTCoords;                 // Offset:  576 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xyz         2     NONE   float   xyz 
//
vs_4_0
dcl_constantbuffer cb0[37], immediateIndexed
dcl_input v0.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_temps 2
mul r0.x, v0.y, cb0[34].x
mad r0.x, v0.x, cb0[34].y, -r0.x
dp2 r0.y, v0.xyxx, cb0[34].xyxx
mul r1.y, cb0[24].y, cb0[24].x
mov r1.x, cb0[24].x
mad o0.xy, r0.xyxx, r1.xyxx, cb0[35].xyxx
mov o0.zw, cb0[35].zzzw
mov o1.xyzw, l(1.000000,1.000000,1.000000,1.000000)
mov_sat r0.x, v0.x
mad o2.x, r0.x, cb0[36].z, cb0[36].x
add_sat r0.x, -v0.y, l(1.000000)
mad o2.y, r0.x, cb0[36].w, cb0[36].y
mov o2.z, l(0)
ret 
// Approximately 14 instruction slots used

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