//Haloing when unlocking doors.
// ---- Created with 3Dmigoto v1.3.6 on Sat Mar 17 09:48:32 2018

cbuffer VS_CONSTANT_BUFFER : register(b0)
{
  float4x4 mOTP : packoffset(c0);
  float4x4 BlendMatrixArray[48] : packoffset(c4);
}



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


void main(
  float3 v0 : POSITION0,
  float3 v1 : NORMAL0,
  float4 v2 : COLOR0,
  float2 v3 : TEXCOORD0,
  uint4 v4 : BLENDINDICES1,
  uint4 v5 : BLENDINDICES0,
  out float4 o0 : SV_POSITION0,
  out float3 o1 : TEXCOORD1,
  out float4 o2 : COLOR0,
  out float4 o3 : TEXCOORD0,
  out float4 o4 : TEXCOORD2,
  out float4 o5 : TEXCOORD3,
  out float3 o6 : TEXCOORD4)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);
  float4 iniparams1 = IniParams.Load(int2(1,0));
  
  r0.xyz = (uint3)v4.xyz;
  r0.xyz = float3(0.0322580002,0.0322580002,0.0322580002) * r0.xyz;
  r1.xyz = (int3)v5.yzw & int3(-4,-4,-4);
  r2.xyz = BlendMatrixArray[r1.x/4]._m20_m00_m10 * r0.xxx;
  r3.x = r2.z;
  r4.xyz = BlendMatrixArray[r1.x/4]._m11_m01_m21 * r0.xxx;
  r3.y = r4.x;
  r5.xyz = BlendMatrixArray[r1.x/4]._m02_m12_m22 * r0.xxx;
  r3.z = r5.y;
  r6.xyz = BlendMatrixArray[r1.x/4]._m03_m13_m23 * r0.xxx;
  r3.w = r6.y;
  r7.xyz = BlendMatrixArray[r1.y/4]._m20_m00_m10 * r0.yyy;
  r8.x = r7.z;
  r9.xyz = BlendMatrixArray[r1.y/4]._m11_m01_m21 * r0.yyy;
  r8.y = r9.x;
  r10.xyz = BlendMatrixArray[r1.y/4]._m02_m12_m22 * r0.yyy;
  r8.z = r10.y;
  r11.xyz = BlendMatrixArray[r1.y/4]._m03_m13_m23 * r0.yyy;
  r8.w = r11.y;
  r3.xyzw = r8.xyzw + r3.xyzw;
  r8.xyz = BlendMatrixArray[r1.z/4]._m20_m00_m10 * r0.zzz;
  r12.x = r8.z;
  r13.xyz = BlendMatrixArray[r1.z/4]._m11_m01_m21 * r0.zzz;
  r12.y = r13.x;
  r14.xyz = BlendMatrixArray[r1.z/4]._m02_m12_m22 * r0.zzz;
  r12.z = r14.y;
  r15.xyz = BlendMatrixArray[r1.z/4]._m03_m13_m23 * r0.zzz;
  r12.w = r15.y;
  r3.xyzw = r12.xyzw + r3.xyzw;
  r12.xyz = v0.xyz;
  r12.w = 1;
  r16.y = dot(r3.xyzw, r12.xyzw);
  o1.y = dot(r3.xyz, v1.xyz);
  r3.xyzw = mOTP._m01_m11_m21_m31 * r16.yyyy;
  r4.x = r2.y;
  r2.y = r4.z;
  r4.z = r5.x;
  r2.z = r5.z;
  r4.w = r6.x;
  r2.w = r6.z;
  r9.x = r7.y;
  r7.y = r9.z;
  r9.z = r10.x;
  r7.z = r10.z;
  r9.w = r11.x;
  r7.w = r11.z;
  r2.xyzw = r7.xyzw + r2.xyzw;
  r4.xyzw = r9.xyzw + r4.xyzw;
  r13.x = r8.y;
  r8.y = r13.z;
  r13.z = r14.x;
  r8.z = r14.z;
  r13.w = r15.x;
  r8.w = r15.z;
  r2.xyzw = r8.xyzw + r2.xyzw;
  r4.xyzw = r13.xyzw + r4.xyzw;
  r16.x = dot(r4.xyzw, r12.xyzw);
  o1.x = dot(r4.xyz, v1.xyz);
  r3.xyzw = mOTP._m00_m10_m20_m30 * r16.xxxx + r3.xyzw;
  r16.z = dot(r2.xyzw, r12.xyzw);
  o1.z = dot(r2.xyz, v1.xyz);
  r2.xyzw = mOTP._m02_m12_m22_m32 * r16.zzzz + r3.xyzw;
  o4.xyz = r16.xyz;
  r3.x = BlendMatrixArray[r1.x/4]._m30 * r0.x;
  r3.y = BlendMatrixArray[r1.x/4]._m31 * r0.x;
  r3.z = BlendMatrixArray[r1.x/4]._m32 * r0.x;
  r3.w = BlendMatrixArray[r1.x/4]._m33 * r0.x;
  r4.x = BlendMatrixArray[r1.y/4]._m30 * r0.y;
  r4.y = BlendMatrixArray[r1.y/4]._m31 * r0.y;
  r4.z = BlendMatrixArray[r1.y/4]._m32 * r0.y;
  r4.w = BlendMatrixArray[r1.y/4]._m33 * r0.y;
  r3.xyzw = r4.xyzw + r3.xyzw;
  r4.x = BlendMatrixArray[r1.z/4]._m30 * r0.z;
  r4.y = BlendMatrixArray[r1.z/4]._m31 * r0.z;
  r4.z = BlendMatrixArray[r1.z/4]._m32 * r0.z;
  r4.w = BlendMatrixArray[r1.z/4]._m33 * r0.z;
  r0.xyzw = r4.xyzw + r3.xyzw;
  r0.x = dot(r0.xyzw, r12.xyzw);
  r0.xyzw = mOTP._m03_m13_m23_m33 * r0.xxxx + r2.xyzw;
  r0.z = r0.w + -r0.z;
  r0.xy = float2(1,-1) * r0.xy;
  r1.xyz = r0.xyz / r0.www;
  o0.xyzw = r0.xyzw;
  o5.w = r0.w;
  r0.xyz = r1.xyz * float3(0.5,0.5,0.5) + float3(0.5,0.5,0.5);
  o5.xyz = r0.xyz * float3(1,-1,1) + float3(0,1,0);
  //o5.x+=stereo.x*(0.5-stereo.y*r1.z*0.00625);
  o5.x+=stereo.x*(0.5-stereo.y*r1.z*iniparams1.x*-0.5);
  o2.xyzw = v2.xyzw;
  o3.xy = v3.xy;
  o6.xyz = v0.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.6 on Sat Mar 17 09:48:32 2018
