cbuffer cb3 : register(b3)
{
  float4 cb3[14];
}


cbuffer PER_BATCH : register(b0)
{
  float3 slHazeColPartialMieInScatter : packoffset(c0);
  float4 _InstancingParams : packoffset(c1);
  float4 miscCamFront : packoffset(c2);
  float3 vfColGradDelta : packoffset(c3);
  float4 vfRampParams : packoffset(c4);
  float4 PS_NearFarClipDist : packoffset(c5);
  float3 slSunDirection : packoffset(c6);
  float3 vfColGradBase : packoffset(c7);
  float3 slHazeColPartialRayleighInScatter : packoffset(c8);
  float3 vfFogColor : packoffset(c9);
  float4 BaseTCMatrix : packoffset(c10);
  float3 slPhaseFunctionConstants : packoffset(c11);
  float4 vfParams : packoffset(c12);
  float4 vfViewPos : packoffset(c13);
}

cbuffer STATIC_INSTANCE : register(b2)
{
  row_major float3x4 ObjWorldMatrix : packoffset(c0);
}

cbuffer PER_FRAME : register(b3)
{
  float4 g_VS_WorldViewPos : packoffset(c6);
  row_major float4x4 g_VS_ViewProjZeroMatr : packoffset(c10);
}

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main( 
  float4 v0 : POSITION0,
  float4 v1 : TEXCOORD0,
  float4 v2 : COLOR0,
  float4 v3 : NORMAL0,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : TEXCOORD2,
  out float4 o4 : COLOR0,
  out float4 o5 : COLOR1)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.w = -cb3[6].x + ObjWorldMatrix._m03;
  r0.xyz = ObjWorldMatrix._m00_m01_m02;
  r1.xyz = v0.xyz;
  r1.w = 1;
  r0.x = dot(r0.xyzw, r1.xyzw);
  r2.w = -cb3[6].y + ObjWorldMatrix._m13;
  r2.xyz = ObjWorldMatrix._m10_m11_m12;
  r0.y = dot(r2.xyzw, r1.xyzw);
  r2.w = -cb3[6].z + ObjWorldMatrix._m23;
  r2.xyz = ObjWorldMatrix._m20_m21_m22;
  r0.z = dot(r2.xyzw, r1.xyzw);
  r0.w = 1;
  r1.x = dot(cb3[12].xyzw, r0.xyzw);
  r1.z = 0.00100000005 + r1.x;
  r1.x = dot(cb3[10].xyzw, r0.xyzw);
  r1.y = dot(cb3[11].xyzw, r0.xyzw);
  r1.w = dot(cb3[13].xyzw, r0.xyzw);
  r0.xyz = cb3[6].xyz + r0.xyz;
  o0.xyzw = r1.xyzw;
  
    float4 stereo = StereoParams.Load(0);
  r1.x += stereo.x * (r1.w - stereo.y);
  
  o2.zw = r1.zw;
  r1.xy = r1.xy * float2(1,-1) + r1.ww;
  o2.xy = float2(0.5,0.5) * r1.xy;
  o1.w = r0.z;
  r0.w = 1;
  o1.x = dot(BaseTCMatrix.xy, r0.yw);
  o1.y = dot(BaseTCMatrix.xz, r0.xw);
  o1.z = BaseTCMatrix.x;
  o3.xyz = v3.xyz * float3(2,2,2) + float3(-1,-1,-1);
  o3.w = 1;
  r0.x = 0.498039216 < v2.y;
  r0.y = -0.501960814 + v2.y;
  r0.x = r0.x ? r0.y : v2.y;
  o4.y = r0.x;
  r0.x = r0.x >= 0.25;
  o5.w = r0.x ? 1.000000 : 0;
  o4.xzw = v2.zxw;
  o5.xy = v2.zx;
  o5.z = v3.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.27.952.3022
