//Water heatwave to stereoize (entering STEM cutscene).
// ---- Created with 3Dmigoto v1.3.16 on Sat Oct  2 09:58:34 2021

cbuffer vblock : register(b0)
{
  float4 globalvieworigin : packoffset(c0);
  float4 mvpmatrixx : packoffset(c1);
  float4 mvpmatrixy : packoffset(c2);
  float4 mvpmatrixz : packoffset(c3);
  float4 mvpmatrixw : packoffset(c4);
}



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


void main(
  float4 v0 : POSITION0,
  float4 v1 : TEXCOORD0,
  float4 v2 : COLOR0,
  float4 v3 : TEXCOORD2,
  float4 v4 : TEXCOORD3,
  out float4 o0 : COLOR0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : TEXCOORD2,
  out float4 o4 : TEXCOORD3,
  out float4 o5 : TEXCOORD4,
  out float4 o6 : SV_Position0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  
  o0.xyzw = v2.xyzw;
  o1.xyzw = v1.xyzw;
  r0.x = -0.498039216 + v4.z;
  r0.x = r0.x / v4.x;
  o2.x = v1.x + r0.x;
  o2.y = v1.y;
  o2.z = v4.y;
  o2.w = 0;
  o3.xy = v1.zw;
  o3.z = 0;
  o3.w = v3.x;
  o4.xyw = float3(0,0,0);
  o4.z = v3.w;
  r0.xyz = -globalvieworigin.xyz + v0.xyz;
  r0.w = v0.w;
  r1.x = dot(r0.xyzw, mvpmatrixx.xyzw);
  r1.y = dot(r0.xyzw, mvpmatrixy.xyzw);
  r1.z = dot(r0.xyzw, mvpmatrixz.xyzw);
  r1.w = dot(r0.xyzw, mvpmatrixw.xyzw);
  o5.xyzw = r1.xyzw;
  o6.xyzw = r1.xyzw;
  o6.x+=stereo.x*(o6.w);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Sat Oct  2 09:58:34 2021
//
//
// Buffer Definitions:
//
// cbuffer vblock
// {
//
//   float4 globalvieworigin;           // Offset:    0 Size:    16
//   float4 mvpmatrixx;                 // Offset:   16 Size:    16
//   float4 mvpmatrixy;                 // Offset:   32 Size:    16
//   float4 mvpmatrixz;                 // Offset:   48 Size:    16
//   float4 mvpmatrixw;                 // Offset:   64 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// vblock                            cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   x  w
// TEXCOORD                 3   xyzw        4     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// SV_Position              0   xyzw        6      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[5], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_input v2.xyzw
dcl_input v3.xw
dcl_input v4.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output_siv o6.xyzw, position
dcl_temps 2
mov o0.xyzw, v2.xyzw
mov o1.xyzw, v1.xyzw
add r0.x, v4.z, l(-0.498039216)
div r0.x, r0.x, v4.x
add o2.x, r0.x, v1.x
mov o2.y, v1.y
mov o2.z, v4.y
mov o2.w, l(0)
mov o3.xy, v1.zwzz
mov o3.z, l(0)
mov o3.w, v3.x
mov o4.xyw, l(0,0,0,0)
mov o4.z, v3.w
add r0.xyz, v0.xyzx, -cb0[0].xyzx
mov r0.w, v0.w
dp4 r1.x, r0.xyzw, cb0[1].xyzw
dp4 r1.y, r0.xyzw, cb0[2].xyzw
dp4 r1.z, r0.xyzw, cb0[3].xyzw
dp4 r1.w, r0.xyzw, cb0[4].xyzw
mov o5.xyzw, r1.xyzw
mov o6.xyzw, r1.xyzw
ret
// Approximately 22 instruction slots used

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