// hlsltool.py -I ../.. --auto-fix-vertex-halo --fix-unity-reflection --fix-unity-frustum-world --only-autofixed --fxc /home/Ryan/fxc.exe 1912066d52832b61-vs_replace.txt
// 3DMigoto: 1912066d52832b61 |    Unity headers extracted from TransparentWind.shader
//    Shader "Shader Forge/TransparentWindSF" {
//      Properties {
//       _WindDirection ("WindDirection", Vector) = (1,0,0,0)
//       _LowBorder ("LowBorder", Float) = 0.1
//       _HighBorder ("HighBorder", Float) = 100
//       _Smoothness ("Smoothness", Range(0.2,3)) = 2
//       _DiffuseMap ("DiffuseMap", 2D) = "white" { }
//       _DiffColor ("DiffColor", Color) = (1,1,1,1)
//       _CutoutRange ("CutoutRange", Range(-0.55,0.55)) = 0.282051
//       _SpecColor ("SpecColor", Color) = (0.176471,0.176471,0.176471,1)
//       _GlossRange ("GlossRange", Range(0,1)) = 0.538462
//       _NormalMap ("NormalMap", 2D) = "bump" { }
//      [HideInInspector]  _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
//      }
//      Fallback "Diffuse"
//      SubShader 1/1 {
//        Tags { "QUEUE"="AlphaTest" "RenderType"="TransparentCutout" }
//        Pass 3/3 {
//          Name "SHADOWCASTER"
//          Tags { "LIGHTMODE"="SHADOWCASTER" "QUEUE"="AlphaTest" "SHADOWSUPPORT"="true" "RenderType"="TransparentCutout" }
//          Offset 1, 1
//          GpuProgramID 153147
//          Program "vp" {
//            SubProgram "d3d11 " {
//              GpuProgramIndex 385
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from TransparentWind.shader.decompressed:
//   API d3d11
//   Shader model vs_4_0
//   undeciphered1: 28 0 0
//   Keywords { "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" }
//   undeciphered2: 1 0 4 0 0
//   undeciphered3: 57 4 0 0 3 4 4 5 5 6
//   ConstBuffer "$Globals" 208
//   Vector 128 [_TimeEditor]
//   Vector 144 [_WindDirection]
//   Float 160 [_LowBorder]
//   Float 164 [_HighBorder]
//   Float 168 [_Smoothness]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 0 [_Time]
//   ConstBuffer "UnityShadows" 416
//   Vector 80 [unity_LightShadowBias]
//   ConstBuffer "UnityPerDraw" 352
//   Matrix 0 [glstate_matrix_mvp]
//   Matrix 192 [_Object2World]
//   BindCB "$Globals" 0
//   BindCB "UnityPerCamera" 1
//   BindCB "UnityShadows" 2
//   BindCB "UnityPerDraw" 3
//
// 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:39:40 2016
cbuffer cb3 : register(b3)
{
  float4 cb3[16];
}

cbuffer cb2 : register(b2)
{
  float4 cb2[6];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[1];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[11];
}




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


void main( 
  float4 v0 : POSITION0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float2 v3 : TEXCOORD2,
  out float4 o0 : SV_POSITION0,
  out float2 o1 : TEXCOORD1,
  out float2 p1 : TEXCOORD2,
  out float4 o2 : TEXCOORD3,
  out float4 o3 : TEXCOORD4)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

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

  r0.x = cb3[13].y * v0.y;
  r0.x = cb3[12].y * v0.x + r0.x;
  r0.x = cb3[14].y * v0.z + r0.x;
  r0.x = cb3[15].y * v0.w + r0.x;
  r0.x = -cb3[15].y + r0.x;
  r0.x = max(cb0[10].x, r0.x);
  r0.x = min(cb0[10].y, r0.x);
  r0.x = -cb0[10].x + r0.x;
  r0.x = log2(r0.x);
  r0.x = cb0[10].z * r0.x;
  r0.x = exp2(r0.x);
  r0.y = cb1[0].y + cb0[8].y;
  r0.y = sin(r0.y);
  r0.yzw = cb0[9].xyz * r0.yyy;
  r0.xyz = r0.xxx * r0.yzw + v0.xyz;
  r1.xyzw = cb3[1].xyzw * r0.yyyy;
  r1.xyzw = cb3[0].xyzw * r0.xxxx + r1.xyzw;
  r1.xyzw = cb3[2].xyzw * r0.zzzz + r1.xyzw;
  r1.xyzw = cb3[3].xyzw + r1.xyzw;

o0.xyw = r1.xyw; // Relocated to here with hlsltool.py

// 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 1912066d52832b61-vs_replace.txt
if (r1.w != 1.0) { r1.x += separation * (r1.w - convergence); }

  r0.w = saturate(cb2[5].x / r1.w);
  r0.w = r1.z + r0.w;

  // o0.xyw = r1.xyw; // Relocated from here with hlsltool.py

  r1.x = max(0, r0.w);
  r1.x = r1.x + -r0.w;
  o0.z = cb2[5].y * r1.x + r0.w;
  o1.xy = v1.xy;
  p1.xy = v2.xy;
  o2.xy = v3.xy;
  r1.xyzw = cb3[13].xyzw * r0.yyyy;
  r1.xyzw = cb3[12].xyzw * r0.xxxx + r1.xyzw;
  r0.xyzw = cb3[14].xyzw * r0.zzzz + r1.xyzw;
  o3.xyzw = cb3[15].xyzw * v0.wwww + r0.xyzw;
  return;
}

/****************************** COMPILE WARNINGS ******************************
X:\SteamLibrary\steamapps\common\I am weapon Revival\ShaderFixes\1912066d52832b61-vs_replace.txt(100,14-15): warning X3578: Output value 'o2' is not completely initialized

****************************** COMPILE WARNINGS ******************************/
