// CRC32: CFE758C9 |    Unity headers extracted from VegetationInstancing3.shader
//    Shader "Instancing3/Amplitude/Environment/Terrain/Vegetation" {
//      Properties {
//       _Shininess ("Shininess", Range(0.01,1)) = 0.078125
//       _Intensity ("Intensity", Float) = 1
//       _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" { }
//       _SpecMap ("Spec map", 2D) = "white" { }
//       _IlluminMap ("IlluminMap", 2D) = "black" { }
//       _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
//       _altitudeGammaCorrectionFactor ("Altitude Gamma Correction", Float) = 0.25
//       _ViewSensitivity ("3D, Battle, 2D, Empire", Vector) = (1,0,0,0)
//       _WinterSensitivity ("Summer, Winter, WinterIntensity, Fow intensity", Vector) = (1,1,1,1)
//       _HexaGridTexture ("Hexa Grid Tex", 2D) = "black" { }
//       _MovementSettings ("Movement intensity summer & winter, movement scale intensity summer & winter", Vector) = (0.2,0.2,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 196883
//          Program "vp" {
//            SubProgram "d3d9 " {
//              GpuProgramIndex 64
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from VegetationInstancing3.shader.decompressed:
//   API d3d9
//   Shader model vs_3_0
//   undeciphered1: 64 6 -1
//   Keywords { "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "HDR_LIGHT_PREPASS_OFF" "DEFAULT_RENDERER" "MOVING_VEGETATION_OFF" }
//   undeciphered3: 13 3 0 0 2 1 3 4 1
//   Vector 10 [_CameraPos]
//   Vector 11 [_ControlTex_TexelSize]
//   Vector 16 [_MainTex_ST]
//   Vector 14 [_MaxBBox]
//   Vector 13 [_MinBBox]
//   Vector 15 [_Offset]
//   Vector 7 [_ProjectionParams]
//   Vector 8 [_ScreenParams]
//   Vector 12 [_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:26:11 2016
//
//
// Parameters:
//
//   float4 _CameraPos;
//   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
//   _CameraPos            c10      1
//   _ControlTex_TexelSize c11      1
//   _StartUV              c12      1
//   _MinBBox              c13      1
//   _MaxBBox              c14      1
//   _Offset               c15      1
//   _MainTex_ST           c16      1
//   _ControlTex           s0       1
//

    vs_3_0
    def c17, 1, 0, 2, 256
    def c18, 0.00389105058, -5, 0.0500000007, 0
    def c19, 1, 0.5, 0.166666672, 0
    def c20, 255, 765, 0, 0.5
    dcl_position v0
    dcl_texcoord v1
    dcl_color v2
    dcl_2d s0
    dcl_position o0
    dcl_texcoord o1.xy
    dcl_texcoord1 o2.xyz
    dcl_texcoord2 o3.xyz
    dcl_texcoord3 o4
    dcl_texcoord4 o5

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

    mov r0.zw, c20.z
    mov r1.y, c20.z
    mul r1.zw, c20.xyxy, v2.x
    mul r1.x, r1.w, c11.x
    sge r1.z, r1.z, c15.w
    add r1.xy, r1, c12
    mov r1.w, c20.w
    mad r2.xy, c11, r1.w, r1
    mov r3.xyz, c17
    mad r0.xy, c11.x, r3, r2
    texldl r0, r0, s0
    mad r0.xy, r0.ywzw, c17.w, r0.xzzw
    mul r0.zw, r0.xyxy, c18.x
    mul r4.xy, r0.w, c17
    mad r5.xy, c11.x, r3.zyzw, r2
    mov r5.zw, c20.z
    texldl r5, r5, s0
    mad r1.xy, r5.ywzw, c17.w, r5.xzzw
    mul r4.z, r1.x, c18.x
    mul r0.w, r1.y, c14.w
    mul r5.y, r0.w, c18.x
    mul r1.xyw, r3.xyzx, c13.w
    mad r3.xyz, c14.w, r3.xyxw, -r1.xyww
    mad r1.xyw, r4.xyzz, r3.xyzz, r1
    mul r1.xyw, r5.y, r1
    mov r5.xz, c20.z
    mul r3.xyz, r5, v0.y
    mad r3.xyz, v0.x, r1.xyww, r3
    mul r4.x, -r1.w, v0.z
    mul r4.z, r1.x, v0.z
    mov r4.y, c20.z
    add r1.xyw, r3.xyzz, r4.xyzz
    mov r2.zw, c20.z
    texldl r2, r2, s0
    mad r2.xy, r2.ywzw, c17.w, r2.xzzw
    mul r0.xy, r2, c18.x
    mov r2.xyz, c13
    add r2.xyz, -r2, c14
    mad r0.xyz, r0, r2, c13
    mad r0.xyz, c15, r1.z, r0
    add r0.xyz, r0, r1.xyww
    mov r0.w, v0.w
    dp4 o2.z, c5, r0
    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
    mul r1.xy, r1, c9.zwzw
    mul r1.xy, r2, r1
    mad o3.xy, r1, c19, c19.yzzw
    mov r1.y, c18.y
    add r1.x, r1.y, c10.y
    mul_sat r1.x, r1.x, c18.z
    add o3.z, r1.x, c17.x
    mad o1.xy, v1, c16, c16.zwzw
    dp4 r1.x, c0, r0
    dp4 r1.w, c3, r0

mov o0, r1 // Relocated from line 179 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\CFE758C9.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.w
    dp4 r1.y, c1, r0
    dp4 r1.z, c2, r0
    mul r0.x, r1.y, c7.x

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

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

// approximately 70 instruction slots used (6 texture, 64 arithmetic)
