// hlsltool.py -I ../.. --auto-fix-vertex-halo --fix-unity-reflection --fix-unity-frustum-world --only-autofixed --fxc /home/Ryan/fxc.exe 688ff510d41c67fe-vs_replace.txt
// 3DMigoto: 688ff510d41c67fe |    Unity headers extracted from WhiteNoise.shader
//    Shader "Shader Forge/WhiteNoise" {
//      Properties {
//       _node_2 ("node_2", 2D) = "white" { }
//       _node_2_copy ("node_2_copy", 2D) = "white" { }
//      }
//      Fallback "Diffuse"
//      SubShader 1/1 {
//        Tags { "RenderType"="Opaque" }
//        Pass 1/1 {
//          Name "FORWARD"
//          Tags { "LIGHTMODE"="ForwardBase" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
//          GpuProgramID 9958
//          Program "vp" {
//            SubProgram "d3d11 " {
//              GpuProgramIndex 9
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from WhiteNoise.shader.decompressed:
//   API d3d11
//   Shader model vs_4_0
//   undeciphered1: 4 0 0
//   Keywords { "DIRECTIONAL" "SHADOWS_OFF" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "FOG_LINEAR" }
//   undeciphered2: 1 0 1 0 0
//   undeciphered3: 9 2 0 0 3 4
//   ConstBuffer "UnityPerDraw" 352
//   Matrix 0 [glstate_matrix_mvp]
//   BindCB "UnityPerDraw" 0
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py

// ---- Created with 3Dmigoto v1.2.30 on Thu Aug 18 03:40:27 2016
cbuffer cb0 : register(b0)
{
  float4 cb0[4];
}




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


void main( 
  float4 v0 : POSITION0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_POSITION0,
  out float2 o1 : TEXCOORD0,
  out float p1 : TEXCOORD1)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

float4 stereo = StereoParams.Load(0);
float separation = stereo.x, convergence = stereo.y, eye = stereo.z;

  r0.xyzw = cb0[1].xyzw * v0.yyyy;
  r0.xyzw = cb0[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb0[2].xyzw * v0.zzzz + r0.xyzw;
  r0.xyzw = cb0[3].xyzw * v0.wwww + r0.xyzw;
  o0.xyzw = r0.xyzw;

// Automatic vertex shader halo fix inserted with DarkStarSword's hlsltool.py:
// hlsltool.py -I ../.. --auto-fix-vertex-halo --fix-unity-reflection --fix-unity-frustum-world --only-autofixed --fxc /home/Ryan/fxc.exe 688ff510d41c67fe-vs_replace.txt
if (r0.w != 1.0) { r0.x += separation * (r0.w - convergence); }

  p1.x = r0.z;
  o1.xy = v1.xy;
  return;
}