//
//
// Buffer Definitions:
//
// cbuffer VS_CONSTANT_BUFFER
// {
//
//   float4x4 mOTP;                     // Offset:    0 Size:    64
//   float4x4 BlendMatrixArray[48];     // Offset:   64 Size:  3072
//
// }
//
//
// 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
// NORMAL                   0   xyz         1     NONE   float   xyz
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
// BLENDINDICES             1   xyzw        4     NONE    uint   xyz
// BLENDINDICES             0   xyzw        5     NONE    uint    yzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 1   xyz         1     NONE   float   xyz
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
// TEXCOORD                 2   xyz         4     NONE   float   xyz
// TEXCOORD                 3   xyzw        5     NONE   float   xyzw
// TEXCOORD                 4   xyz         6     NONE   float   xyz
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[196], dynamicIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xy
dcl_input v4.xyz
dcl_input v5.yzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output o3.xy
dcl_output o4.xyz
dcl_output o5.xyzw
dcl_output o6.xyz
dcl_temps 17
utof r0.xyz, v4.xyzx
mul r0.xyz, r0.xyzx, l(0.032258, 0.032258, 0.032258, 0.000000)
and r1.xyz, v5.yzwy, l(-4, -4, -4, 0)
mul r2.xyz, r0.xxxx, cb0[r1.x + 4].zxyz
mov r3.x, r2.z
mul r4.xyz, r0.xxxx, cb0[r1.x + 5].yxzy
mov r3.y, r4.x
mul r5.xyz, r0.xxxx, cb0[r1.x + 6].xyzx
mov r3.z, r5.y
mul r6.xyz, r0.xxxx, cb0[r1.x + 7].xyzx
mov r3.w, r6.y
mul r7.xyz, r0.yyyy, cb0[r1.y + 4].zxyz
mov r8.x, r7.z
mul r9.xyz, r0.yyyy, cb0[r1.y + 5].yxzy
mov r8.y, r9.x
mul r10.xyz, r0.yyyy, cb0[r1.y + 6].xyzx
mov r8.z, r10.y
mul r11.xyz, r0.yyyy, cb0[r1.y + 7].xyzx
mov r8.w, r11.y
add r3.xyzw, r3.xyzw, r8.xyzw
mul r8.xyz, r0.zzzz, cb0[r1.z + 4].zxyz
mov r12.x, r8.z
mul r13.xyz, r0.zzzz, cb0[r1.z + 5].yxzy
mov r12.y, r13.x
mul r14.xyz, r0.zzzz, cb0[r1.z + 6].xyzx
mov r12.z, r14.y
mul r15.xyz, r0.zzzz, cb0[r1.z + 7].xyzx
mov r12.w, r15.y
add r3.xyzw, r3.xyzw, r12.xyzw
mov r12.xyz, v0.xyzx
mov r12.w, l(1.000000)
dp4 r16.y, r3.xyzw, r12.xyzw
dp3 o1.y, r3.xyzx, v1.xyzx
mul r3.xyzw, r16.yyyy, cb0[1].xyzw
mov r4.x, r2.y
mov r2.y, r4.z
mov r4.z, r5.x
mov r2.z, r5.z
mov r4.w, r6.x
mov r2.w, r6.z
mov r9.x, r7.y
mov r7.y, r9.z
mov r9.z, r10.x
mov r7.z, r10.z
mov r9.w, r11.x
mov r7.w, r11.z
add r2.xyzw, r2.xyzw, r7.xyzw
add r4.xyzw, r4.xyzw, r9.xyzw
mov r13.x, r8.y
mov r8.y, r13.z
mov r13.z, r14.x
mov r8.z, r14.z
mov r13.w, r15.x
mov r8.w, r15.z
add r2.xyzw, r2.xyzw, r8.xyzw
add r4.xyzw, r4.xyzw, r13.xyzw
dp4 r16.x, r4.xyzw, r12.xyzw
dp3 o1.x, r4.xyzx, v1.xyzx
mad r3.xyzw, cb0[0].xyzw, r16.xxxx, r3.xyzw
dp4 r16.z, r2.xyzw, r12.xyzw
dp3 o1.z, r2.xyzx, v1.xyzx
mad r2.xyzw, cb0[2].xyzw, r16.zzzz, r3.xyzw
mov o4.xyz, r16.xyzx
mul r3.x, r0.x, cb0[r1.x + 4].w
mul r3.y, r0.x, cb0[r1.x + 5].w
mul r3.z, r0.x, cb0[r1.x + 6].w
mul r3.w, r0.x, cb0[r1.x + 7].w
mul r4.x, r0.y, cb0[r1.y + 4].w
mul r4.y, r0.y, cb0[r1.y + 5].w
mul r4.z, r0.y, cb0[r1.y + 6].w
mul r4.w, r0.y, cb0[r1.y + 7].w
add r3.xyzw, r3.xyzw, r4.xyzw
mul r4.x, r0.z, cb0[r1.z + 4].w
mul r4.y, r0.z, cb0[r1.z + 5].w
mul r4.z, r0.z, cb0[r1.z + 6].w
mul r4.w, r0.z, cb0[r1.z + 7].w
add r0.xyzw, r3.xyzw, r4.xyzw
dp4 r0.x, r0.xyzw, r12.xyzw
mad r0.xyzw, cb0[3].xyzw, r0.xxxx, r2.xyzw
add r0.z, -r0.z, r0.w
mul r0.xy, r0.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
div r1.xyz, r0.xyzx, r0.wwww
mov o0.xyzw, r0.xyzw
mov o5.w, r0.w
mad r0.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mad o5.xyz, r0.xyzx, l(1.000000, -1.000000, 1.000000, 0.000000), l(0.000000, 1.000000, 0.000000, 0.000000)
mov o2.xyzw, v2.xyzw
mov o3.xy, v3.xyxx
mov o6.xyz, v0.xyzx
ret
// Approximately 90 instruction slots used

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