//
//   using 3Dmigoto v1.1.34 on Sun Aug 09 08:57:40 2015
//
//
// Buffer Definitions: 
//
// cbuffer PER_BATCH
// {
//
//   float3 slHazeColPartialMieInScatter;// Offset:    0 Size:    12 [unused]
//   float4 _InstancingParams;          // Offset:   16 Size:    16 [unused]
//   float4 miscCamFront;               // Offset:   32 Size:    16 [unused]
//   float3 vfColGradDelta;             // Offset:   48 Size:    12 [unused]
//   float4 vfRampParams;               // Offset:   64 Size:    16 [unused]
//   float4 PS_NearFarClipDist;         // Offset:   80 Size:    16 [unused]
//   float3 slSunDirection;             // Offset:   96 Size:    12 [unused]
//   float3 vfColGradBase;              // Offset:  112 Size:    12 [unused]
//   float3 slHazeColPartialRayleighInScatter;// Offset:  128 Size:    12 [unused]
//   float3 vfFogColor;                 // Offset:  144 Size:    12 [unused]
//   float4 BaseTCMatrix;               // Offset:  160 Size:    16
//   float3 slPhaseFunctionConstants;   // Offset:  176 Size:    12 [unused]
//   float4 vfParams;                   // Offset:  192 Size:    16 [unused]
//   float4 vfViewPos;                  // Offset:  208 Size:    16 [unused]
//
// }
//
// cbuffer STATIC_INSTANCE
// {
//
//   row_major float3x4 ObjWorldMatrix; // Offset:    0 Size:    48
//
// }
//
// cbuffer PER_FRAME
// {
//
//   float4 g_VS_WorldViewPos;          // Offset:   96 Size:    16
//   row_major float4x4 g_VS_ViewProjZeroMatr;// Offset:  160 Size:    64
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PER_BATCH                         cbuffer      NA          NA    0        1
// STATIC_INSTANCE                   cbuffer      NA          NA    2        1
// PER_FRAME                         cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz 
// TEXCOORD                 0   xyzw        1     NONE   float       
// COLOR                    0   xyzw        2     NONE   float   xyzw
// NORMAL                   0   xyzw        3     NONE   float   xyzw
//
//
// 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   xyzw        3     NONE   float   xyzw
// COLOR                    0   xyzw        4     NONE   float   xyzw
// COLOR                    1   xyzw        5     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[11], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_constantbuffer cb3[14], immediateIndexed
dcl_input v0.xyz
dcl_input v2.xyzw
dcl_input v3.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_temps 3
add r0.w, cb2[0].w, -cb3[6].x
mov r0.xyz, cb2[0].xyzx
mov r1.xyz, v0.xyzx
mov r1.w, l(1.000000)
dp4 r0.x, r0.xyzw, r1.xyzw
add r2.w, cb2[1].w, -cb3[6].y
mov r2.xyz, cb2[1].xyzx
dp4 r0.y, r2.xyzw, r1.xyzw
add r2.w, cb2[2].w, -cb3[6].z
mov r2.xyz, cb2[2].xyzx
dp4 r0.z, r2.xyzw, r1.xyzw
mov r0.w, l(1.000000)
dp4 r1.x, cb3[12].xyzw, r0.xyzw
add r1.z, r1.x, l(0.001000)
dp4 r1.x, cb3[10].xyzw, r0.xyzw
dp4 r1.y, cb3[11].xyzw, r0.xyzw
dp4 r1.w, cb3[13].xyzw, r0.xyzw
add r0.xyz, r0.xyzx, cb3[6].xyzx
mov o0.xyzw, r1.xyzw
mov o2.zw, r1.zzzw
mad r1.xy, r1.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000), r1.wwww
mul o2.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mov o1.w, r0.z
mov r0.w, l(1.000000)
dp2 o1.x, cb0[10].xyxx, r0.ywyy
dp2 o1.y, cb0[10].xzxx, r0.xwxx
mov o1.z, cb0[10].x
mad o3.xyz, v3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mov o3.w, l(1.000000)
lt r0.x, l(0.498039), v2.y
add r0.y, v2.y, l(-0.501961)
movc r0.x, r0.x, r0.y, v2.y
mov o4.y, r0.x
ge r0.x, r0.x, l(0.250000)
and o5.w, r0.x, l(0x3f800000)
mov o4.xzw, v2.zzxw
mov o5.xy, v2.zxzz
mov o5.z, v3.w
ret 
// Approximately 39 instruction slots used

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