//DMC3 blob shadows and orbs VS (update).
// ---- Created with 3Dmigoto v1.3.7 on Mon Apr 02 12:56:46 2018

cbuffer VS_CONSTANT_BUFFER : register(b0)
{
  float4x4 Transform : packoffset(c0);
  float4 uvScale : packoffset(c4);
  float4 fogCol : packoffset(c5);
}



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


void main(
  float3 v0 : POSITION0,
  float2 v1 : TEXCOORD0,
  float4 v2 : COLOR0,
  out float4 o0 : SV_POSITION0,
  out float2 o1 : TEXCOORD0,
  out float4 o2 : COLOR1,
  out float4 o3 : COLOR0)
{
  float4 r0,r1,r2,r3;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);
  float4 iniparams = IniParams.Load(0);
  float4 iniparams1 = IniParams.Load(int2(1,0));
  float4 iniparams3 = IniParams.Load(int2(3,0));
  
  r0.xyzw = Transform._m00_m10_m20_m30 * v0.xxxx;
  r1.xyzw = Transform._m01_m11_m21_m31 * v0.yyyy;
  r0.xyzw = r1.xyzw + r0.xyzw;
  r1.xyzw = Transform._m02_m12_m22_m32 * v0.zzzz;
  r0.xyzw = r1.xyzw + r0.xyzw;
  r1.xyzw = float4(1,1,1,1) * Transform._m03_m13_m23_m33;
  r0.xyzw = r1.xyzw + r0.xyzw;
  r0.y = -r0.y;
  r1.xy = int2(16,16);
  r1.xy = v1.xy / r1.xy;
  r1.xy = uvScale.xy * r1.xy;
  r2.xyz = fogCol.xyz;
  r1.z = 1;
  r3.xyzw = v2.xyzw;
  r3.xyzw = max(float4(0,0,0,0), r3.xyzw);
  r3.xyzw = min(float4(1,1,1,1), r3.xyzw);
  o0.xzw = r0.xzw;
  o0.y = r0.y;
  if (r0.z<1.000001 && r0.z>0.999999)
  {
	o0.x+=stereo.x*iniparams.x;
	o0.x=o0.x*iniparams.y;
  }
  if (r0.z<0.999999 && r0.z>0.00001)
  {
	o0.x+=stereo.x;
	r0.z = -r0.z * r0.w + r0.w;
	r0.z=r0.w-r0.z;
	o0.x-=stereo.x*r0.z*stereo.y;
  }
  o2.xyz = r2.xyz;
  o2.w = r1.z;
  o3.xyzw = r3.xyzw;
  o1.xy = r1.xy;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.7 on Mon Apr 02 12:56:46 2018
//
//
// Buffer Definitions:
//
// cbuffer VS_CONSTANT_BUFFER
// {
//
//   float4x4 Transform;                // Offset:    0 Size:    64
//   float4 uvScale;                    // Offset:   64 Size:    16
//   float4 fogCol;                     // Offset:   80 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// VS_CONSTANT_BUFFER                cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
// TEXCOORD                 0   xy          1     NONE   float   xy
// COLOR                    0   xyzw        2     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
// COLOR                    1   xyzw        2     NONE   float   xyzw
// COLOR                    0   xyzw        3     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed | skipOptimization
dcl_constantbuffer cb0[6], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xy
dcl_input v2.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_temps 4
//
// Initial variable locations:
//   v0.x <- vi.position.x; v0.y <- vi.position.y; v0.z <- vi.position.z;
//   v1.x <- vi.texcoord.x; v1.y <- vi.texcoord.y;
//   v2.x <- vi.rgba.x; v2.y <- vi.rgba.y; v2.z <- vi.rgba.z; v2.w <- vi.rgba.w;
//   o3.x <- <main return value>.oColor.x; o3.y <- <main return value>.oColor.y; o3.z <- <main return value>.oColor.z; o3.w <- <main return value>.oColor.w;
//   o2.x <- <main return value>.oFog.x; o2.y <- <main return value>.oFog.y; o2.z <- <main return value>.oFog.z; o2.w <- <main return value>.oFog.w;
//   o1.x <- <main return value>.oTexCoord.x; o1.y <- <main return value>.oTexCoord.y;
//   o0.x <- <main return value>.oPosition.x; o0.y <- <main return value>.oPosition.y; o0.z <- <main return value>.oPosition.z; o0.w <- <main return value>.oPosition.w
//
#line 27 "C:\dev\dmc\dmc3\code\dmc3\source\dmc3nb\shaders\hlsl\vs\VTVCPL.hlsl"
mul r0.xyzw, v0.xxxx, cb0[0].xyzw
mul r1.xyzw, v0.yyyy, cb0[1].xyzw
add r0.xyzw, r0.xyzw, r1.xyzw
mul r1.xyzw, v0.zzzz, cb0[2].xyzw
add r0.xyzw, r0.xyzw, r1.xyzw
mul r1.xyzw, cb0[3].xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
add r0.xyzw, r0.xyzw, r1.xyzw  // r0.x <- vo.oPosition.x; r0.y <- vo.oPosition.y; r0.z <- vo.oPosition.z; r0.w <- vo.oPosition.w
mov r0.y, -r0.y
itof r1.xy, l(16, 16, 0, 0)
div r1.xy, v1.xyxx, r1.xyxx  // r1.x <- vo.oTexCoord.x; r1.y <- vo.oTexCoord.y
mul r1.xy, r1.xyxx, cb0[4].xyxx
mov r2.xyz, cb0[5].xyzx  // r2.x <- vo.oFog.x; r2.y <- vo.oFog.y; r2.z <- vo.oFog.z
mov r1.z, l(1.000000)  // r1.z <- vo.oFog.w
mov r3.xyzw, v2.xyzw  // r3.x <- vo.oColor.x; r3.y <- vo.oColor.y; r3.z <- vo.oColor.z; r3.w <- vo.oColor.w
max r3.xyzw, r3.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
min r3.xyzw, r3.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)  // r3.x <- vo.oColor.x; r3.y <- vo.oColor.y; r3.z <- vo.oColor.z; r3.w <- vo.oColor.w
mov o0.xzw, r0.xxzw
mov o0.y, r0.y
mov o2.xyz, r2.xyzx
mov o2.w, r1.z
mov o3.xyzw, r3.xyzw
mov o1.xy, r1.xyxx
ret
// Approximately 23 instruction slots used

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