// CRC32: B4338154 |    Unity headers extracted from RiverWater.shader
//    Shader "Custom/RiverWater" {
//      Properties {
//       _WaterTex ("Normal Map (RGB)", 2D) = "white" { }
//       _CausticTex ("Caustic (N&B)", 2D) = "white" { }
//       _FoamTex ("Foam (RGB)", 2D) = "white" { }
//       _Cube ("Skybox", CUBE) = "_Skybox" { }
//       _HexaGridTexture ("Hexa Grid Tex", 2D) = "white" { }
//       _DeepColor ("Deep Color", Color) = (1,1,1,1)
//       _WinterDeepColor ("Winter Deep Color", Color) = (1,1,1,1)
//       _Shininess ("Shininess", Range(0.01,1)) = 1
//       _WinterShininess ("Winter Shininess", Range(0.01,1)) = 1
//       _WinterSensitivity ("Summer, Winter, WinterIntensity, Fow intensity", Vector) = (1,1,1,1)
//       _TilingAndSpeed ("Tiling X, Y, foam Speed", Vector) = (0.25,0.25,0.25,0.3)
//       _WinterTilingAndSpeed ("Winter Tiling X, Y, foam Speed", Vector) = (0.25,0.25,0.25,0.3)
//       _Deformation ("Deformation", Range(0.01,100)) = 100
//       _DepthAttenuationMultiplier ("Depth Attenuation", Range(0.01,20)) = 10
//       _WinterDepthAttenuationMultiplier ("Winter Depth Attenuation", Range(0.01,20)) = 10
//       _WaterSelfIlluminationFactor ("Water SelfIllum Factor", Range(0.01,3)) = 1
//      }
//      Fallback Off
//      SubShader 1/1 {
//        LOD 300
//        Tags { "QUEUE"="Transparent-11" "RenderType"="Opaque" }
//        GrabPass {
//          "_WaterGrabTexture"
//          Tags { "LIGHTMODE"="Always" }
//         }
//        Pass 4/4 {
//          Name "PREPASS"
//          Tags { "LIGHTMODE"="PrePassFinal" "QUEUE"="Transparent-11" "RenderType"="Opaque" }
//          ZWrite Off
//          GpuProgramID 199398
//          Program "vp" {
//            SubProgram "d3d9 " {
//              GpuProgramIndex 16
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from RiverWater.shader.decompressed:
//   API d3d9
//   Shader model vs_3_0
//   undeciphered1: 40 2 -1
//   Keywords { "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "HDR_LIGHT_PREPASS_OFF" }
//   undeciphered3: 13 3 0 0 2 1 3 4 1
//   Vector 13 [_FilteredFirstHexaTexture_TexelSize]
//   Vector 11 [_ProjectionParams]
//   Vector 12 [_ScreenParams]
//   Vector 14 [_WorldSize]
//   Vector 10 [_WorldSpaceCameraPos]
//   Matrix 7 [_Object2World] 3
//   Matrix 4 [glstate_matrix_modelview0] 3
//   Matrix 0 [glstate_matrix_mvp]
//   SetTexture 0 [_FilteredFirstHexaTexture] 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:50 2016
//
//
// Parameters:
//
//   sampler2D _FilteredFirstHexaTexture;
//   float4 _FilteredFirstHexaTexture_TexelSize;
//   row_major float4x4 _Object2World;
//   float4 _ProjectionParams;
//   float4 _ScreenParams;
//   float4 _WorldSize;
//   float3 _WorldSpaceCameraPos;
//   row_major float4x4 glstate_matrix_modelview0;
//   row_major float4x4 glstate_matrix_mvp;
//
//
// Registers:
//
//   Name                                Reg   Size
//   ----------------------------------- ----- ----
//   glstate_matrix_mvp                  c0       4
//   glstate_matrix_modelview0           c4       3
//   _Object2World                       c7       3
//   _WorldSpaceCameraPos                c10      1
//   _ProjectionParams                   c11      1
//   _ScreenParams                       c12      1
//   _FilteredFirstHexaTexture_TexelSize c13      1
//   _WorldSize                          c14      1
//   _FilteredFirstHexaTexture           s0       1
//

    vs_3_0
    def c15, 1, 0, 0.5, -0.0799999982
    dcl_position v0
    dcl_texcoord v1
    dcl_color v2
    dcl_2d s0
    dcl_position o0
    dcl_texcoord o1
    dcl_texcoord1 o2.xyz
    dcl_texcoord2 o3.xyz
    dcl_texcoord3 o4.xyz
    dcl_texcoord4 o5
    dcl_texcoord5 o6

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

texldl r3, c220.z, s3

// Unity reflection/specular 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\B4338154.txt
mov r30, c10
mov r29, c220.x
mul r29.x, r3.x, -r3.y
dp4 r28.x, c180, r29
dp4 r28.y, c181, r29
dp4 r28.z, c182, r29
dp4 r28.w, c183, r29
dp4 r29.x, c190, r28
dp4 r29.y, c191, r28
dp4 r29.z, c192, r28
add r30.xyz, r30, -r29

    mov r0.xzw, v0
    mov r1.y, v0.y
    add r0.y, r1.y, -v1.x
    dp4 o3.y, c8, r0
    rcp r1.x, c14.x
    rcp r1.y, c14.y
    dp4 r2.x, c7, r0
    dp4 r2.z, c9, r0
    mul r1.xy, r1, r2.xzzw
    mov o3.xz, r2
    max r0.x, r1.y, c15.y
    mov r2.x, c15.x
    add r0.z, r2.x, -c13.y
    min r1.z, r0.z, r0.x
    mov r1.w, c15.y
    texldl r1, r1.xzww, s0
    add r0.x, -r1.x, c15.z
    add_sat r0.x, r0.x, r0.x
    lrp r1.y, r0.x, c15.w, r0.y
    mov r1.xzw, v0
    dp4 r0.x, c6, r1
    mov o2.z, -r0.x
    dp4 r0.x, c7, r1
    dp4 r0.y, c8, r1
    dp4 r0.z, c9, r1
    add o4.xyz, r0, -r30
    dp4 r0.x, c0, r1
    dp4 r0.w, c3, r1

mov o0, r0 // Relocated from line 142 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\B4338154.txt
texldl r31, c220.z, s3
add r31.w, r0.w, -r31.y
mad r0.x, r31.w, r31.x, r0.x

    mul r2.xz, r0.xyww, c15.z
    dp4 r0.y, c1, r1
    dp4 r0.z, c2, r1
    mul r1.x, r0.y, c11.x
    mul r2.w, r1.x, c15.z
    mad o5.xy, r2.z, c12.zwzw, r2.xwzw

//     mov o0, r0 // Relocated to line 136 with shadertool.py
mov o0.yz, r0 // Inserted by shadertool.py

    mov o1, r0
    mov o5.zw, r0
    mov o2.x, v2.x
    mov o2.y, v1.y
    mov o6, c15.y

// approximately 41 instruction slots used (2 texture, 39 arithmetic)
