//clouds-- OLD
cbuffer cbCamera : register(b0)
{
  float4x4 ksView : packoffset(c0);
  float4x4 ksProjection : packoffset(c4);
  float4x4 ksMVPInverse : packoffset(c8);
  float4 ksCameraPosition : packoffset(c12);
  float ksNearPlane : packoffset(c13);
  float ksFarPlane : packoffset(c13.y);
  float ksFOV : packoffset(c13.z);
  float ksDofFactor : packoffset(c13.w);
}

cbuffer cbPerObject : register(b1)
{
  float4x4 ksWorld : packoffset(c0);
}

cbuffer cbLighting : register(b2)
{
  float4 ksLightDirection : packoffset(c0);
  float4 ksAmbientColor : packoffset(c1);
  float4 ksLightColor : packoffset(c2);
  float4 ksHorizonColor : packoffset(c3);
  float4 ksZenithColor : packoffset(c4);
  float ksExposure : packoffset(c5);
  float ksScreenWidth : packoffset(c5.y);
  float ksScreenHeight : packoffset(c5.z);
  float ksFogLinear : packoffset(c5.w);
  float ksFogBlend : packoffset(c6);
  float3 ksFogColor : packoffset(c6.y);
  float ksCloudCover : packoffset(c7);
  float ksCloudCutoff : packoffset(c7.y);
  float ksCloudColor : packoffset(c7.z);
  float ksCloudOffset : packoffset(c7.w);
  float ksMinExposure : packoffset(c8);
  float ksMaxExposure : packoffset(c8.y);
  float ksDofFocus : packoffset(c8.z);
  float ksDofRange : packoffset(c8.w);
  float ksSaturation : packoffset(c9);
  float ksGameTime : packoffset(c9.y);
  float2 boh44 : packoffset(c9.z);
}

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

void main( 
  float4 v0 : SV_POSITION0,
  float3 v1 : NORMAL0,
  float2 v2 : TEXCOORD0,
  float3 v3 : TANGENT0,
  out float4 o0 : SV_POSITION0,
  out float4 o1 : TEXCOORD2,
  out float4 o2 : TEXCOORD3,
  out float4 o3 : TEXCOORD0,
  out float3 o4 : TEXCOORD4)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.w = dot(v0.xyzw, ksWorld._m03_m13_m23_m33);
  r0.x = dot(v0.xyzw, ksWorld._m00_m10_m20_m30);
  r0.y = dot(v0.xyzw, ksWorld._m01_m11_m21_m31);
  r0.z = dot(v0.xyzw, ksWorld._m02_m12_m22_m32);
  r1.x = dot(r0.xyzw, ksView._m00_m10_m20_m30);
  r1.y = dot(r0.xyzw, ksView._m01_m11_m21_m31);
  r1.z = dot(r0.xyzw, ksView._m02_m12_m22_m32);
  r1.w = dot(r0.xyzw, ksView._m03_m13_m23_m33);
  o1.xyz = r0.xyz;
  o0.x = dot(r1.xyzw, ksProjection._m00_m10_m20_m30);
  o0.y = dot(r1.xyzw, ksProjection._m01_m11_m21_m31);
  o0.z = dot(r1.xyzw, ksProjection._m02_m12_m22_m32);
  o0.w = dot(r1.xyzw, ksProjection._m03_m13_m23_m33);
float4 stereo = StereoParams.Load(0);
float4 iniParams = IniParams.Load(0);
o0.x += stereo.x * stereo.y;
  o2.xyz = v1.xyz;
  o3.xy = v2.xy;
  r0.x = dot(ksLightDirection.xyz, ksView._m00_m10_m20);
  r0.y = dot(ksLightDirection.xyz, ksView._m01_m11_m21);
  r0.z = dot(ksLightDirection.xyz, ksView._m02_m12_m22);
  o4.x = dot(r0.xyz, ksProjection._m00_m10_m20);
  o4.y = dot(r0.xyz, ksProjection._m01_m11_m21);
  o4.z = dot(r0.xyz, ksProjection._m02_m12_m22);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.9 on Sat Dec 05 13:57:56 2015
