//skybox (also coins, some water reflections)
cbuffer cb_object1 : register(b0)
{
  float4x4 u_mvMatrix : packoffset(c0);
  float4x4 u_mvpMatrix : packoffset(c4);
  float4x4 u_mlpMatrix : packoffset(c8);
  float4 u_tex0ScaleOffset : packoffset(c12);
}

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

void main(
  float4 v0 : POSITION0,
  float3 v1 : NORMAL0,
  float2 v2 : TEXCOORD0,
  out float4 o0 : SV_Position0,
  out float4 o1 : POSITION1,
  out float4 o2 : POSITION2,
  out float4 o3 : NORMAL0,
  out float3 o4 : COLOR0,
  out float2 o5 : TEXCOORD0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = dot(v0.xyzw, u_mvpMatrix._m00_m10_m20_m30);
  r0.y = dot(v0.xyzw, u_mvpMatrix._m01_m11_m21_m31);
  r0.z = dot(v0.xyzw, u_mvpMatrix._m02_m12_m22_m32);
  r0.w = dot(v0.xyzw, u_mvpMatrix._m03_m13_m23_m33);
  o0.xyzw = r0.xyzw;
float4 stereo = StereoParams.Load(0);

if(stereo.y > 1 && o0.z > 20){
o0.x -= stereo.x*(o0.w - stereo.y);
o0.x += stereo.x*(o0.w - (stereo.y * 0.36));
}
  r1.x = dot(v0.xyzw, u_mvMatrix._m00_m10_m20_m30);
  r1.y = dot(v0.xyzw, u_mvMatrix._m01_m11_m21_m31);
  r1.z = dot(v0.xyzw, u_mvMatrix._m02_m12_m22_m32);
  r1.w = dot(v0.xyzw, u_mvMatrix._m03_m13_m23_m33);
  o1.xyzw = r1.xyzw;
  o2.xyzw = r1.xyzw;
  o3.x = dot(v1.xyz, u_mvMatrix._m00_m10_m20);
  o3.y = dot(v1.xyz, u_mvMatrix._m01_m11_m21);
  o3.z = dot(v1.xyz, u_mvMatrix._m02_m12_m22);
  o3.w = dot(v1.xyz, u_mvMatrix._m03_m13_m23);
  r1.x = dot(r0.xyzw, u_mlpMatrix._m00_m10_m20_m30);
  r1.y = dot(r0.xyzw, u_mlpMatrix._m01_m11_m21_m31);
  r1.z = dot(r0.xyzw, u_mlpMatrix._m02_m12_m22_m32);
  r0.x = dot(r0.xyzw, u_mlpMatrix._m03_m13_m23_m33);
  o4.xyz = saturate(r1.xyz / r0.xxx);
  o5.xy = v2.xy * u_tex0ScaleOffset.xy + u_tex0ScaleOffset.zw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions: 
//
// cbuffer cb_object1
// {
//
//   float4x4 u_mvMatrix;               // Offset:    0 Size:    64
//   float4x4 u_mvpMatrix;              // Offset:   64 Size:    64
//   float4x4 u_mlpMatrix;              // Offset:  128 Size:    64
//   float4 u_tex0ScaleOffset;          // Offset:  192 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cb_object1                        cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz 
// TEXCOORD                 0   xy          2     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// POSITION                 1   xyzw        1     NONE   float   xyzw
// POSITION                 2   xyzw        2     NONE   float   xyzw
// NORMAL                   0   xyzw        3     NONE   float   xyzw
// COLOR                    0   xyz         4     NONE   float   xyz 
// TEXCOORD                 0   xy          5     NONE   float   xy  
//
vs_4_0
dcl_constantbuffer cb0[13], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyz
dcl_output o5.xy
dcl_temps 2
dp4 r0.x, v0.xyzw, cb0[4].xyzw
dp4 r0.y, v0.xyzw, cb0[5].xyzw
dp4 r0.z, v0.xyzw, cb0[6].xyzw
dp4 r0.w, v0.xyzw, cb0[7].xyzw
mov o0.xyzw, r0.xyzw
dp4 r1.x, v0.xyzw, cb0[0].xyzw
dp4 r1.y, v0.xyzw, cb0[1].xyzw
dp4 r1.z, v0.xyzw, cb0[2].xyzw
dp4 r1.w, v0.xyzw, cb0[3].xyzw
mov o1.xyzw, r1.xyzw
mov o2.xyzw, r1.xyzw
dp3 o3.x, v1.xyzx, cb0[0].xyzx
dp3 o3.y, v1.xyzx, cb0[1].xyzx
dp3 o3.z, v1.xyzx, cb0[2].xyzx
dp3 o3.w, v1.xyzx, cb0[3].xyzx
dp4 r1.x, r0.xyzw, cb0[8].xyzw
dp4 r1.y, r0.xyzw, cb0[9].xyzw
dp4 r1.z, r0.xyzw, cb0[10].xyzw
dp4 r0.x, r0.xyzw, cb0[11].xyzw
div_sat o4.xyz, r1.xyzx, r0.xxxx
mad o5.xy, v2.xyxx, cb0[12].xyxx, cb0[12].zwzz
ret 
// Approximately 22 instruction slots used

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