//Sotenbori river water VS.
// ---- Created with 3Dmigoto v1.3.16 on Sun May 12 18:24:42 2019
Texture2D<float4> t0 : register(t0);

SamplerState s0_s : register(s0);

cbuffer cb9 : register(b9)
{
  float4 cb9[11];
}

cbuffer cb12 : register(b12)
{
  float4 cb12[4];
}

cbuffer cb10 : register(b10)
{
  float4 cb10[3];
}




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


void main(
  float4 v0 : POSITION0,
  out float4 o0 : TEXCOORD0,
  out float4 o1 : TEXCOORD1,
  out float4 o2 : TEXCOORD2,
  out float3 o3 : TEXCOORD3,
  out float4 o4 : SV_POSITION0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);

  r0.x = dot(cb10[0].xyzw, v0.xyzw);
  r0.y = dot(cb10[1].xyzw, v0.xyzw);
  r0.z = dot(cb10[2].xyzw, v0.xyzw);
  r0.w = dot(r0.xyz, cb9[3].xyz);
  r0.w = -cb9[3].w / r0.w;
  r0.xyz = r0.xyz * r0.www;
  r0.w = v0.w;
  
  
  
  r1.x = dot(cb9[8].xyzw, r0.xyzw);
  r1.y = dot(cb9[9].xyzw, r0.xyzw);
  r1.z = dot(cb9[10].xyzw, r0.xyzw);
  
  r2.xy = r1.xy / r1.zz;
  o3.xyz = r1.xyz;
  r1.x = t0.SampleLevel(s0_s, r2.xy, 0).x;
  
  
  
  r2.x = dot(cb9[4].xyzw, r0.xyzw);
  r2.y = dot(cb9[5].xyzw, r0.xyzw);
  r2.z = dot(cb9[6].xyzw, r0.xyzw);
  r0.w = dot(cb9[7].xyzw, r0.xyzw);
  r0.xyz = cb9[2].xyz * r1.xxx + r2.xyz;
  o0.xyz = r0.xyz;
  
  
  
  r1.x = dot(cb12[0].xyzw, r0.xyzw);
  r1.y = dot(cb12[1].xyzw, r0.xyzw);
  r1.w = dot(cb12[3].xyzw, r0.xyzw);
  r2.xyz = float3(0.5,-0.5,0.5) * r1.xyw;
  o4.xyw = r1.xyw;
  o1.z = r1.w;
  o1.xy = r2.xy + r2.zz;
  o2.x = dot(cb9[0].xyzw, r0.xyzw);
  o2.y = dot(cb9[1].xyzw, r0.xyzw);
  o4.z = dot(cb12[2].xyzw, r0.xyzw);
  //o0.x+=stereo.x*(o0.z-stereo.y);
  o1.x+=stereo.x*(o1.z-stereo.y)*0.5;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Sun May 12 18:24:42 2019
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xyz         0     NONE   float   xyz
// TEXCOORD                 1   xyz         1     NONE   float   xyz
// TEXCOORD                 2   xy          2     NONE   float   xy
// TEXCOORD                 3   xyz         3     NONE   float   xyz
// SV_POSITION              0   xyzw        4      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb10[3], immediateIndexed
dcl_constantbuffer cb12[4], immediateIndexed
dcl_constantbuffer cb9[11], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input v0.xyzw
dcl_output o0.xyz
dcl_output o1.xyz
dcl_output o2.xy
dcl_output o3.xyz
dcl_output_siv o4.xyzw, position
dcl_temps 3
dp4 r0.x, cb10[0].xyzw, v0.xyzw
dp4 r0.y, cb10[1].xyzw, v0.xyzw
dp4 r0.z, cb10[2].xyzw, v0.xyzw
dp3 r0.w, r0.xyzx, cb9[3].xyzx
div r0.w, -cb9[3].w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mov r0.w, v0.w
dp4 r1.x, cb9[8].xyzw, r0.xyzw
dp4 r1.y, cb9[9].xyzw, r0.xyzw
dp4 r1.z, cb9[10].xyzw, r0.xyzw
div r2.xy, r1.xyxx, r1.zzzz
mov o3.xyz, r1.xyzx
sample_l_indexable(texture2d)(float,float,float,float) r1.x, r2.xyxx, t0.xyzw, s0, l(0.000000)
dp4 r2.x, cb9[4].xyzw, r0.xyzw
dp4 r2.y, cb9[5].xyzw, r0.xyzw
dp4 r2.z, cb9[6].xyzw, r0.xyzw
dp4 r0.w, cb9[7].xyzw, r0.xyzw
mad r0.xyz, cb9[2].xyzx, r1.xxxx, r2.xyzx
mov o0.xyz, r0.xyzx
dp4 r1.x, cb12[0].xyzw, r0.xyzw
dp4 r1.y, cb12[1].xyzw, r0.xyzw
dp4 r1.w, cb12[3].xyzw, r0.xyzw
mul r2.xyz, r1.xywx, l(0.500000, -0.500000, 0.500000, 0.000000)
mov o4.xyw, r1.xyxw
mov o1.z, r1.w
add o1.xy, r2.zzzz, r2.xyxx
dp4 o2.x, cb9[0].xyzw, r0.xyzw
dp4 o2.y, cb9[1].xyzw, r0.xyzw
dp4 o4.z, cb12[2].xyzw, r0.xyzw
ret
// Approximately 0 instruction slots used

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