// CRC32: 991074B3 |    Unity headers extracted from EdgesOfTheWorldInstancing3.shader
//    Shader "Instancing3/Amplitude/EdgesOfTheWorld" {
//      Properties {
//       _Shininess ("Shininess", Float) = 0.078125
//       _Intensity ("Intensity", Float) = 1
//       _AltitudeGammaCorrectionFactor ("Altitude Gamma Correction", Float) = 0.25
//       _MainTex ("Texture", 2D) = "white" { }
//       _BumpMap ("Bumpmap (RGB)", 2D) = "bump" { }
//       _SpecMap ("Spec map (RGB)", 2D) = "white" { }
//       _IlluminMap ("IlluminMap (RGB)", 2D) = "black" { }
//       _ViewSensitivity ("3D, Battle, 2D, Empire", Vector) = (1,0,0,0)
//       _WinterSensitivity ("Summer, Winter, WinterIntensity, FowIntensity", Vector) = (1,1,1,1)
//       _StartUV ("Start UV) ", Vector) = (0,0,0,0)
//       _MinBBox ("_MinBox) ", Vector) = (0,0,0,1)
//       _MaxBBox ("_MaxBox) ", Vector) = (0,0,0,1)
//       _Offset ("_Offset) ", Vector) = (0,0,0,0)
//       _ControlTex ("ControlTex", 2D) = "white" { }
//      }
//      Fallback Off
//      SubShader 1/1 {
//        Tags { "QUEUE"="Geometry" "RenderType"="Opaque" }
//        Pass 4/5 {
//          Name "PREPASS"
//          Tags { "LIGHTMODE"="PrePassFinal" "QUEUE"="Geometry" "RenderType"="Opaque" }
//          ZWrite Off
//          GpuProgramID 224445
//          Program "vp" {
//            SubProgram "d3d9 " {
//              GpuProgramIndex 32
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from EdgesOfTheWorldInstancing3.shader.decompressed:
//   API d3d9
//   Shader model vs_3_0
//   undeciphered1: 62 6 -1
//   Keywords { "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "HDR_LIGHT_PREPASS_OFF" "DEFAULT_RENDERER" }
//   undeciphered3: 13 3 0 0 2 1 3 4 1
//   Float 11 [_2DEmpireView]
//   Float 10 [_2DView]
//   Vector 12 [_ControlTex_TexelSize]
//   Vector 17 [_MainTex_ST]
//   Vector 15 [_MaxBBox]
//   Vector 14 [_MinBBox]
//   Vector 16 [_Offset]
//   Vector 7 [_ProjectionParams]
//   Vector 8 [_ScreenParams]
//   Vector 13 [_StartUV]
//   Vector 9 [_WorldSize]
//   Matrix 4 [_Object2World] 3
//   Matrix 0 [glstate_matrix_mvp]
//   SetTexture 0 [_ControlTex] 2D 0
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py

//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//   using 3Dmigoto command line v1.2.38 on Sun Oct 16 02:25:23 2016
//
//
// Parameters:
//
//   float _2DEmpireView;
//   float _2DView;
//   sampler2D _ControlTex;
//   float4 _ControlTex_TexelSize;
//   float4 _MainTex_ST;
//   float4 _MaxBBox;
//   float4 _MinBBox;
//   row_major float4x4 _Object2World;
//   float4 _Offset;
//   float4 _ProjectionParams;
//   float4 _ScreenParams;
//   float4 _StartUV;
//   float4 _WorldSize;
//   row_major float4x4 glstate_matrix_mvp;
//
//
// Registers:
//
//   Name                  Reg   Size
//   --------------------- ----- ----
//   glstate_matrix_mvp    c0       4
//   _Object2World         c4       3
//   _ProjectionParams     c7       1
//   _ScreenParams         c8       1
//   _WorldSize            c9       1
//   _2DView               c10      1
//   _2DEmpireView         c11      1
//   _ControlTex_TexelSize c12      1
//   _StartUV              c13      1
//   _MinBBox              c14      1
//   _MaxBBox              c15      1
//   _Offset               c16      1
//   _MainTex_ST           c17      1
//   _ControlTex           s0       1
//
//
// Default values:
//
//   _2DView
//     c10  = { 0, 0, 0, 0 };
//
//   _2DEmpireView
//     c11  = { 0, 0, 0, 0 };
//

    vs_3_0
    def c18, 0.546999991, 0.275999993, 255, 765
    def c19, 256, 0.00389105058, 0, 0
    def c20, 0, 0.5, 1, 2
    dcl_position v0
    dcl_texcoord v1
    dcl_color v2
    dcl_2d s0
    dcl_position o0
    dcl_texcoord o1.xy
    dcl_texcoord1 o2.xy
    dcl_texcoord2 o3
    dcl_texcoord3 o4

