//Inventory
cbuffer cb2 : register(b2)
{
  float4 cb2[8];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[3];
}


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

void main( 
  float4 v0 : POSITION0,
  float2 v1 : TEXCOORD0,
  float4 v2 : NORMAL0,
  float4 v3 : BINORMAL0,
  float4 v4 : COLOR0,
  out float4 o0 : SV_POSITION0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD4,
  out float4 o3 : TEXCOORD1,
  out float4 o4 : TEXCOORD2,
  out float4 o5 : TEXCOORD3,
  out float3 o6 : TEXCOORD5,
  out float4 o7 : COLOR0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v0.xyz;
  r0.w = 1;
  r1.x = dot(cb2[2].xyzw, r0.xyzw);
  o0.z = r1.x;
  o2.w = r1.x;
  o0.x = dot(cb2[0].xyzw, r0.xyzw);
  o0.y = dot(cb2[1].xyzw, r0.xyzw);
  o0.w = dot(cb2[3].xyzw, r0.xyzw);
  
float4 s = StereoParams.Load(0);
float4 p = IniParams.Load(0);
// if (p.z == 1)
// {
	o0.x -= s.x * (o0.w - s.y)*p.z; //1.5; 
// }

  o1.xy = v1.xy * cb1[2].zw + cb1[2].xy;
  r1.x = dot(cb2[4].xyzw, r0.xyzw);
  r1.y = dot(cb2[5].xyzw, r0.xyzw);
  r1.z = dot(cb2[6].xyzw, r0.xyzw);
  o2.xyz = r1.xyz;
  o6.xyz = cb2[7].xyz + -r1.xyz;
  r0.xyz = v3.xyz * float3(2,2,2) + float3(-1,-1,-1);
  o3.y = dot(r0.xyz, cb2[4].xyz);
  r1.xyz = v2.xyz * float3(2,2,2) + float3(-1,-1,-1);
  o3.z = dot(r1.xyz, cb2[4].xyz);
  r2.x = v0.w;
  r2.y = v2.w * 2 + -1;
  r2.z = v3.w * 2 + -1;
  o3.x = dot(r2.xyz, cb2[4].xyz);
  o4.x = dot(r2.xyz, cb2[5].xyz);
  o5.x = dot(r2.xyz, cb2[6].xyz);
  o4.y = dot(r0.xyz, cb2[5].xyz);
  o5.y = dot(r0.xyz, cb2[6].xyz);
  o4.z = dot(r1.xyz, cb2[5].xyz);
  o5.z = dot(r1.xyz, cb2[6].xyz);
  r0.xyz = log2(v4.xyz);
  r0.xyz = float3(2.20000005,2.20000005,2.20000005) * r0.xyz;
  o7.xyz = exp2(r0.xyz);
  o7.w = v4.w;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.9 on Mon Nov 23 15:07:00 2015
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// NORMAL                   0   xyzw        2     NONE   float   xyzw
// BINORMAL                 0   xyzw        3     NONE   float   xyzw
// COLOR                    0   xyzw        4     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// TEXCOORD                 4   xyzw        2     NONE   float   xyzw
// TEXCOORD                 1   xyz         3     NONE   float   xyz 
// TEXCOORD                 2   xyz         4     NONE   float   xyz 
// TEXCOORD                 3   xyz         5     NONE   float   xyz 
// TEXCOORD                 5   xyz         6     NONE   float   xyz 
// COLOR                    0   xyzw        7     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb2[8], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyzw
dcl_input v3.xyzw
dcl_input v4.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_output o3.xyz
dcl_output o4.xyz
dcl_output o5.xyz
dcl_output o6.xyz
dcl_output o7.xyzw
dcl_temps 3
mov r0.xyz, v0.xyzx
mov r0.w, l(1.000000)
dp4 r1.x, cb2[2].xyzw, r0.xyzw
mov o0.z, r1.x
mov o2.w, r1.x
dp4 o0.x, cb2[0].xyzw, r0.xyzw
dp4 o0.y, cb2[1].xyzw, r0.xyzw
dp4 o0.w, cb2[3].xyzw, r0.xyzw
mad o1.xy, v1.xyxx, cb1[2].zwzz, cb1[2].xyxx
dp4 r1.x, cb2[4].xyzw, r0.xyzw
dp4 r1.y, cb2[5].xyzw, r0.xyzw
dp4 r1.z, cb2[6].xyzw, r0.xyzw
mov o2.xyz, r1.xyzx
add o6.xyz, -r1.xyzx, cb2[7].xyzx
mad r0.xyz, v3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 o3.y, r0.xyzx, cb2[4].xyzx
mad r1.xyz, v2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 o3.z, r1.xyzx, cb2[4].xyzx
mov r2.x, v0.w
mad r2.y, v2.w, l(2.000000), l(-1.000000)
mad r2.z, v3.w, l(2.000000), l(-1.000000)
dp3 o3.x, r2.xyzx, cb2[4].xyzx
dp3 o4.x, r2.xyzx, cb2[5].xyzx
dp3 o5.x, r2.xyzx, cb2[6].xyzx
dp3 o4.y, r0.xyzx, cb2[5].xyzx
dp3 o5.y, r0.xyzx, cb2[6].xyzx
dp3 o4.z, r1.xyzx, cb2[5].xyzx
dp3 o5.z, r1.xyzx, cb2[6].xyzx
log r0.xyz, v4.xyzx
mul r0.xyz, r0.xyzx, l(2.200000, 2.200000, 2.200000, 0.000000)
exp o7.xyz, r0.xyzx
mov o7.w, v4.w
ret 
// Approximately 0 instruction slots used

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