// hlsltool.py -I ../112 --auto-fix-vertex-halo --fix-unity-reflection --only-autofixed --no-validate --ignore-other-errors 2fbc189806ecb26b-vs_replace.txt
// 3DMigoto: 2fbc189806ecb26b | Matched 5 variants of 4 shaders: Effects/AlphaBlended, Effects/Explosion, Effects/GlowAdditive, Effects/ParticleAdd
//
// 01:    Unity headers extracted from AlphaBlended 1.shader
// 10:    Unity headers extracted from AlphaBlended.shader
// 02:    Unity headers extracted from Explosion.shader
// 04:    Unity headers extracted from GlowAdditive.shader
// 08:    Unity headers extracted from ParticleAdd.shader
// 11:    Shader "Effects/AlphaBlended" {
// 02:    Shader "Effects/Explosion" {
// 04:    Shader "Effects/GlowAdditive" {
// 08:    Shader "Effects/ParticleAdd" {
//          Properties {
// 0c:       _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
// 11:       _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,1)
// 02:       _TintColorR ("Tint Color R (Core)", Color) = (0.5,0.5,0.5,1)
// 02:       _TintColorG ("Tint Color G (Glow)", Color) = (0.5,0.5,0.5,1)
// 02:       _TintColorB ("Tint Color B (Shadow)", Color) = (0.5,0.5,0.5,1)
// 02:       _ColorStrR ("Color R strength", Range(0.01,4)) = 1
// 02:       _ColorStrG ("Color G strength", Range(0.01,4)) = 1
// 02:       _ColorStrB ("Color B strength", Range(0.01,4)) = 1
// 11:       _ColorStrength ("Color strength", Float) = 1
// 0e:       _MainTex ("Particle Texture", 2D) = "white" { }
// 08:       _ColorStrength ("Color strength", Float) = 1
// 04:       _CutOutLightCore ("CutOut Light Core", Range(0,1)) = 0.5
// 11:       _MainTex ("Particle Texture", 2D) = "white" { }
// 0e:       _InvFade ("Soft Particles Factor", Range(0.01,3)) = 1
// 11:       _InvFade ("Soft Particles Factor", Range(0.01,7)) = 1
//          }
//          SubShader 1/1 {
//            Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
// 1d:        Pass 1/1 {
// 02:        Pass 2/2 {
//              Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
//              ZWrite Off
//              Cull Off
// 0c:          Blend SrcAlpha One
// 13:          Blend SrcAlpha OneMinusSrcAlpha
// 02:          GpuProgramID 130963
// 08:          GpuProgramID 1466
// 11:          GpuProgramID 49115
// 04:          GpuProgramID 55612
//              Program "vp" {
//                SubProgram "d3d11_9x " {
// 02:              GpuProgramIndex 17
// 1d:              GpuProgramIndex 5
//                }
//              }
//            }
//          }
//        }
//
// 01: Unity 5.3 headers extracted from AlphaBlended 1.shader.decompressed:
// 10: Unity 5.3 headers extracted from AlphaBlended.shader.decompressed:
// 02: Unity 5.3 headers extracted from Explosion.shader.decompressed:
// 04: Unity 5.3 headers extracted from GlowAdditive.shader.decompressed:
// 08: Unity 5.3 headers extracted from ParticleAdd.shader.decompressed:
//       API d3d11_9x
//       Shader model vs_4_0_level_9_1
//       undeciphered1: 201509030 13 0 0
//       Keywords { "SOFTPARTICLES_ON" }
//       undeciphered2: 1 0 3 0 0
//       undeciphered3: 13 3 0 0 2 1 3 4
//       ConstBuffer "$Globals" 160
//       Vector 128 [_MainTex_ST]
//       ConstBuffer "UnityPerCamera" 144
//       Vector 80 [_ProjectionParams]
//       ConstBuffer "UnityPerDraw" 352
//       Matrix 0 [glstate_matrix_mvp]
//       Matrix 64 [glstate_matrix_modelview0]
//       BindCB "$Globals" 0
//       BindCB "UnityPerCamera" 1
//       BindCB "UnityPerDraw" 2
//
// 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.38 on Thu Feb 09 12:26:05 2017
cbuffer cb2 : register(b2)
{
  float4 cb2[8];
}

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

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




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


void main( 
  float4 v0 : POSITION0,
  float4 v1 : COLOR0,
  float2 v2 : TEXCOORD0,
  out float4 o0 : SV_Position0,
  out float4 o1 : COLOR0,
  out float4 o2 : TEXCOORD0,
  out float4 o3 : TEXCOORD1)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

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

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

// Automatic vertex shader halo fix inserted with DarkStarSword's hlsltool.py:
// hlsltool.py -I ../112 --auto-fix-vertex-halo --fix-unity-reflection --only-autofixed --no-validate --ignore-other-errors 2fbc189806ecb26b-vs_replace.txt
if (r0.w != 1.0) { r0.x += separation * (r0.w - convergence); }

  o1.xyzw = v1.xyzw;
  o2.xy = v2.xy * cb0[8].xy + cb0[8].zw;
  r0.y = cb1[5].x * r0.y;
  r1.xzw = float3(0.5,0.5,0.5) * r0.xwy;
  o3.w = r0.w;
  o3.xy = r1.xw + r1.zz;
  r0.x = cb2[5].z * v0.y;
  r0.x = cb2[4].z * v0.x + r0.x;
  r0.x = cb2[6].z * v0.z + r0.x;
  r0.x = cb2[7].z * v0.w + r0.x;
  o3.z = -r0.x;
  return;
}