//
//
// Buffer Definitions: 
//
// cbuffer cbCamera
// {
//
//   float4x4 ksView;                   // Offset:    0 Size:    64
//   float4x4 ksProjection;             // Offset:   64 Size:    64
//   float4x4 ksMVPInverse;             // Offset:  128 Size:    64 [unused]
//   float4 ksCameraPosition;           // Offset:  192 Size:    16 [unused]
//   float ksNearPlane;                 // Offset:  208 Size:     4 [unused]
//   float ksFarPlane;                  // Offset:  212 Size:     4 [unused]
//   float ksFOV;                       // Offset:  216 Size:     4 [unused]
//   float ksDofFactor;                 // Offset:  220 Size:     4 [unused]
//
// }
//
// cbuffer cbPerObject
// {
//
//   float4x4 ksWorld;                  // Offset:    0 Size:    64
//
// }
//
// cbuffer cbLighting
// {
//
//   float4 ksLightDirection;           // Offset:    0 Size:    16
//   float4 ksAmbientColor;             // Offset:   16 Size:    16 [unused]
//   float4 ksLightColor;               // Offset:   32 Size:    16 [unused]
//   float4 ksHorizonColor;             // Offset:   48 Size:    16 [unused]
//   float4 ksZenithColor;              // Offset:   64 Size:    16 [unused]
//   float ksExposure;                  // Offset:   80 Size:     4 [unused]
//   float ksScreenWidth;               // Offset:   84 Size:     4 [unused]
//   float ksScreenHeight;              // Offset:   88 Size:     4 [unused]
//   float ksFogLinear;                 // Offset:   92 Size:     4 [unused]
//   float ksFogBlend;                  // Offset:   96 Size:     4 [unused]
//   float3 ksFogColor;                 // Offset:  100 Size:    12 [unused]
//   float ksCloudCover;                // Offset:  112 Size:     4 [unused]
//   float ksCloudCutoff;               // Offset:  116 Size:     4 [unused]
//   float ksCloudColor;                // Offset:  120 Size:     4 [unused]
//   float ksCloudOffset;               // Offset:  124 Size:     4 [unused]
//   float ksMinExposure;               // Offset:  128 Size:     4 [unused]
//   float ksMaxExposure;               // Offset:  132 Size:     4 [unused]
//   float ksDofFocus;                  // Offset:  136 Size:     4 [unused]
//   float ksDofRange;                  // Offset:  140 Size:     4 [unused]
//   float ksSaturation;                // Offset:  144 Size:     4 [unused]
//   float ksGameTime;                  // Offset:  148 Size:     4 [unused]
//   float2 boh44;                      // Offset:  152 Size:     8 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbCamera                          cbuffer      NA          NA    0        1
// cbPerObject                       cbuffer      NA          NA    1        1
// cbLighting                        cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz 
// TEXCOORD                 0   xy          2     NONE   float   xy  
// TANGENT                  0   xyz         3     NONE   float       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 2   xyz         1     NONE   float   xyz 
// TEXCOORD                 3   xyz         2     NONE   float   xyz 
// TEXCOORD                 0   xy          3     NONE   float   xy  
// TEXCOORD                 4   xyz         4     NONE   float   xyz 
//
vs_4_0
dcl_constantbuffer cb0[8], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb2[1], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyz
dcl_output o3.xy
dcl_output o4.xyz
dcl_temps 2
dp4 r0.w, v0.xyzw, cb1[3].xyzw
dp4 r0.x, v0.xyzw, cb1[0].xyzw
dp4 r0.y, v0.xyzw, cb1[1].xyzw
dp4 r0.z, v0.xyzw, cb1[2].xyzw
dp4 r1.x, r0.xyzw, cb0[0].xyzw
dp4 r1.y, r0.xyzw, cb0[1].xyzw
dp4 r1.z, r0.xyzw, cb0[2].xyzw
dp4 r1.w, r0.xyzw, cb0[3].xyzw
mov o1.xyz, r0.xyzx
dp4 o0.x, r1.xyzw, cb0[4].xyzw
dp4 o0.y, r1.xyzw, cb0[5].xyzw
dp4 o0.z, r1.xyzw, cb0[6].xyzw
dp4 o0.w, r1.xyzw, cb0[7].xyzw
mov o2.xyz, v1.xyzx
mov o3.xy, v2.xyxx
dp3 r0.x, cb2[0].xyzx, cb0[0].xyzx
dp3 r0.y, cb2[0].xyzx, cb0[1].xyzx
dp3 r0.z, cb2[0].xyzx, cb0[2].xyzx
dp3 o4.x, r0.xyzx, cb0[4].xyzx
dp3 o4.y, r0.xyzx, cb0[5].xyzx
dp3 o4.z, r0.xyzx, cb0[6].xyzx
ret 
// Approximately 22 instruction slots used

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