// 3DMigoto: fc1a985b6e496d96 | Matched 4 variants of 4 shaders: Hidden/Internal-Flare, Hidden/Internal-GUITexture, Hidden/Internal-Halo, _Shaders/vgUILinearBurnShader
// 
//    Unity headers extracted from Internal-Flare.shader
//    Shader "Hidden/Internal-Flare" {
//      SubShader 1/1 {
//        Tags { "RenderType"="Overlay" }
//        Pass 1/1 {
//          Tags { "RenderType"="Overlay" }
//          ZTest Always
//          ZWrite Off
//          Cull Off
//          Blend One One
//          ColorMask RGB
//          GpuProgramID 33804
//          Program "vp" {
//            SubProgram "d3d11 " {
//              Bind "vertex" Vertex
//              Bind "color" Color
//              Bind "texcoord" TexCoord0
//              ConstBuffer "$Globals" 112
//              Vector 96 [_FlareTexture_ST]
//              ConstBuffer "UnityPerDraw" 352
//              Matrix 0 [glstate_matrix_mvp]
//              BindCB "$Globals" 0
//              BindCB "UnityPerDraw" 1
//            }
//          }
//        }
//      }
//    }
// 
//    Unity headers extracted from Internal-GUITexture.shader
//    Shader "Hidden/Internal-GUITexture" {
//      Properties {
//       _MainTex ("Texture", any) = "" { }
//      }
//      Fallback Off
//      SubShader 1/1 {
//        Tags { "RenderType"="Overlay" "ForceSupported"="true" }
//        Pass 1/1 {
//          Tags { "RenderType"="Overlay" "ForceSupported"="true" }
//          ZTest Always
//          ZWrite Off
//          Cull Off
//          Blend SrcAlpha OneMinusSrcAlpha
//          GpuProgramID 60335
//          Program "vp" {
//            SubProgram "d3d11 " {
//              Bind "vertex" Vertex
//              Bind "color" Color
//              Bind "texcoord" TexCoord0
//              ConstBuffer "$Globals" 112
//              Vector 96 [_MainTex_ST]
//              ConstBuffer "UnityPerDraw" 352
//              Matrix 0 [glstate_matrix_mvp]
//              BindCB "$Globals" 0
//              BindCB "UnityPerDraw" 1
//            }
//          }
//        }
//      }
//    }
// 
//    Unity headers extracted from Internal-Halo.shader
//    Shader "Hidden/Internal-Halo" {
//      SubShader 1/1 {
//        Tags { "RenderType"="Overlay" }
//        Pass 1/1 {
//          Tags { "RenderType"="Overlay" }
//          ZWrite Off
//          Cull Off
//          Blend OneMinusDstColor One
//          ColorMask RGB
//          GpuProgramID 31992
//          Program "vp" {
//            SubProgram "d3d11 " {
//              Bind "vertex" Vertex
//              Bind "color" Color
//              Bind "texcoord" TexCoord0
//              ConstBuffer "$Globals" 112
//              Vector 96 [_HaloFalloff_ST]
//              ConstBuffer "UnityPerDraw" 352
//              Matrix 0 [glstate_matrix_mvp]
//              BindCB "$Globals" 0
//              BindCB "UnityPerDraw" 1
//            }
//          }
//        }
//      }
//    }
// 
//    Unity headers extracted from vgUILinearBurnShader.shader
//    Shader "_Shaders/vgUILinearBurnShader" {
//      Properties {
//       _MainTex ("Texture", any) = "" { }
//      }
//      Fallback Off
//      SubShader 1/1 {
//        Tags { "ForceSupported"="true" "RenderType"="Overlay" }
//        Pass 1/1 {
//          Tags { "ForceSupported"="true" "RenderType"="Overlay" }
//          ZTest Always
//          ZWrite Off
//          Cull Off
//          Blend One One
//          BlendOp RevSub
//          GpuProgramID 61846
//          Program "vp" {
//            SubProgram "d3d11 " {
//              Bind "vertex" Vertex
//              Bind "color" Color
//              Bind "texcoord" TexCoord0
//              ConstBuffer "$Globals" 112
//              Vector 96 [_MainTex_ST]
//              ConstBuffer "UnityPerDraw" 352
//              Matrix 0 [glstate_matrix_mvp]
//              BindCB "$Globals" 0
//              BindCB "UnityPerDraw" 1
//            }
//          }
//        }
//      }
//    }
// 
// Headers extracted with DarkStarSword's extract_unity_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity_shaders.py
//
// Shader model vs_4_0

// ---- Created with 3Dmigoto v1.2.31 on Sat Feb 20 12:31:53 2016
cbuffer cb1 : register(b1)
{
  float4 cb1[4];
}

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




// 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 float2 o2 : TEXCOORD0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = cb1[1].xyzw * v0.yyyy;
  r0.xyzw = cb1[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb1[2].xyzw * v0.zzzz + r0.xyzw;
  o0.xyzw = cb1[3].xyzw * v0.wwww + r0.xyzw;
  o1.xyzw = v1.xyzw;
  o2.xy = v2.xy * cb0[6].xy + cb0[6].zw;

// This shader has the correct depth from Unity, but the driver heuristics are
// inconsistent. Apply the stereo correction, then normalise the output to W ==
// convergence to prevent the driver from adjusting it. Only normalise when the
// effect is in front of the camera and convergence is not 0 to prevent bad
// things happening.

float4 stereo = StereoParams.Load(0);
if (stereo.y && o0.w > 0) { // Only normalise in front of the camera & with stereo enabled
	o0.x += stereo.x * (o0.w - stereo.y);
	o0 = o0 / o0.w * stereo.y;
}

  return;
}