def c220, 0, 1, 0.0625, 0.5
dcl_2d s3

    mov r0.xy, c18
    mul r0.x, r0.x, c10.x
    mad r0.x, r0.x, -v0.y, v0.y
    min r0.x, r0.x, v0.y
    mul r0.y, r0.y, c11.x
    mad r0.y, r0.y, -r0.x, r0.x
    min r0.x, r0.y, r0.x
    mov r1.zw, c20.x
    mov r2.y, c20.x
    mul r0.yz, c18.xzww, v2.x
    mul r2.x, r0.z, c12.x
    sge r0.y, r0.y, c16.w
    add r0.zw, r2.xyxy, c13.xyxy
    mov r2, c20
    mad r3.xy, c12, r2.y, r0.zwzw
    mad r1.xy, c12.x, r2.wxzw, r3
    texldl r1, r1, s0
    mad r0.zw, r1.xyyw, c19.x, r1.xyxz
    mul r0.w, r0.w, c15.w
    mul r1.z, r0.z, c19.y
    mul r4.y, r0.w, c19.y
    mov r4.xz, c20.x
    mul r0.xzw, r0.x, r4.xyyz
    mad r5.xy, c12.x, r2.zxzw, r3
    mov r5.zw, c20.x
    texldl r5, r5, s0
    mad r2.yw, r5, c19.x, r5.xxzz
    mul r5.zw, r2.xyyw, c19.y
    mul r1.xy, r5.w, c20.zxzw
    mul r4.xzw, r2.zyxz, c14.w
    mad r2.xyz, c15.w, r2.zxzw, -r4.xzww
    mad r1.xyz, r1, r2, r4.xzww
    mul r1.xyz, r4.y, r1
    mad r0.xzw, v0.x, r1.xyyz, r0
    mul r2.x, -r1.z, v0.z
    mul r2.z, r1.x, v0.z
    mov r2.y, c20.x
    add r0.xzw, r0, r2.xyyz
    mov r3.zw, c20.x
    texldl r1, r3, s0
    mad r1.xy, r1.ywzw, c19.x, r1.xzzw
    mul r5.xy, r1, c19.y
    mov r1.xyz, c14
    add r1.xyz, -r1, c15
    mad r1.xyz, r5, r1, c14
    mad r1.xyz, c16, r0.y, r1
    add r0.xyz, r0.xzww, r1
    mov r0.w, v0.w
    dp4 r1.x, c4, r0
    dp4 r1.y, c6, r0
    rcp r2.x, c9.x
    rcp r2.y, c9.y
    mul o2.xy, r1, r2
    mad o1.xy, v1, c17, c17.zwzw
    dp4 r1.x, c0, r0
    dp4 r1.w, c3, r0

mov o0, r1 // Relocated from line 185 with shadertool.py

// Automatic vertex shader halo fix inserted with DarkStarSword's shadertool.py:
// shadertool.py -i --fix-unity-reflection --auto-fix-vertex-halo --add-fog-on-sm3-update --stereo-sampler-vs s3 --only-autofixed --ignore-parse-errors --ignore-register-errors --ignore-other-errors dumps\allshaders\vertexshader\991074B3.txt
texldl r31, c220.z, s3
add r31.w, r1.w, -r31.y
mad r1.x, r31.w, r31.x, r1.x

    mul r2.xz, r1.xyww, c20.y
    dp4 r1.y, c1, r0
    dp4 r1.z, c2, r0
    mul r0.x, r1.y, c7.x

//     mov o0, r1 // Relocated to line 181 with shadertool.py
mov o0.yz, r1 // Inserted by shadertool.py

    mov o3.zw, r1
    mul r2.w, r0.x, c20.y
    mad o3.xy, r2.z, c8.zwzw, r2.xwzw
    mov o4, c20.x

// approximately 68 instruction slots used (6 texture, 62 arithmetic)
