Search Unity

Bug Transparent material not transparent in VR

Discussion in 'VR' started by AtahanOzturk, Feb 10, 2021.

  1. AtahanOzturk

    AtahanOzturk

    Joined:
    Aug 18, 2015
    Posts:
    9
    I have some transparent water textures that blue the underlying geometry for a nice effect. However, in the VR headset the transparent areas look white, while everything looks fine in the Unity editor. I'm using Quest 2 with a link cable, running from the editor (the effect is also present in build) using the built-in rendering pipeline and SteamVR/OpenVR.


    I managed to replicate the effect by changing the render queue to geometry (anything under 2000. The default for this asset is 2999). Here is what I see inside the headset:

    weird water.png


    And here is how it should look: correct water.png


    So even though the material is set to render as transparent it looks as if it is rendered as geometry, but only in the headset.


    Here is the shader code:
    Code (CSharp):
    1. Shader "NatureManufacture Shaders/Water/Water River Offset Vertex Color Flow"
    2. {
    3.     Properties
    4.     {
    5.         _GlobalTiling("Global Tiling", Range( 0.001 , 100)) = 1
    6.         _UVVDirection1UDirection0("UV - V Direction (1) U Direction (0)", Int) = 0
    7.         _BackfaceAlpha("Backface Alpha", Range( 0 , 1)) = 0.85
    8.         _SlowWaterSpeed("Slow Water Speed", Vector) = (0.3,0.3,0,0)
    9.         _SlowWaterMixSpeed("Slow Water Mix Speed", Vector) = (0.002,0.002,0,0)
    10.         _SmallCascadeMainSpeed("Small Cascade Main Speed", Vector) = (0.6,0.6,0,0)
    11.         _SmallCascadeMixSpeed("Small Cascade Mix Speed", Vector) = (0.04,0.08,0,0)
    12.         _BigCascadeMainSpeed("Big Cascade Main Speed", Vector) = (1.4,1.4,0,0)
    13.         _BigCascadeMixSpeed("Big Cascade Mix Speed", Vector) = (0.02,0.28,0,0)
    14.         _CleanFalloffMultiply("Clean Falloff Multiply", Range( 0.1 , 4)) = 0.64
    15.         _CleanFalloffPower("Clean Falloff Power", Range( 0.4 , 10)) = 1.68
    16.         _ShalowColor("Shalow Color", Color) = (1,1,1,0)
    17.         _ShalowFalloffMultiply("Shalow Falloff Multiply", Range( 0.1 , 4)) = 0.47
    18.         _ShalowFalloffPower("Shalow Falloff Power", Range( 0 , 10)) = 3.49
    19.         _DeepColor("Deep Color", Color) = (0,0,0,0)
    20.         _WaveTranslucencyPower("Wave Translucency Power", Range( 0 , 10)) = 3.44
    21.         _WaveTranslucencyHardness("Wave Translucency Hardness", Range( 0 , 10)) = 7.78
    22.         _WaveTranslucencyMultiply("Wave Translucency Multiply", Range( 0 , 10)) = 1
    23.         _WaveTranslucencyFallOffDistance("Wave Translucency FallOff Distance", Range( 0 , 100)) = 30
    24.         _WaterSpecularClose("Water Specular Close", Range( 0 , 1)) = 0
    25.         _WaterSpecularFar("Water Specular Far", Range( 0 , 1)) = 0
    26.         _WaterSpecularThreshold("Water Specular Threshold", Range( 0 , 10)) = 1
    27.         _WaterSmoothness("Water Smoothness", Float) = 0
    28.         _Distortion("Distortion", Float) = 0.5
    29.         _FarNormalPower("Far Normal Power", Range( 0 , 1)) = 0.5
    30.         _FarNormalBlendStartDistance("Far Normal Blend Start Distance", Float) = 200
    31.         _FarNormalBlendThreshold("Far Normal Blend Threshold", Range( 0 , 10)) = 10
    32.         _MicroWaveTiling("Micro Wave Tiling", Vector) = (20,20,0,0)
    33.         [NoScaleOffset]_MicroWaveNormal("Micro Wave Normal", 2D) = "bump" {}
    34.         _MicroWaveNormalScale("Micro Wave Normal Scale", Range( 0 , 2)) = 0.25
    35.         _MacroWaveNormalScale("Macro Wave Normal Scale", Range( 0 , 2)) = 0.33
    36.         _SlowWaterTiling("Slow Water Tiling", Vector) = (3,3,0,0)
    37.         [NoScaleOffset]_SlowWaterNormal("Slow Water Normal", 2D) = "bump" {}
    38.         _SlowNormalScale("Slow Normal Scale", Float) = 0.3
    39.         [NoScaleOffset]_SlowWaterTesselation("Slow Water Tesselation", 2D) = "black" {}
    40.         _SlowWaterTessScale("Slow Water Tess Scale", Float) = 0.1
    41.         _SmallCascadeTiling("Small Cascade Tiling", Vector) = (1,1,0,0)
    42.         [NoScaleOffset]_SmallCascadeNormal("Small Cascade Normal", 2D) = "bump" {}
    43.         _SmallCascadeNormalScale("Small Cascade Normal Scale", Float) = 0.3
    44.         _SmallCascadeAngle("Small Cascade Angle", Range( 0.001 , 90)) = 90
    45.         _SmallCascadeAngleFalloff("Small Cascade Angle Falloff", Range( 0 , 80)) = 5
    46.         [NoScaleOffset]_SmallCascadeWaterTess("Small Cascade Water Tess", 2D) = "white" {}
    47.         _SmallCascadeWaterTessScale("Small Cascade Water Tess Scale", Float) = 0.8
    48.         [NoScaleOffset]_SmallCascade("Small Cascade", 2D) = "white" {}
    49.         _SmallCascadeColor("Small Cascade Color", Vector) = (1,1,1,0)
    50.         _SmallCascadeFoamFalloff("Small Cascade Foam Falloff", Range( 0 , 10)) = 0
    51.         _SmallCascadeSmoothness("Small Cascade Smoothness", Float) = 0
    52.         _SmallCascadeSpecular("Small Cascade Specular", Range( 0 , 1)) = 0
    53.         _BigCascadeTiling("Big Cascade Tiling", Vector) = (1,1,0,0)
    54.         [NoScaleOffset]_BigCascadeNormal("Big Cascade Normal", 2D) = "bump" {}
    55.         _BigCascadeNormalScale("Big Cascade Normal Scale", Float) = 0.3
    56.         _BigCascadeAngle("Big Cascade Angle", Range( 0.001 , 90)) = 90
    57.         _BigCascadeAngleFalloff("Big Cascade Angle Falloff", Range( 0 , 80)) = 15
    58.         [NoScaleOffset]_BigCascadeWaterTess("Big Cascade Water Tess", 2D) = "black" {}
    59.         _BigCascadeWaterTessScale("Big Cascade Water Tess Scale", Float) = 0.5
    60.         [NoScaleOffset]_BigCascade("Big Cascade", 2D) = "white" {}
    61.         _BigCascadeColor("Big Cascade Color", Vector) = (1,1,1,0)
    62.         _BigCascadeFoamFalloff("Big Cascade Foam Falloff", Range( 0 , 10)) = 0
    63.         _BigCascadeTransparency("Big Cascade Transparency", Range( 0 , 1)) = 0
    64.         _BigCascadeSmoothness("Big Cascade Smoothness", Float) = 0
    65.         _BigCascadeSpecular("Big Cascade Specular", Range( 0 , 1)) = 0
    66.         [NoScaleOffset]_Noise("Noise", 2D) = "white" {}
    67.         _NoiseTiling("Noise Tiling", Vector) = (4,4,0,0)
    68.         _NoiseSpeed("Noise Speed", Vector) = (1,1,0,0)
    69.         _SmallCascadeNoisePower("Small Cascade Noise Power", Range( 0 , 10)) = 2.71
    70.         _SmallCascadeNoiseMultiply("Small Cascade Noise Multiply", Range( 0 , 40)) = 20
    71.         _BigCascadeNoisePower("Big Cascade Noise Power", Range( 0 , 10)) = 2.71
    72.         _BigCascadeNoiseMultiply("Big Cascade Noise Multiply", Range( 0 , 40)) = 20
    73.         [NoScaleOffset]_Foam("Foam", 2D) = "white" {}
    74.         _FoamSpeed("Foam Speed", Vector) = (0.3,0.3,0,0)
    75.         _FoamTiling("Foam Tiling", Vector) = (1,1,0,0)
    76.         _FoamColor("Foam Color", Vector) = (1,1,1,0)
    77.         _FoamDepth("Foam Depth", Range( 0 , 10)) = 0
    78.         _FoamFalloff("Foam Falloff", Range( -100 , 0)) = -100
    79.         _FoamWaveHardness("Foam Wave Hardness", Range( 0 , 10)) = 0.9
    80.         _FoamWavePower("Foam Wave Power", Range( 0 , 10)) = 2
    81.         _FoamWaveMultiply("Foam Wave Multiply", Range( 0 , 10)) = 7
    82.         _FoamSpecular("Foam Specular", Range( 0 , 1)) = 0
    83.         _FoamSmoothness("Foam Smoothness", Float) = 0
    84.         _AOPower("AO Power", Range( 0 , 1)) = 1
    85.         [HideInInspector] _texcoord( "", 2D ) = "white" {}
    86.         [HideInInspector] _texcoord4( "", 2D ) = "white" {}
    87.         [HideInInspector] __dirty( "", Int ) = 1
    88.     }
    89.  
    90.     SubShader
    91.     {
    92.         //BUP Tags{ "RenderType" = "Transparent"  "Queue" = "Geometry+999" }
    93.         Tags{ "RenderType" = "Transparent"  "Queue" = "Geometry+999" }
    94.         //Pass {Blend SrcAlpha OneMinusSrcAlpha}
    95.         Cull Off
    96.         ZWrite On
    97.         ZTest LEqual
    98.         Blend SrcAlpha OneMinusSrcAlpha , SrcAlpha OneMinusSrcAlpha
    99.         BlendOp Add , Add
    100.         GrabPass{ "_WaterGrab" }
    101.         CGPROGRAM
    102.         #include "UnityShaderVariables.cginc"
    103.         #include "UnityStandardUtils.cginc"
    104.         #include "UnityCG.cginc"
    105.         #pragma target 3.0
    106.         #pragma multi_compile_instancing
    107.         #pragma surface surf StandardSpecular keepalpha noshadow vertex:vertexDataFunc
    108.         struct Input
    109.         {
    110.             float2 uv_texcoord;
    111.             float2 uv4_texcoord4;
    112.             float3 worldNormal;
    113.             INTERNAL_DATA
    114.             float4 vertexColor : COLOR;
    115.             float3 worldPos;
    116.             float4 screenPos;
    117.             half ASEVFace : VFACE;
    118.         };
    119.  
    120.         uniform float _SlowWaterTessScale;
    121.         uniform sampler2D _SlowWaterTesselation;
    122.         uniform int _UVVDirection1UDirection0;
    123.         uniform float2 _SlowWaterMixSpeed;
    124.         uniform float2 _SlowWaterTiling;
    125.         uniform float _GlobalTiling;
    126.         uniform sampler2D _SlowWaterNormal;
    127.         uniform float _SlowNormalScale;
    128.         uniform float2 _SlowWaterSpeed;
    129.         uniform sampler2D _SmallCascadeWaterTess;
    130.         uniform float2 _SmallCascadeMixSpeed;
    131.         uniform float2 _SmallCascadeTiling;
    132.         uniform sampler2D _SmallCascadeNormal;
    133.         uniform float _SmallCascadeNormalScale;
    134.         uniform float2 _SmallCascadeMainSpeed;
    135.         uniform float _SmallCascadeWaterTessScale;
    136.         uniform half _SmallCascadeAngle;
    137.         uniform float _SmallCascadeAngleFalloff;
    138.         uniform half _BigCascadeAngle;
    139.         uniform float _BigCascadeAngleFalloff;
    140.         uniform float _BigCascadeWaterTessScale;
    141.         uniform sampler2D _BigCascadeWaterTess;
    142.         uniform float2 _BigCascadeMixSpeed;
    143.         uniform float2 _BigCascadeTiling;
    144.         uniform sampler2D _BigCascadeNormal;
    145.         uniform float _BigCascadeNormalScale;
    146.         uniform float2 _BigCascadeMainSpeed;
    147.         uniform float _MicroWaveNormalScale;
    148.         uniform sampler2D _MicroWaveNormal;
    149.         uniform float2 _MicroWaveTiling;
    150.         uniform float _MacroWaveNormalScale;
    151.         uniform float _FarNormalPower;
    152.         uniform float _FarNormalBlendStartDistance;
    153.         uniform float _FarNormalBlendThreshold;
    154.         uniform sampler2D _WaterGrab;
    155.         uniform float _Distortion;
    156.         uniform float3 _FoamColor;
    157.         UNITY_DECLARE_DEPTH_TEXTURE( _CameraDepthTexture );
    158.         uniform float4 _CameraDepthTexture_TexelSize;
    159.         uniform float _FoamDepth;
    160.         uniform float _FoamFalloff;
    161.         uniform sampler2D _Foam;
    162.         uniform float2 _FoamSpeed;
    163.         uniform float2 _FoamTiling;
    164.         uniform float _FoamWaveHardness;
    165.         uniform float _FoamWavePower;
    166.         uniform float _FoamWaveMultiply;
    167.         uniform float4 _DeepColor;
    168.         uniform float4 _ShalowColor;
    169.         uniform float _ShalowFalloffMultiply;
    170.         uniform float _ShalowFalloffPower;
    171.         uniform float _BigCascadeTransparency;
    172.         uniform float _WaveTranslucencyHardness;
    173.         uniform float _WaveTranslucencyPower;
    174.         uniform float _WaveTranslucencyMultiply;
    175.         uniform float _WaveTranslucencyFallOffDistance;
    176.         uniform sampler2D _SmallCascade;
    177.         uniform sampler2D _Noise;
    178.         uniform float2 _NoiseSpeed;
    179.         uniform float2 _NoiseTiling;
    180.         uniform float _SmallCascadeNoisePower;
    181.         uniform float _SmallCascadeNoiseMultiply;
    182.         uniform float3 _SmallCascadeColor;
    183.         uniform float _SmallCascadeFoamFalloff;
    184.         uniform sampler2D _BigCascade;
    185.         uniform float _BigCascadeNoisePower;
    186.         uniform float _BigCascadeNoiseMultiply;
    187.         uniform float3 _BigCascadeColor;
    188.         uniform float _BigCascadeFoamFalloff;
    189.         uniform float _WaterSpecularFar;
    190.         uniform float _WaterSpecularClose;
    191.         uniform float _WaterSpecularThreshold;
    192.         uniform float _FoamSpecular;
    193.         uniform float _SmallCascadeSpecular;
    194.         uniform float _BigCascadeSpecular;
    195.         uniform float _WaterSmoothness;
    196.         uniform float _FoamSmoothness;
    197.         uniform float _SmallCascadeSmoothness;
    198.         uniform float _BigCascadeSmoothness;
    199.         uniform half _AOPower;
    200.         uniform float _CleanFalloffMultiply;
    201.         uniform float _CleanFalloffPower;
    202.         uniform float _BackfaceAlpha;
    203.  
    204.  
    205.         inline float4 ASE_ComputeGrabScreenPos( float4 pos )
    206.         {
    207.             #if UNITY_UV_STARTS_AT_TOP
    208.             float scale = -1.0;
    209.             #else
    210.             float scale = 1.0;
    211.             #endif
    212.             float4 o = pos;
    213.             o.y = pos.w * 0.5f;
    214.             o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
    215.             return o;
    216.         }
    217.  
    218.  
    219.         void vertexDataFunc( inout appdata_full v, out Input o )
    220.         {
    221.             UNITY_INITIALIZE_OUTPUT( Input, o );
    222.             int Direction723 = _UVVDirection1UDirection0;
    223.             float2 appendResult706 = (float2(_SlowWaterMixSpeed.y , _SlowWaterMixSpeed.x));
    224.             float2 uv_TexCoord613 = v.texcoord.xy * _SlowWaterTiling;
    225.             float Globaltiling1010 = ( 1.0 / _GlobalTiling );
    226.             float2 temp_output_1214_0 = ( uv_TexCoord613 * Globaltiling1010 );
    227.             float2 panner612 = ( _Time.y * (( (float)Direction723 == 1.0 ) ? _SlowWaterMixSpeed :  appendResult706 ) + temp_output_1214_0);
    228.             float2 WaterSpeedValueMix516 = panner612;
    229.             float U1308 = v.texcoord3.xy.x;
    230.             float2 break1276 = ( _SlowWaterSpeed * _SlowWaterTiling );
    231.             float temp_output_1277_0 = ( U1308 * break1276.x );
    232.             float V1309 = v.texcoord3.xy.y;
    233.             float temp_output_1278_0 = ( break1276.y * V1309 );
    234.             float2 appendResult1280 = (float2(temp_output_1277_0 , temp_output_1278_0));
    235.             float2 appendResult1279 = (float2(temp_output_1278_0 , temp_output_1277_0));
    236.             float2 temp_output_1274_0 = (( (float)Direction723 == 1.0 ) ? appendResult1280 :  appendResult1279 );
    237.             float temp_output_816_0 = ( _Time.y * 0.15 );
    238.             float Refresh11198 = frac( ( temp_output_816_0 + 1.0 ) );
    239.             float2 WaterSpeedValueMainFlowUV1830 = ( ( temp_output_1274_0 * Refresh11198 ) + temp_output_1214_0 );
    240.             float Refresh21199 = frac( ( temp_output_816_0 + 0.5 ) );
    241.             float2 WaterSpeedValueMainFlowUV2831 = ( ( temp_output_1274_0 * Refresh21199 ) + temp_output_1214_0 );
    242.             float temp_output_834_0 = abs( ( ( Refresh11198 + -0.5 ) * 2.0 ) );
    243.             float SlowFlowHeightBase835 = temp_output_834_0;
    244.             float3 lerpResult838 = lerp( UnpackScaleNormal( tex2Dlod( _SlowWaterNormal, float4( WaterSpeedValueMainFlowUV1830, 0, 1.0) ), _SlowNormalScale ) , UnpackScaleNormal( tex2Dlod( _SlowWaterNormal, float4( WaterSpeedValueMainFlowUV2831, 0, 1.0) ), _SlowNormalScale ) , SlowFlowHeightBase835);
    245.             float temp_output_398_0 = ( ( _SlowWaterTessScale * 0.3 ) * tex2Dlod( _SlowWaterTesselation, float4( ( WaterSpeedValueMix516 + ( (lerpResult838).xy * float2( 0.05,0.05 ) ) ), 0, 1.0) ).a );
    246.             float lerpResult840 = lerp( tex2Dlod( _SlowWaterTesselation, float4( WaterSpeedValueMainFlowUV1830, 0, 1.0) ).a , tex2Dlod( _SlowWaterTesselation, float4( WaterSpeedValueMainFlowUV2831, 0, 1.0) ).a , SlowFlowHeightBase835);
    247.             float temp_output_415_0 = ( temp_output_398_0 + ( _SlowWaterTessScale * lerpResult840 ) );
    248.             float2 appendResult709 = (float2(_SmallCascadeMixSpeed.y , _SmallCascadeMixSpeed.x));
    249.             float2 uv_TexCoord599 = v.texcoord.xy * _SmallCascadeTiling;
    250.             float2 temp_output_1233_0 = ( uv_TexCoord599 * Globaltiling1010 );
    251.             float2 panner597 = ( _Time.y * (( (float)Direction723 == 1.0 ) ? _SmallCascadeMixSpeed :  appendResult709 ) + temp_output_1233_0);
    252.             float2 SmallCascadeSpeedValueMix433 = panner597;
    253.             float2 temp_output_1220_0 = ( _SmallCascadeMainSpeed * _SmallCascadeTiling );
    254.             float2 break1270 = temp_output_1220_0;
    255.             float temp_output_1271_0 = ( U1308 * break1270.x );
    256.             float temp_output_1272_0 = ( break1270.y * V1309 );
    257.             float2 appendResult1269 = (float2(temp_output_1271_0 , temp_output_1272_0));
    258.             float2 appendResult1273 = (float2(temp_output_1272_0 , temp_output_1271_0));
    259.             float2 temp_output_1240_0 = (( (float)Direction723 == 1.0 ) ? appendResult1269 :  appendResult1273 );
    260.             float temp_output_990_0 = ( _Time.y * 0.2 );
    261.             float Refresh1v21237 = frac( ( temp_output_990_0 + 1.0 ) );
    262.             float2 SmallCascadeWaterSpeedValueMainFlowUV1860 = ( ( temp_output_1240_0 * Refresh1v21237 ) + temp_output_1233_0 );
    263.             float Refresh2v21238 = frac( ( temp_output_990_0 + 0.5 ) );
    264.             float2 SmallCascadeWaterSpeedValueMainFlowUV2854 = ( ( temp_output_1240_0 * Refresh2v21238 ) + temp_output_1233_0 );
    265.             float SmallCascadeSlowFlowHeightBase859 = abs( ( ( Refresh1v21237 + -0.5 ) * 2.0 ) );
    266.             float3 lerpResult864 = lerp( UnpackScaleNormal( tex2Dlod( _SmallCascadeNormal, float4( SmallCascadeWaterSpeedValueMainFlowUV1860, 0, 1.0) ), _SmallCascadeNormalScale ) , UnpackScaleNormal( tex2Dlod( _SmallCascadeNormal, float4( SmallCascadeWaterSpeedValueMainFlowUV2854, 0, 1.0) ), _SmallCascadeNormalScale ) , SmallCascadeSlowFlowHeightBase859);
    267.             float temp_output_410_0 = ( tex2Dlod( _SmallCascadeWaterTess, float4( ( SmallCascadeSpeedValueMix433 + ( (lerpResult864).xy * float2( 0.05,0.05 ) ) ), 0, 1.0) ).a * ( _SmallCascadeWaterTessScale * 0.4 ) );
    268.             float lerpResult869 = lerp( tex2Dlod( _SmallCascadeWaterTess, float4( SmallCascadeWaterSpeedValueMainFlowUV1860, 0, 1.0) ).a , tex2Dlod( _SmallCascadeWaterTess, float4( SmallCascadeWaterSpeedValueMainFlowUV2854, 0, 0.0) ).a , SmallCascadeSlowFlowHeightBase859);
    269.             float temp_output_414_0 = ( temp_output_410_0 + ( lerpResult869 * _SmallCascadeWaterTessScale ) );
    270.             float3 ase_worldNormal = UnityObjectToWorldNormal( v.normal );
    271.             float clampResult259 = clamp( ase_worldNormal.y , 0.0 , 1.0 );
    272.             float temp_output_258_0 = ( _SmallCascadeAngle / 45.0 );
    273.             float clampResult263 = clamp( ( clampResult259 - ( 1.0 - temp_output_258_0 ) ) , 0.0 , 2.0 );
    274.             float clampResult584 = clamp( ( clampResult263 * ( 1.0 / temp_output_258_0 ) ) , 0.0 , 1.0 );
    275.             float temp_output_267_0 = pow( ( 1.0 - clampResult584 ) , _SmallCascadeAngleFalloff );
    276.             float clampResult507 = clamp( ase_worldNormal.y , 0.0 , 1.0 );
    277.             float temp_output_504_0 = ( _BigCascadeAngle / 45.0 );
    278.             float clampResult509 = clamp( ( clampResult507 - ( 1.0 - temp_output_504_0 ) ) , 0.0 , 2.0 );
    279.             float clampResult583 = clamp( ( clampResult509 * ( 1.0 / temp_output_504_0 ) ) , 0.0 , 1.0 );
    280.             float clampResult514 = clamp( pow( ( 1.0 - clampResult583 ) , _BigCascadeAngleFalloff ) , 0.0 , 1.0 );
    281.             float clampResult285 = clamp( ( temp_output_267_0 - clampResult514 ) , 0.0 , 1.0 );
    282.             float lerpResult407 = lerp( temp_output_415_0 , ( temp_output_414_0 * clampResult285 ) , clampResult285);
    283.             float2 appendResult712 = (float2(_BigCascadeMixSpeed.y , _BigCascadeMixSpeed.x));
    284.             float2 uv_TexCoord605 = v.texcoord.xy * _BigCascadeTiling;
    285.             float2 temp_output_1263_0 = ( uv_TexCoord605 * Globaltiling1010 );
    286.             float2 panner606 = ( _Time.y * (( (float)Direction723 == 1.0 ) ? _BigCascadeMixSpeed :  appendResult712 ) + temp_output_1263_0);
    287.             float2 BigCascadeSpeedValueMix608 = panner606;
    288.             float2 break1283 = ( _BigCascadeMainSpeed * _BigCascadeTiling );
    289.             float temp_output_1284_0 = ( U1308 * break1283.x );
    290.             float temp_output_1285_0 = ( break1283.y * V1309 );
    291.             float2 appendResult1287 = (float2(temp_output_1284_0 , temp_output_1285_0));
    292.             float2 appendResult1286 = (float2(temp_output_1285_0 , temp_output_1284_0));
    293.             float2 temp_output_1281_0 = (( (float)Direction723 == 1.0 ) ? appendResult1287 :  appendResult1286 );
    294.             float temp_output_980_0 = ( _Time.y * 0.6 );
    295.             float Refresh1v31200 = frac( ( temp_output_980_0 + 1.0 ) );
    296.             float2 BigCascadeWaterSpeedValueMainFlowUV1893 = ( ( temp_output_1281_0 * Refresh1v31200 ) + temp_output_1263_0 );
    297.             float Refresh2v31201 = frac( ( temp_output_980_0 + 0.5 ) );
    298.             float2 BigCascadeWaterSpeedValueMainFlowUV2894 = ( ( temp_output_1281_0 * Refresh2v31201 ) + temp_output_1263_0 );
    299.             float BigCascadeSlowFlowHeightBase895 = abs( ( ( Refresh1v31200 + -0.5 ) * 2.0 ) );
    300.             float3 lerpResult899 = lerp( UnpackScaleNormal( tex2Dlod( _BigCascadeNormal, float4( BigCascadeWaterSpeedValueMainFlowUV1893, 0, 1.0) ), _BigCascadeNormalScale ) , UnpackScaleNormal( tex2Dlod( _BigCascadeNormal, float4( BigCascadeWaterSpeedValueMainFlowUV2894, 0, 1.0) ), _BigCascadeNormalScale ) , BigCascadeSlowFlowHeightBase895);
    301.             float temp_output_564_0 = ( ( _BigCascadeWaterTessScale * 0.5 ) * tex2Dlod( _BigCascadeWaterTess, float4( ( BigCascadeSpeedValueMix608 + ( (lerpResult899).xy * float2( 0.05,0.05 ) ) ), 0, 1.0) ).a );
    302.             float lerpResult874 = lerp( tex2Dlod( _BigCascadeWaterTess, float4( BigCascadeWaterSpeedValueMainFlowUV1893, 0, 1.0) ).a , tex2Dlod( _BigCascadeWaterTess, float4( BigCascadeWaterSpeedValueMainFlowUV2894, 0, 1.0) ).a , BigCascadeSlowFlowHeightBase895);
    303.             float temp_output_565_0 = ( temp_output_564_0 + ( _BigCascadeWaterTessScale * lerpResult874 ) );
    304.             float temp_output_566_0 = ( temp_output_565_0 * clampResult514 );
    305.             float4 break770 = ( v.color / float4( 1,1,1,1 ) );
    306.             float lerpResult754 = lerp( max( lerpResult407 , temp_output_566_0 ) , temp_output_415_0 , break770.r);
    307.             float lerpResult755 = lerp( lerpResult754 , temp_output_414_0 , break770.g);
    308.             float lerpResult752 = lerp( lerpResult755 , temp_output_565_0 , break770.b);
    309.             float3 ase_vertexNormal = v.normal.xyz;
    310.             v.vertex.xyz += ( (lerpResult752*1.0 + ( lerpResult752 * -0.5 )) * ase_vertexNormal );
    311.         }
    312.  
    313.         void surf( Input i , inout SurfaceOutputStandardSpecular o )
    314.         {
    315.             int Direction723 = _UVVDirection1UDirection0;
    316.             float2 appendResult706 = (float2(_SlowWaterMixSpeed.y , _SlowWaterMixSpeed.x));
    317.             float2 uv_TexCoord613 = i.uv_texcoord * _SlowWaterTiling;
    318.             float Globaltiling1010 = ( 1.0 / _GlobalTiling );
    319.             float2 temp_output_1214_0 = ( uv_TexCoord613 * Globaltiling1010 );
    320.             float2 panner612 = ( _Time.y * (( (float)Direction723 == 1.0 ) ? _SlowWaterMixSpeed :  appendResult706 ) + temp_output_1214_0);
    321.             float2 WaterSpeedValueMix516 = panner612;
    322.             float U1308 = i.uv4_texcoord4.x;
    323.             float2 break1276 = ( _SlowWaterSpeed * _SlowWaterTiling );
    324.             float temp_output_1277_0 = ( U1308 * break1276.x );
    325.             float V1309 = i.uv4_texcoord4.y;
    326.             float temp_output_1278_0 = ( break1276.y * V1309 );
    327.             float2 appendResult1280 = (float2(temp_output_1277_0 , temp_output_1278_0));
    328.             float2 appendResult1279 = (float2(temp_output_1278_0 , temp_output_1277_0));
    329.             float2 temp_output_1274_0 = (( (float)Direction723 == 1.0 ) ? appendResult1280 :  appendResult1279 );
    330.             float temp_output_816_0 = ( _Time.y * 0.15 );
    331.             float Refresh11198 = frac( ( temp_output_816_0 + 1.0 ) );
    332.             float2 WaterSpeedValueMainFlowUV1830 = ( ( temp_output_1274_0 * Refresh11198 ) + temp_output_1214_0 );
    333.             float Refresh21199 = frac( ( temp_output_816_0 + 0.5 ) );
    334.             float2 WaterSpeedValueMainFlowUV2831 = ( ( temp_output_1274_0 * Refresh21199 ) + temp_output_1214_0 );
    335.             float temp_output_834_0 = abs( ( ( Refresh11198 + -0.5 ) * 2.0 ) );
    336.             float SlowFlowHeightBase835 = temp_output_834_0;
    337.             float3 lerpResult838 = lerp( UnpackScaleNormal( tex2D( _SlowWaterNormal, WaterSpeedValueMainFlowUV1830 ), _SlowNormalScale ) , UnpackScaleNormal( tex2D( _SlowWaterNormal, WaterSpeedValueMainFlowUV2831 ), _SlowNormalScale ) , SlowFlowHeightBase835);
    338.             float2 temp_output_1085_0 = ( (lerpResult838).xy * float2( 0.05,0.05 ) );
    339.             float3 temp_output_24_0 = BlendNormals( BlendNormals( UnpackScaleNormal( tex2D( _MicroWaveNormal, ( ( WaterSpeedValueMix516 * _MicroWaveTiling ) + temp_output_1085_0 ) ), _MicroWaveNormalScale ) , UnpackScaleNormal( tex2D( _SlowWaterNormal, ( WaterSpeedValueMix516 + temp_output_1085_0 ) ), _MacroWaveNormalScale ) ) , lerpResult838 );
    340.             float2 appendResult709 = (float2(_SmallCascadeMixSpeed.y , _SmallCascadeMixSpeed.x));
    341.             float2 uv_TexCoord599 = i.uv_texcoord * _SmallCascadeTiling;
    342.             float2 temp_output_1233_0 = ( uv_TexCoord599 * Globaltiling1010 );
    343.             float2 panner597 = ( _Time.y * (( (float)Direction723 == 1.0 ) ? _SmallCascadeMixSpeed :  appendResult709 ) + temp_output_1233_0);
    344.             float2 SmallCascadeSpeedValueMix433 = panner597;
    345.             float2 temp_output_1220_0 = ( _SmallCascadeMainSpeed * _SmallCascadeTiling );
    346.             float2 break1270 = temp_output_1220_0;
    347.             float temp_output_1271_0 = ( U1308 * break1270.x );
    348.             float temp_output_1272_0 = ( break1270.y * V1309 );
    349.             float2 appendResult1269 = (float2(temp_output_1271_0 , temp_output_1272_0));
    350.             float2 appendResult1273 = (float2(temp_output_1272_0 , temp_output_1271_0));
    351.             float2 temp_output_1240_0 = (( (float)Direction723 == 1.0 ) ? appendResult1269 :  appendResult1273 );
    352.             float temp_output_990_0 = ( _Time.y * 0.2 );
    353.             float Refresh1v21237 = frac( ( temp_output_990_0 + 1.0 ) );
    354.             float2 SmallCascadeWaterSpeedValueMainFlowUV1860 = ( ( temp_output_1240_0 * Refresh1v21237 ) + temp_output_1233_0 );
    355.             float Refresh2v21238 = frac( ( temp_output_990_0 + 0.5 ) );
    356.             float2 SmallCascadeWaterSpeedValueMainFlowUV2854 = ( ( temp_output_1240_0 * Refresh2v21238 ) + temp_output_1233_0 );
    357.             float SmallCascadeSlowFlowHeightBase859 = abs( ( ( Refresh1v21237 + -0.5 ) * 2.0 ) );
    358.             float3 lerpResult864 = lerp( UnpackScaleNormal( tex2D( _SmallCascadeNormal, SmallCascadeWaterSpeedValueMainFlowUV1860 ), _SmallCascadeNormalScale ) , UnpackScaleNormal( tex2D( _SmallCascadeNormal, SmallCascadeWaterSpeedValueMainFlowUV2854 ), _SmallCascadeNormalScale ) , SmallCascadeSlowFlowHeightBase859);
    359.             float2 temp_output_1098_0 = ( (lerpResult864).xy * float2( 0.1,0.1 ) );
    360.             float3 temp_output_526_0 = BlendNormals( BlendNormals( UnpackScaleNormal( tex2D( _MicroWaveNormal, ( ( SmallCascadeSpeedValueMix433 * _MicroWaveTiling ) + temp_output_1098_0 ) ), _MicroWaveNormalScale ) , UnpackScaleNormal( tex2D( _SmallCascadeNormal, ( SmallCascadeSpeedValueMix433 + temp_output_1098_0 ) ), _MacroWaveNormalScale ) ) , lerpResult864 );
    361.             float3 ase_worldNormal = WorldNormalVector( i, float3( 0, 0, 1 ) );
    362.             float clampResult259 = clamp( ase_worldNormal.y , 0.0 , 1.0 );
    363.             float temp_output_258_0 = ( _SmallCascadeAngle / 45.0 );
    364.             float clampResult263 = clamp( ( clampResult259 - ( 1.0 - temp_output_258_0 ) ) , 0.0 , 2.0 );
    365.             float clampResult584 = clamp( ( clampResult263 * ( 1.0 / temp_output_258_0 ) ) , 0.0 , 1.0 );
    366.             float temp_output_267_0 = pow( ( 1.0 - clampResult584 ) , _SmallCascadeAngleFalloff );
    367.             float clampResult507 = clamp( ase_worldNormal.y , 0.0 , 1.0 );
    368.             float temp_output_504_0 = ( _BigCascadeAngle / 45.0 );
    369.             float clampResult509 = clamp( ( clampResult507 - ( 1.0 - temp_output_504_0 ) ) , 0.0 , 2.0 );
    370.             float clampResult583 = clamp( ( clampResult509 * ( 1.0 / temp_output_504_0 ) ) , 0.0 , 1.0 );
    371.             float clampResult514 = clamp( pow( ( 1.0 - clampResult583 ) , _BigCascadeAngleFalloff ) , 0.0 , 1.0 );
    372.             float clampResult285 = clamp( ( temp_output_267_0 - clampResult514 ) , 0.0 , 1.0 );
    373.             float3 lerpResult330 = lerp( temp_output_24_0 , temp_output_526_0 , clampResult285);
    374.             float2 appendResult712 = (float2(_BigCascadeMixSpeed.y , _BigCascadeMixSpeed.x));
    375.             float2 uv_TexCoord605 = i.uv_texcoord * _BigCascadeTiling;
    376.             float2 temp_output_1263_0 = ( uv_TexCoord605 * Globaltiling1010 );
    377.             float2 panner606 = ( _Time.y * (( (float)Direction723 == 1.0 ) ? _BigCascadeMixSpeed :  appendResult712 ) + temp_output_1263_0);
    378.             float2 BigCascadeSpeedValueMix608 = panner606;
    379.             float2 break1283 = ( _BigCascadeMainSpeed * _BigCascadeTiling );
    380.             float temp_output_1284_0 = ( U1308 * break1283.x );
    381.             float temp_output_1285_0 = ( break1283.y * V1309 );
    382.             float2 appendResult1287 = (float2(temp_output_1284_0 , temp_output_1285_0));
    383.             float2 appendResult1286 = (float2(temp_output_1285_0 , temp_output_1284_0));
    384.             float2 temp_output_1281_0 = (( (float)Direction723 == 1.0 ) ? appendResult1287 :  appendResult1286 );
    385.             float temp_output_980_0 = ( _Time.y * 0.6 );
    386.             float Refresh1v31200 = frac( ( temp_output_980_0 + 1.0 ) );
    387.             float2 BigCascadeWaterSpeedValueMainFlowUV1893 = ( ( temp_output_1281_0 * Refresh1v31200 ) + temp_output_1263_0 );
    388.             float Refresh2v31201 = frac( ( temp_output_980_0 + 0.5 ) );
    389.             float2 BigCascadeWaterSpeedValueMainFlowUV2894 = ( ( temp_output_1281_0 * Refresh2v31201 ) + temp_output_1263_0 );
    390.             float BigCascadeSlowFlowHeightBase895 = abs( ( ( Refresh1v31200 + -0.5 ) * 2.0 ) );
    391.             float3 lerpResult899 = lerp( UnpackScaleNormal( tex2D( _BigCascadeNormal, BigCascadeWaterSpeedValueMainFlowUV1893 ), _BigCascadeNormalScale ) , UnpackScaleNormal( tex2D( _BigCascadeNormal, BigCascadeWaterSpeedValueMainFlowUV2894 ), _BigCascadeNormalScale ) , BigCascadeSlowFlowHeightBase895);
    392.             float2 temp_output_1130_0 = ( (lerpResult899).xy * float2( 0.15,0.15 ) );
    393.             float3 temp_output_333_0 = BlendNormals( BlendNormals( UnpackScaleNormal( tex2D( _MicroWaveNormal, ( ( BigCascadeSpeedValueMix608 * _MicroWaveTiling ) + temp_output_1130_0 ) ), _MacroWaveNormalScale ) , UnpackScaleNormal( tex2D( _BigCascadeNormal, ( BigCascadeSpeedValueMix608 + temp_output_1130_0 ) ), _MicroWaveNormalScale ) ) , lerpResult899 );
    394.             float3 lerpResult529 = lerp( lerpResult330 , temp_output_333_0 , clampResult514);
    395.             float4 break770 = ( i.vertexColor / float4( 1,1,1,1 ) );
    396.             float3 lerpResult748 = lerp( lerpResult529 , temp_output_24_0 , break770.r);
    397.             float3 lerpResult749 = lerp( lerpResult748 , temp_output_526_0 , break770.g);
    398.             float3 lerpResult750 = lerp( lerpResult749 , temp_output_333_0 , break770.b);
    399.             float3 appendResult1036 = (float3(_FarNormalPower , _FarNormalPower , 1.0));
    400.             float3 ase_worldPos = i.worldPos;
    401.             float Distance1027 = distance( ase_worldPos , _WorldSpaceCameraPos );
    402.             float clampResult1033 = clamp( pow( ( Distance1027 / _FarNormalBlendStartDistance ) , _FarNormalBlendThreshold ) , 0.0 , 1.0 );
    403.             float3 lerpResult1034 = lerp( lerpResult750 , ( lerpResult750 * appendResult1036 ) , clampResult1033);
    404.             o.Normal = lerpResult1034;
    405.             float4 ase_screenPos = float4( i.screenPos.xyz , i.screenPos.w + 0.00000000001 );
    406.             float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ase_screenPos );
    407.             float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
    408.             float2 appendResult163 = (float2(ase_grabScreenPosNorm.r , ase_grabScreenPosNorm.g));
    409.             float4 screenColor65 = tex2D( _WaterGrab, ( float3( ( appendResult163 / ase_grabScreenPosNorm.a ) ,  0.0 ) + ( lerpResult529 * _Distortion ) ).xy );
    410.             float eyeDepth1 = LinearEyeDepth(SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture,UNITY_PROJ_COORD( ase_screenPos )));
    411.             float temp_output_89_0 = abs( ( eyeDepth1 - ase_screenPos.w ) );
    412.             float temp_output_113_0 = saturate( pow( ( temp_output_89_0 + _FoamDepth ) , _FoamFalloff ) );
    413.             float2 temp_output_1292_0 = ( _FoamSpeed * _FoamTiling );
    414.             float2 break1293 = temp_output_1292_0;
    415.             float temp_output_1295_0 = ( U1308 * break1293.x );
    416.             float temp_output_1294_0 = ( break1293.y * V1309 );
    417.             float2 appendResult1298 = (float2(temp_output_1295_0 , temp_output_1294_0));
    418.             float2 appendResult1296 = (float2(temp_output_1294_0 , temp_output_1295_0));
    419.             float2 temp_output_1302_0 = (( (float)Direction723 == 1.0 ) ? appendResult1298 :  appendResult1296 );
    420.             float2 uv_TexCoord918 = i.uv_texcoord * _FoamTiling;
    421.             float2 temp_output_1305_0 = ( uv_TexCoord918 * Globaltiling1010 );
    422.             float2 FoamCascadeWaterSpeedValueMainFlowUV1932 = ( ( temp_output_1302_0 * Refresh11198 ) + temp_output_1305_0 );
    423.             float2 temp_output_1120_0 = ( (lerpResult529).xy * float2( 0.03,0.03 ) );
    424.             float2 FoamCascadeWaterSpeedValueMainFlowUV2933 = ( ( temp_output_1302_0 * Refresh21199 ) + temp_output_1305_0 );
    425.             float temp_output_930_0 = abs( ( ( Refresh11198 + -0.5 ) * 2.0 ) );
    426.             float FoamCascadeSlowFlowHeightBase935 = temp_output_930_0;
    427.             float lerpResult937 = lerp( tex2D( _Foam, ( FoamCascadeWaterSpeedValueMainFlowUV1932 + temp_output_1120_0 ) ).a , tex2D( _Foam, ( FoamCascadeWaterSpeedValueMainFlowUV2933 + temp_output_1120_0 ) ).a , FoamCascadeSlowFlowHeightBase935);
    428.             float temp_output_114_0 = ( temp_output_113_0 * lerpResult937 );
    429.             float lerpResult1378 = lerp( temp_output_114_0 , 0.0 , clampResult514);
    430.             float clampResult1185 = clamp( lerpResult1378 , 0.0 , 1.0 );
    431.             float temp_output_398_0 = ( ( _SlowWaterTessScale * 0.3 ) * tex2D( _SlowWaterTesselation, ( WaterSpeedValueMix516 + ( (lerpResult838).xy * float2( 0.05,0.05 ) ) ) ).a );
    432.             float lerpResult840 = lerp( tex2D( _SlowWaterTesselation, WaterSpeedValueMainFlowUV1830 ).a , tex2D( _SlowWaterTesselation, WaterSpeedValueMainFlowUV2831 ).a , SlowFlowHeightBase835);
    433.             float temp_output_410_0 = ( tex2D( _SmallCascadeWaterTess, ( SmallCascadeSpeedValueMix433 + ( (lerpResult864).xy * float2( 0.05,0.05 ) ) ) ).a * ( _SmallCascadeWaterTessScale * 0.4 ) );
    434.             float lerpResult869 = lerp( tex2D( _SmallCascadeWaterTess, SmallCascadeWaterSpeedValueMainFlowUV1860 ).a , tex2D( _SmallCascadeWaterTess, SmallCascadeWaterSpeedValueMainFlowUV2854 ).a , SmallCascadeSlowFlowHeightBase859);
    435.             float lerpResult1065 = lerp( ( temp_output_398_0 + lerpResult840 ) , ( ( temp_output_410_0 + lerpResult869 ) * clampResult285 ) , clampResult285);
    436.             float temp_output_564_0 = ( ( _BigCascadeWaterTessScale * 0.5 ) * tex2D( _BigCascadeWaterTess, ( BigCascadeSpeedValueMix608 + ( (lerpResult899).xy * float2( 0.05,0.05 ) ) ) ).a );
    437.             float lerpResult874 = lerp( tex2D( _BigCascadeWaterTess, BigCascadeWaterSpeedValueMainFlowUV1893 ).a , tex2D( _BigCascadeWaterTess, BigCascadeWaterSpeedValueMainFlowUV2894 ).a , BigCascadeSlowFlowHeightBase895);
    438.             float lerpResult1066 = lerp( lerpResult1065 , ( ( temp_output_564_0 + lerpResult874 ) * clampResult514 ) , clampResult514);
    439.             float HeightMapMix1367 = lerpResult1066;
    440.             float clampResult1355 = clamp( ( pow( abs( ( HeightMapMix1367 * _FoamWaveHardness ) ) , _FoamWavePower ) * _FoamWaveMultiply ) , 0.0 , 1.0 );
    441.             float4 lerpResult117 = lerp( screenColor65 , float4( _FoamColor , 0.0 ) , ( clampResult1185 * clampResult1355 ));
    442.             float4 lerpResult390 = lerp( screenColor65 , lerpResult117 , temp_output_113_0);
    443.             float lerpResult810 = lerp( pow( ( temp_output_89_0 * _ShalowFalloffMultiply ) , ( _ShalowFalloffPower * -1.0 ) ) , 100.0 , ( _BigCascadeTransparency * clampResult514 ));
    444.             float clampResult1186 = clamp( saturate( lerpResult810 ) , 0.0 , 1.0 );
    445.             float4 lerpResult13 = lerp( _DeepColor , _ShalowColor , clampResult1186);
    446.             float clampResult1049 = clamp( ( Distance1027 / _WaveTranslucencyFallOffDistance ) , 0.0 , 1.0 );
    447.             float lerpResult1050 = lerp( ( pow( abs( ( HeightMapMix1367 * _WaveTranslucencyHardness ) ) , _WaveTranslucencyPower ) * _WaveTranslucencyMultiply ) , 0.0 , clampResult1049);
    448.             float clampResult1051 = clamp( lerpResult1050 , 0.0 , 1.0 );
    449.             float Microwaves1052 = clampResult1051;
    450.             float4 lerpResult1069 = lerp( lerpResult13 , _ShalowColor , Microwaves1052);
    451.             float temp_output_458_0 = ( 1.0 - clampResult1186 );
    452.             float4 lerpResult1007 = lerp( lerpResult390 , lerpResult1069 , temp_output_458_0);
    453.             float lerpResult879 = lerp( tex2D( _SmallCascade, SmallCascadeWaterSpeedValueMainFlowUV1860 ).a , tex2D( _SmallCascade, SmallCascadeWaterSpeedValueMainFlowUV2854 ).a , SmallCascadeSlowFlowHeightBase859);
    454.             float2 break1327 = ( _NoiseSpeed * _NoiseTiling );
    455.             float temp_output_1329_0 = ( U1308 * break1327.x );
    456.             float temp_output_1328_0 = ( break1327.y * V1309 );
    457.             float2 appendResult1332 = (float2(temp_output_1329_0 , temp_output_1328_0));
    458.             float2 appendResult1330 = (float2(temp_output_1328_0 , temp_output_1329_0));
    459.             float2 temp_output_1333_0 = (( (float)Direction723 == 1.0 ) ? appendResult1332 :  appendResult1330 );
    460.             float2 uv_TexCoord1337 = i.uv_texcoord * _NoiseTiling;
    461.             float2 temp_output_1338_0 = ( uv_TexCoord1337 * Globaltiling1010 );
    462.             float lerpResult1346 = lerp( tex2D( _Noise, ( ( temp_output_1333_0 * Refresh11198 ) + temp_output_1338_0 ) ).a , tex2D( _Noise, ( ( temp_output_1333_0 * Refresh21199 ) + temp_output_1338_0 ) ).a , SlowFlowHeightBase835);
    463.             float clampResult488 = clamp( ( pow( lerpResult1346 , _SmallCascadeNoisePower ) * _SmallCascadeNoiseMultiply ) , 0.0 , 1.0 );
    464.             float lerpResult480 = lerp( 0.0 , lerpResult879 , clampResult488);
    465.             float3 temp_output_320_0 = ( lerpResult480 * _SmallCascadeColor );
    466.             float clampResult322 = clamp( pow( lerpResult879 , _SmallCascadeFoamFalloff ) , 0.0 , 1.0 );
    467.             float lerpResult580 = lerp( 0.0 , clampResult322 , clampResult285);
    468.             float4 lerpResult324 = lerp( lerpResult1007 , float4( temp_output_320_0 , 0.0 ) , lerpResult580);
    469.             float lerpResult902 = lerp( tex2D( _BigCascade, BigCascadeWaterSpeedValueMainFlowUV1893 ).a , tex2D( _BigCascade, BigCascadeWaterSpeedValueMainFlowUV2894 ).a , BigCascadeSlowFlowHeightBase895);
    470.             float clampResult807 = clamp( ( pow( lerpResult1346 , _BigCascadeNoisePower ) * _BigCascadeNoiseMultiply ) , 0.0 , 1.0 );
    471.             float lerpResult626 = lerp( ( lerpResult902 * 0.5 ) , lerpResult902 , clampResult807);
    472.             float3 temp_output_241_0 = ( lerpResult626 * _BigCascadeColor );
    473.             float clampResult299 = clamp( pow( lerpResult902 , _BigCascadeFoamFalloff ) , 0.0 , 1.0 );
    474.             float lerpResult579 = lerp( 0.0 , clampResult299 , clampResult514);
    475.             float4 lerpResult239 = lerp( lerpResult324 , float4( temp_output_241_0 , 0.0 ) , lerpResult579);
    476.             float4 lerpResult773 = lerp( screenColor65 , lerpResult1069 , temp_output_458_0);
    477.             float4 lerpResult757 = lerp( lerpResult239 , lerpResult773 , break770.r);
    478.             float4 lerpResult762 = lerp( lerpResult773 , float4( temp_output_320_0 , 0.0 ) , clampResult322);
    479.             float4 lerpResult758 = lerp( lerpResult757 , lerpResult762 , break770.g);
    480.             float4 lerpResult763 = lerp( lerpResult773 , float4( temp_output_241_0 , 0.0 ) , clampResult299);
    481.             float4 lerpResult756 = lerp( lerpResult758 , lerpResult763 , break770.b);
    482.             o.Albedo = lerpResult756.rgb;
    483.             float lerpResult994 = lerp( _WaterSpecularFar , _WaterSpecularClose , pow( clampResult1186 , _WaterSpecularThreshold ));
    484.             float lerpResult130 = lerp( lerpResult994 , _FoamSpecular , temp_output_114_0);
    485.             float lerpResult585 = lerp( lerpResult130 , _SmallCascadeSpecular , ( lerpResult580 * clampResult285 ));
    486.             float lerpResult587 = lerp( lerpResult585 , _BigCascadeSpecular , ( lerpResult579 * clampResult514 ));
    487.             float lerpResult785 = lerp( lerpResult587 , lerpResult130 , break770.r);
    488.             float lerpResult796 = lerp( lerpResult130 , _SmallCascadeSpecular , lerpResult580);
    489.             float lerpResult786 = lerp( lerpResult785 , lerpResult796 , break770.g);
    490.             float lerpResult797 = lerp( lerpResult130 , _BigCascadeSpecular , lerpResult579);
    491.             float lerpResult787 = lerp( lerpResult786 , lerpResult797 , break770.b);
    492.             float3 temp_cast_21 = (lerpResult787).xxx;
    493.             o.Specular = temp_cast_21;
    494.             float lerpResult591 = lerp( _WaterSmoothness , _FoamSmoothness , temp_output_114_0);
    495.             float lerpResult593 = lerp( lerpResult591 , _SmallCascadeSmoothness , ( lerpResult580 * clampResult285 ));
    496.             float lerpResult592 = lerp( lerpResult593 , _BigCascadeSmoothness , ( lerpResult579 * clampResult514 ));
    497.             float lerpResult788 = lerp( lerpResult592 , lerpResult591 , break770.r);
    498.             float lerpResult798 = lerp( lerpResult591 , _SmallCascadeSmoothness , lerpResult580);
    499.             float lerpResult789 = lerp( lerpResult788 , lerpResult798 , break770.g);
    500.             float lerpResult799 = lerp( lerpResult591 , _BigCascadeSmoothness , lerpResult579);
    501.             float lerpResult790 = lerp( lerpResult789 , lerpResult799 , break770.b);
    502.             o.Smoothness = lerpResult790;
    503.             o.Occlusion = _AOPower;
    504.             float clampResult1171 = clamp( ( temp_output_89_0 * _CleanFalloffMultiply ) , 0.0 , 1.0 );
    505.             float clampResult1174 = clamp( pow( abs( clampResult1171 ) , _CleanFalloffPower ) , 0.0 , 1.0 );
    506.             float temp_output_779_0 = ( clampResult1174 * i.vertexColor.a );
    507.             float switchResult1056 = (((i.ASEVFace>0)?(temp_output_779_0):(( _BackfaceAlpha * temp_output_779_0 ))));
    508.             o.Alpha = switchResult1056;
    509.         }
    510.  
    511.         ENDCG
    512.     }
    513. }
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I notice the shader has ZWrite On. This will write to the depth buffer, so no geometry that's rendered later will draw behind it. That's probably why changing the render order makes a difference.

    However I also notice that this shader is doing all manner of things that are going to kill your performance on Quest, like a GrabPass. I'm extremely skeptical that you can get 72 fps with this, much less 90. So if you intend to someday put this in the app store, I wouldn't waste time with the transparency problem but instead find a more efficient mobile water shader.