// Sun reflection, ambient lighting, etc.
// ---- Created with 3Dmigoto v1.2.39 on Sun May 22 23:34:01 2016
cbuffer cb1 : register(b1)
{
  float4 cb1[3];
}

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




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


void main( 
  float2 v0 : ATTRIBUTE0,
  float2 v1 : ATTRIBUTE1,
  out float4 o0 : TEXCOORD0,
  out float3 o1 : TEXCOORD1,
  out float4 o2 : SV_POSITION0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = v1.xy * cb1[1].xy + cb1[1].zw;
  o0.xy = cb1[2].zw * r0.xy;
  r0.xy = v0.xy * cb1[0].xy + cb1[0].zw;
  r0.xy = cb1[2].xy * r0.xy;
  r0.xy = r0.xy * float2(2,2) + float2(-1,-1);
  r0.xy = float2(1,-1) * r0.xy;
  o2.xy = r0.xy;

// Move sun reflection to infinity:
  r0.x -= StereoParams.Load(0).x;

  r1.xyz = cb0[33].xyz * r0.yyy;
  r1.xyz = r0.xxx * cb0[32].xyz + r1.xyz;
  o1.xyz = cb0[34].xyz + r1.xyz;
  o2.zw = float2(0,1);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// ATTRIBUTE                0   xy          0     NONE   float   xy  
// ATTRIBUTE                1   xy          1     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy  
// TEXCOORD                 1   xyz         1     NONE   float   xyz 
// SV_POSITION              0   xyzw        2      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[35], immediateIndexed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_input v0.xy
dcl_input v1.xy
dcl_output o0.xy
dcl_output o1.xyz
dcl_output_siv o2.xyzw, position
dcl_temps 2
mad r0.xy, v1.xyxx, cb1[1].xyxx, cb1[1].zwzz
mul o0.xy, r0.xyxx, cb1[2].zwzz
mad r0.xy, v0.xyxx, cb1[0].xyxx, cb1[0].zwzz
mul r0.xy, r0.xyxx, cb1[2].xyxx
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
mul r1.xyz, r0.yyyy, cb0[33].xyzx
mad r1.xyz, r0.xxxx, cb0[32].xyzx, r1.xyzx
mov o2.xy, r0.xyxx
add o1.xyz, r1.xyzx, cb0[34].xyzx
mov o2.zw, l(0,0,0,1.000000)
ret 
// Approximately 0 instruction slots used

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


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HLSL errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:\Steam\steamapps\common\The Park\AtlanticIslandPark\Binaries\Win64\ShaderCache\b1d33e7ed718f2a2-vs_replace.txt(24,14-15): warning X3578: Output value 'o0' is not completely initialized
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
