// hlsltool.py -I ../.. --auto-fix-vertex-halo --fix-unity-reflection --fix-unity-frustum-world --only-autofixed --fxc /home/Ryan/fxc.exe 585576b6b6480175-vs_replace.txt
// 3DMigoto: 585576b6b6480175 |    Unity headers extracted from AdditiveDinPush.shader
//    Shader "Shader Forge/AdditiveDinPush" {
//      Properties {
//       _MainTex ("MainTex", 2D) = "white" { }
//       _TintColor ("Color", Color) = (0.5,0.5,0.5,1)
//       _PushMap1 ("PushMap1", 2D) = "white" { }
//       _PushMap2 ("PushMap2", 2D) = "black" { }
//       _PushFactor ("PushFactor", Float) = 0.1
//       _TimeFactor ("TimeFactor", Float) = 4
//       _Outline ("Outline", Float) = 0.02
//       _OutlineColor ("OutlineColor", Color) = (0.5,0.5,0.5,1)
//      }
//      Fallback "Diffuse"
//      SubShader 1/1 {
//        Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
//        Pass 2/2 {
//          Name "SHADOWCASTER"
//          Tags { "LIGHTMODE"="SHADOWCASTER" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "RenderType"="Transparent" }
//          Offset 1, 1
//          GpuProgramID 71390
//          Program "vp" {
//            SubProgram "d3d11 " {
//              GpuProgramIndex 25
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from AdditiveDinPush.shader.decompressed:
//   API d3d11
//   Shader model vs_4_0
//   undeciphered1: 39 0 0
//   Keywords { "SHADOWS_DEPTH" }
//   undeciphered2: 1 2 4 2 0
//   undeciphered3: 11 3 0 0 1 2 3 4
//   ConstBuffer "$Globals" 192
//   Vector 128 [_TimeEditor]
//   Vector 144 [_PushMap1_ST]
//   Vector 160 [_PushMap2_ST]
//   Float 176 [_PushFactor]
//   Float 180 [_TimeFactor]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 0 [_Time]
//   ConstBuffer "UnityShadows" 416
//   Vector 80 [unity_LightShadowBias]
//   ConstBuffer "UnityPerDraw" 352
//   Matrix 0 [glstate_matrix_mvp]
//   Matrix 192 [_Object2World]
//   Matrix 256 [_World2Object]
//   SetTexture 0 [_PushMap1] 2D 0
//   SetTexture 1 [_PushMap2] 2D 1
//   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:38:26 2016
Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb3 : register(b3)
{
  float4 cb3[19];
}

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

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

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




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


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

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

  r0.x = cb1[0].y + cb0[8].y;
  r0.y = cb0[11].y * r0.x;
  r1.xyzw = r0.xxxx * float4(0.200000003,0,0,0.200000003) + v2.xyxy;
  r0.x = sin(r0.y);
  r0.x = 1 + r0.x;
  r0.x = 0.5 * r0.x;
  r0.yz = r1.zw * cb0[10].xy + cb0[10].zw;
  r1.xy = r1.xy * cb0[9].xy + cb0[9].zw;
  r1.xyzw = t0.SampleLevel(s0_s, r1.xy, 0).xyzw;
  r2.xyzw = t1.SampleLevel(s1_s, r0.yz, 0).xyzw;
  r0.yzw = r2.xyz + -r1.xyz;
  r0.xyz = r0.xxx * r0.yzw + r1.xyz;
  r0.xyz = cb0[11].xxx * r0.xyz;
  r0.xyz = r0.xyz * v1.xyz + 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 585576b6b6480175-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 = v2.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;
  o2.xyzw = cb3[15].xyzw * v0.wwww + r0.xyzw;
  r0.x = cb3[16].x * v1.x;
  r0.y = cb3[17].x * v1.x;
  r0.z = cb3[18].x * v1.x;
  r1.x = cb3[16].y * v1.y;
  r1.y = cb3[17].y * v1.y;
  r1.z = cb3[18].y * v1.y;
  r0.xyz = r1.xyz + r0.xyz;
  r1.x = cb3[16].z * v1.z;
  r1.y = cb3[17].z * v1.z;
  r1.z = cb3[18].z * v1.z;
  r0.xyz = r1.xyz + r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  o3.xyz = r0.xyz * r0.www;
  return;
}

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

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