// Made with Amplify Shader Editor v1.9.8 // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Polytope Studio/PT_Water_Shader" { Properties { [HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1) [HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5 _DeepColor("Deep Color", Color) = (0.3114988,0.5266015,0.5283019,0) _ShallowColor("Shallow Color", Color) = (0.5238074,0.7314408,0.745283,0) _Depth("Depth", Range( 0 , 1)) = 0.3 _DepthStrength("Depth Strength", Range( 0 , 1)) = 0.3 _Smootness("Smootness", Range( 0 , 1)) = 1 _Mettalic("Mettalic", Range( 0 , 1)) = 1 _WaveSpeed("Wave Speed", Range( 0 , 1)) = 0.5 _WaveTile("Wave Tile", Range( 0 , 0.9)) = 0.5 _WaveAmplitude("Wave Amplitude", Range( 0 , 1)) = 0.2 [NoScaleOffset][Normal]_NormalMapTexture("Normal Map Texture ", 2D) = "bump" {} _NormalMapWavesSpeed("Normal Map Waves Speed", Range( 0 , 1)) = 0.1 _NormalMapsWavesSize("Normal Maps Waves Size", Range( 0 , 10)) = 5 _FoamColor("Foam Color", Color) = (0.3066038,1,0.9145772,0) _FoamAmount("Foam Amount", Range( 0 , 10)) = 1.5 _FoamPower("Foam Power", Range( 0.1 , 5)) = 0.5 _FoamNoiseScale("Foam Noise Scale", Range( 0 , 1000)) = 150 //_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5 //_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1 //_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5 //_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2 //_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9 //_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1 //_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5 //_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5 //_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16 //_TessMin( "Tess Min Distance", Float ) = 10 //_TessMax( "Tess Max Distance", Float ) = 25 //_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16 //_TessMaxDisp( "Tess Max Displacement", Float ) = 25 [HideInInspector][ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1 [HideInInspector][ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1 [HideInInspector][ToggleOff] _ReceiveShadows("Receive Shadows", Float) = 1.0 [HideInInspector] _QueueOffset("_QueueOffset", Float) = 0 [HideInInspector] _QueueControl("_QueueControl", Float) = -1 [HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} [HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} [HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} //[HideInInspector][ToggleUI] _AddPrecomputedVelocity("Add Precomputed Velocity", Float) = 1 } SubShader { LOD 0 Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" "UniversalMaterialType"="Lit" } Cull Back ZWrite Off ZTest LEqual Offset 0 , 0 AlphaToMask Off HLSLINCLUDE #pragma target 4.5 #pragma prefer_hlslcc gles // ensure rendering platforms toggle list is visible #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl" #ifndef ASE_TESS_FUNCS #define ASE_TESS_FUNCS float4 FixedTess( float tessValue ) { return tessValue; } float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos ) { float3 wpos = mul(o2w,vertex).xyz; float dist = distance (wpos, cameraPos); float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess; return f; } float4 CalcTriEdgeTessFactors (float3 triVertexFactors) { float4 tess; tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z); tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z); tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y); tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f; return tess; } float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams ) { float dist = distance (0.5 * (wpos0+wpos1), cameraPos); float len = distance(wpos0, wpos1); float f = max(len * scParams.y / (edgeLen * dist), 1.0); return f; } float DistanceFromPlane (float3 pos, float4 plane) { float d = dot (float4(pos,1.0f), plane); return d; } bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] ) { float4 planeTest; planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + (( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) + (( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f ); planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + (( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) + (( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f ); planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + (( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) + (( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f ); planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + (( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) + (( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f ); return !all (planeTest); } float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos ) { float3 f; f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos); f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos); f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos); return CalcTriEdgeTessFactors (f); } float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams ) { float3 pos0 = mul(o2w,v0).xyz; float3 pos1 = mul(o2w,v1).xyz; float3 pos2 = mul(o2w,v2).xyz; float4 tess; tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); tess.w = (tess.x + tess.y + tess.z) / 3.0f; return tess; } float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] ) { float3 pos0 = mul(o2w,v0).xyz; float3 pos1 = mul(o2w,v1).xyz; float3 pos2 = mul(o2w,v2).xyz; float4 tess; if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes)) { tess = 0.0f; } else { tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams); tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams); tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams); tess.w = (tess.x + tess.y + tess.z) / 3.0f; } return tess; } #endif //ASE_TESS_FUNCS ENDHLSL Pass { Name "Forward" Tags { "LightMode"="UniversalForward" } Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha ZWrite On ZTest LEqual Offset 0 , 0 ColorMask RGBA HLSLPROGRAM #pragma multi_compile_fragment _ALPHATEST_ON #define _NORMAL_DROPOFF_TS 1 #pragma shader_feature_local _RECEIVE_SHADOWS_OFF #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION #pragma multi_compile_instancing #pragma instancing_options renderinglayer #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_fog #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #define REQUIRE_OPAQUE_TEXTURE 1 #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS #pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 #pragma multi_compile _ _LIGHT_LAYERS #pragma multi_compile_fragment _ _LIGHT_COOKIES #pragma multi_compile _ _FORWARD_PLUS #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING #pragma multi_compile _ SHADOWS_SHADOWMASK #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile _ USE_LEGACY_LIGHTMAPS #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SHADERPASS SHADERPASS_FORWARD #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #if defined(LOD_FADE_CROSSFADE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" #endif #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) #define ENABLE_TERRAIN_PERPIXEL_NORMAL #endif #define ASE_NEEDS_FRAG_SCREEN_POSITION #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45) #define ASE_SV_DEPTH SV_DepthLessEqual #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid #else #define ASE_SV_DEPTH SV_Depth #define ASE_SV_POSITION_QUALIFIERS #endif struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 tangentOS : TANGENT; float4 texcoord : TEXCOORD0; float4 texcoord1 : TEXCOORD1; float4 texcoord2 : TEXCOORD2; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION; float4 clipPosV : TEXCOORD0; float4 lightmapUVOrVertexSH : TEXCOORD1; #if defined(ASE_FOG) || defined(_ADDITIONAL_LIGHTS_VERTEX) half4 fogFactorAndVertexLight : TEXCOORD2; #endif float4 tSpace0 : TEXCOORD3; float4 tSpace1 : TEXCOORD4; float4 tSpace2 : TEXCOORD5; #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) float4 shadowCoord : TEXCOORD6; #endif #if defined(DYNAMICLIGHTMAP_ON) float2 dynamicLightmapUV : TEXCOORD7; #endif #if defined(USE_APV_PROBE_OCCLUSION) float4 probeOcclusion : TEXCOORD8; #endif float4 ase_texcoord9 : TEXCOORD9; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif sampler2D _NormalMapTexture; float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } inline float4 ASE_ComputeGrabScreenPos( float4 pos ) { #if UNITY_UV_STARTS_AT_TOP float scale = -1.0; #else float scale = 1.0; #endif float4 o = pos; o.y = pos.w * 0.5f; o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y; return o; } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } PackedVaryings VertexFunction( Attributes input ) { PackedVaryings output = (PackedVaryings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; output.ase_texcoord9.xy = input.texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord9.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; input.tangentOS = input.tangentOS; VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz ); VertexNormalInputs normalInput = GetVertexNormalInputs( input.normalOS, input.tangentOS ); output.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x ); output.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y ); output.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z ); #if defined(LIGHTMAP_ON) OUTPUT_LIGHTMAP_UV( input.texcoord1, unity_LightmapST, output.lightmapUVOrVertexSH.xy ); #endif #if defined(DYNAMICLIGHTMAP_ON) output.dynamicLightmapUV.xy = input.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; #endif OUTPUT_SH4( vertexInput.positionWS, normalInput.normalWS.xyz, GetWorldSpaceNormalizeViewDir( vertexInput.positionWS ), output.lightmapUVOrVertexSH.xyz, output.probeOcclusion ); #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) output.lightmapUVOrVertexSH.zw = input.texcoord.xy; output.lightmapUVOrVertexSH.xy = input.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw; #endif #if defined(ASE_FOG) || defined(_ADDITIONAL_LIGHTS_VERTEX) output.fogFactorAndVertexLight = 0; #if defined(ASE_FOG) && !defined(_FOG_FRAGMENT) output.fogFactorAndVertexLight.x = ComputeFogFactor(vertexInput.positionCS.z); #endif #ifdef _ADDITIONAL_LIGHTS_VERTEX half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS ); output.fogFactorAndVertexLight.yzw = vertexLight; #endif #endif #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) output.shadowCoord = GetShadowCoord( vertexInput ); #endif output.positionCS = vertexInput.positionCS; output.clipPosV = vertexInput.positionCS; return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 tangentOS : TANGENT; float4 texcoord : TEXCOORD0; float4 texcoord1 : TEXCOORD1; float4 texcoord2 : TEXCOORD2; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.tangentOS = input.tangentOS; output.texcoord = input.texcoord; output.texcoord1 = input.texcoord1; output.texcoord2 = input.texcoord2; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z; output.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif half4 frag ( PackedVaryings input #ifdef ASE_DEPTH_WRITE_ON ,out float outputDepth : ASE_SV_DEPTH #endif #ifdef _WRITE_RENDERING_LAYERS , out float4 outRenderingLayers : SV_Target1 #endif ) : SV_Target { UNITY_SETUP_INSTANCE_ID(input); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); #if defined(LOD_FADE_CROSSFADE) LODFadeCrossFade( input.positionCS ); #endif #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) float2 sampleCoords = (input.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); #else float3 WorldNormal = normalize( input.tSpace0.xyz ); float3 WorldTangent = input.tSpace1.xyz; float3 WorldBiTangent = input.tSpace2.xyz; #endif float3 WorldPosition = float3(input.tSpace0.w,input.tSpace1.w,input.tSpace2.w); float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; float4 ShadowCoords = float4( 0, 0, 0, 0 ); float4 ClipPos = input.clipPosV; float4 ScreenPos = ComputeScreenPos( input.clipPosV ); float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS); #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) ShadowCoords = input.shadowCoord; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); #endif WorldViewDirection = SafeNormalize( WorldViewDirection ); float4 ase_positionSSNorm = ScreenPos / ScreenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float screenDepth350 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth350 = abs( ( screenDepth350 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( 100.0 ) ); float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ScreenPos ); float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w; float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0)); float mulTime251 = _TimeParameters.x * 0.1; float2 temp_cast_1 = (( mulTime251 * _NormalMapWavesSpeed )).xx; float2 texCoord254 = input.ase_texcoord9.xy * appendResult405.xy + temp_cast_1; float2 temp_output_2_0_g9 = texCoord254; float2 break6_g9 = temp_output_2_0_g9; float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 ); float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y)); float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 ); float temp_output_4_0_g9 = 1.0; float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 ))); float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) ); float3 NORMALMAPWAVES243 = normalizeResult22_g9; float4 fetchOpaqueVal314 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( (ase_grabScreenPosNorm).xyzw + float4( ( NORMALMAPWAVES243 * 1.0 ) , 0.0 ) ).xy.xy ), 1.0 ); float4 FAKEREFRACTIONS415 = ( ( 1.0 - distanceDepth350 ) * fetchOpaqueVal314 ); float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float4 lerpResult86 = lerp( _ShallowColor , _DeepColor , clampResult81); float4 DeepShallowColor196 = lerpResult86; float4 lerpResult470 = lerp( FAKEREFRACTIONS415 , DeepShallowColor196 , float4( 0.6132076,0.6132076,0.6132076,0 )); float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_4 = (_FoamNoiseScale).xx; float2 temp_cast_5 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord9.xy * temp_cast_4 + temp_cast_5; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float4 FoamColor442 = ( temp_output_471_0 * _FoamColor ); float FoamMask439 = temp_output_471_0; float4 color478 = IsGammaSpace() ? float4(0.4980392,0.4980392,1,0) : float4(0.2122307,0.2122307,1,0); float layeredBlendVar477 = FoamMask439; float4 layeredBlend477 = ( lerp( float4( NORMALMAPWAVES243 , 0.0 ),color478 , layeredBlendVar477 ) ); float4 normalizeResult474 = normalize( layeredBlend477 ); float4 temp_cast_9 = (_Smootness).xxxx; float4 color484 = IsGammaSpace() ? float4(0.2264151,0.2264151,0.2264151,0) : float4(0.04193995,0.04193995,0.04193995,0); float layeredBlendVar485 = FoamMask439; float4 layeredBlend485 = ( lerp( temp_cast_9,color484 , layeredBlendVar485 ) ); float DeepShallowMask197 = clampResult81; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); float3 BaseColor = ( lerpResult470 + FoamColor442 ).rgb; float3 Normal = normalizeResult474.rgb; float3 Emission = 0; float3 Specular = 0.5; float Metallic = _Mettalic; float Smoothness = layeredBlend485.r; float Occlusion = 1; float Alpha = TRANSPARENCYFINAL267; float AlphaClipThreshold = 0.5; float AlphaClipThresholdShadow = 0.5; float3 BakedGI = 0; float3 RefractionColor = 1; float RefractionIndex = 1; float3 Transmission = 1; float3 Translucency = 1; #ifdef ASE_DEPTH_WRITE_ON float DepthValue = input.positionCS.z; #endif #ifdef _CLEARCOAT float CoatMask = 0; float CoatSmoothness = 0; #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif InputData inputData = (InputData)0; inputData.positionWS = WorldPosition; inputData.positionCS = input.positionCS; inputData.viewDirectionWS = WorldViewDirection; #ifdef _NORMALMAP #if _NORMAL_DROPOFF_TS inputData.normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent, WorldBiTangent, WorldNormal)); #elif _NORMAL_DROPOFF_OS inputData.normalWS = TransformObjectToWorldNormal(Normal); #elif _NORMAL_DROPOFF_WS inputData.normalWS = Normal; #endif inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); #else inputData.normalWS = WorldNormal; #endif #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) inputData.shadowCoord = ShadowCoords; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); #else inputData.shadowCoord = float4(0, 0, 0, 0); #endif #ifdef ASE_FOG inputData.fogCoord = InitializeInputDataFog(float4(inputData.positionWS, 1.0), input.fogFactorAndVertexLight.x); #endif #ifdef _ADDITIONAL_LIGHTS_VERTEX inputData.vertexLighting = input.fogFactorAndVertexLight.yzw; #endif #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) float3 SH = SampleSH(inputData.normalWS.xyz); #else float3 SH = input.lightmapUVOrVertexSH.xyz; #endif #if defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, input.dynamicLightmapUV.xy, SH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy); #elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) inputData.bakedGI = SAMPLE_GI( SH, GetAbsolutePositionWS(inputData.positionWS), inputData.normalWS, inputData.viewDirectionWS, input.positionCS.xy, input.probeOcclusion, inputData.shadowMask ); #else inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, SH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy); #endif #ifdef ASE_BAKEDGI inputData.bakedGI = BakedGI; #endif inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV; #if defined(DEBUG_DISPLAY) #if defined(DYNAMICLIGHTMAP_ON) inputData.dynamicLightmapUV = input.dynamicLightmapUV.xy; #endif #if defined(LIGHTMAP_ON) inputData.staticLightmapUV = input.lightmapUVOrVertexSH.xy; #else inputData.vertexSH = SH; #endif #if defined(USE_APV_PROBE_OCCLUSION) inputData.probeOcclusion = input.probeOcclusion; #endif #endif SurfaceData surfaceData; surfaceData.albedo = BaseColor; surfaceData.metallic = saturate(Metallic); surfaceData.specular = Specular; surfaceData.smoothness = saturate(Smoothness), surfaceData.occlusion = Occlusion, surfaceData.emission = Emission, surfaceData.alpha = saturate(Alpha); surfaceData.normalTS = Normal; surfaceData.clearCoatMask = 0; surfaceData.clearCoatSmoothness = 1; #ifdef _CLEARCOAT surfaceData.clearCoatMask = saturate(CoatMask); surfaceData.clearCoatSmoothness = saturate(CoatSmoothness); #endif #ifdef _DBUFFER ApplyDecalToSurfaceData(input.positionCS, surfaceData, inputData); #endif #ifdef _ASE_LIGHTING_SIMPLE half4 color = UniversalFragmentBlinnPhong( inputData, surfaceData); #else half4 color = UniversalFragmentPBR( inputData, surfaceData); #endif #ifdef ASE_TRANSMISSION { float shadow = _TransmissionShadow; #define SUM_LIGHT_TRANSMISSION(Light)\ float3 atten = Light.color * Light.distanceAttenuation;\ atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\ half3 transmission = max( 0, -dot( inputData.normalWS, Light.direction ) ) * atten * Transmission;\ color.rgb += BaseColor * transmission; SUM_LIGHT_TRANSMISSION( GetMainLight( inputData.shadowCoord ) ); #if defined(_ADDITIONAL_LIGHTS) uint meshRenderingLayers = GetMeshRenderingLayer(); uint pixelLightCount = GetAdditionalLightsCount(); #if USE_FORWARD_PLUS [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++) { FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask); #ifdef _LIGHT_LAYERS if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) #endif { SUM_LIGHT_TRANSMISSION( light ); } } #endif LIGHT_LOOP_BEGIN( pixelLightCount ) Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask); #ifdef _LIGHT_LAYERS if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) #endif { SUM_LIGHT_TRANSMISSION( light ); } LIGHT_LOOP_END #endif } #endif #ifdef ASE_TRANSLUCENCY { float shadow = _TransShadow; float normal = _TransNormal; float scattering = _TransScattering; float direct = _TransDirect; float ambient = _TransAmbient; float strength = _TransStrength; #define SUM_LIGHT_TRANSLUCENCY(Light)\ float3 atten = Light.color * Light.distanceAttenuation;\ atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\ half3 lightDir = Light.direction + inputData.normalWS * normal;\ half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering );\ half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency;\ color.rgb += BaseColor * translucency * strength; SUM_LIGHT_TRANSLUCENCY( GetMainLight( inputData.shadowCoord ) ); #if defined(_ADDITIONAL_LIGHTS) uint meshRenderingLayers = GetMeshRenderingLayer(); uint pixelLightCount = GetAdditionalLightsCount(); #if USE_FORWARD_PLUS [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++) { FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask); #ifdef _LIGHT_LAYERS if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) #endif { SUM_LIGHT_TRANSLUCENCY( light ); } } #endif LIGHT_LOOP_BEGIN( pixelLightCount ) Light light = GetAdditionalLight(lightIndex, inputData.positionWS, inputData.shadowMask); #ifdef _LIGHT_LAYERS if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) #endif { SUM_LIGHT_TRANSLUCENCY( light ); } LIGHT_LOOP_END #endif } #endif #ifdef ASE_REFRACTION float4 projScreenPos = ScreenPos / ScreenPos.w; float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) ); projScreenPos.xy += refractionOffset.xy; float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor; color.rgb = lerp( refraction, color.rgb, color.a ); color.a = 1; #endif #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY color.rgb *= color.a; #endif #ifdef ASE_FOG #ifdef TERRAIN_SPLAT_ADDPASS color.rgb = MixFogColor(color.rgb, half3(0,0,0), inputData.fogCoord); #else color.rgb = MixFog(color.rgb, inputData.fogCoord); #endif #endif #ifdef ASE_DEPTH_WRITE_ON outputDepth = DepthValue; #endif #ifdef _WRITE_RENDERING_LAYERS uint renderingLayers = GetMeshRenderingLayer(); outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 ); #endif return color; } ENDHLSL } Pass { Name "ShadowCaster" Tags { "LightMode"="ShadowCaster" } ZWrite On ZTest LEqual AlphaToMask Off ColorMask 0 HLSLPROGRAM #pragma multi_compile _ALPHATEST_ON #define _NORMAL_DROPOFF_TS 1 #pragma multi_compile_instancing #pragma multi_compile _ LOD_FADE_CROSSFADE #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SHADERPASS SHADERPASS_SHADOWCASTER #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #if defined(LOD_FADE_CROSSFADE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" #endif #define ASE_NEEDS_FRAG_SCREEN_POSITION #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45) #define ASE_SV_DEPTH SV_DepthLessEqual #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid #else #define ASE_SV_DEPTH SV_Depth #define ASE_SV_POSITION_QUALIFIERS #endif struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION; float4 clipPosV : TEXCOORD0; float3 positionWS : TEXCOORD1; #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD2; #endif float4 ase_texcoord3 : TEXCOORD3; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } float3 _LightDirection; float3 _LightPosition; PackedVaryings VertexFunction( Attributes input ) { PackedVaryings output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( output ); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; output.ase_texcoord3.xy = input.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord3.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; float3 positionWS = TransformObjectToWorld( input.positionOS.xyz ); float3 normalWS = TransformObjectToWorldDir(input.normalOS); #if _CASTING_PUNCTUAL_LIGHT_SHADOW float3 lightDirectionWS = normalize(_LightPosition - positionWS); #else float3 lightDirectionWS = _LightDirection; #endif float4 positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS)); //code for UNITY_REVERSED_Z is moved into Shadows.hlsl from 6000.0.22 and or higher positionCS = ApplyShadowClamping(positionCS); #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) VertexPositionInputs vertexInput = (VertexPositionInputs)0; vertexInput.positionWS = positionWS; vertexInput.positionCS = positionCS; output.shadowCoord = GetShadowCoord( vertexInput ); #endif output.positionCS = positionCS; output.clipPosV = positionCS; output.positionWS = positionWS; return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.ase_texcoord = input.ase_texcoord; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif half4 frag( PackedVaryings input #ifdef ASE_DEPTH_WRITE_ON ,out float outputDepth : ASE_SV_DEPTH #endif ) : SV_Target { UNITY_SETUP_INSTANCE_ID( input ); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input ); float3 WorldPosition = input.positionWS; float4 ShadowCoords = float4( 0, 0, 0, 0 ); float4 ClipPos = input.clipPosV; float4 ScreenPos = ComputeScreenPos( input.clipPosV ); #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) ShadowCoords = input.shadowCoord; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); #endif #endif float4 ase_positionSSNorm = ScreenPos / ScreenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float DeepShallowMask197 = clampResult81; float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_0 = (_FoamNoiseScale).xx; float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord3.xy * temp_cast_0 + temp_cast_1; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float FoamMask439 = temp_output_471_0; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); float Alpha = TRANSPARENCYFINAL267; float AlphaClipThreshold = 0.5; float AlphaClipThresholdShadow = 0.5; #ifdef ASE_DEPTH_WRITE_ON float DepthValue = input.positionCS.z; #endif #ifdef _ALPHATEST_ON #ifdef _ALPHATEST_SHADOW_ON clip(Alpha - AlphaClipThresholdShadow); #else clip(Alpha - AlphaClipThreshold); #endif #endif #if defined(LOD_FADE_CROSSFADE) LODFadeCrossFade( input.positionCS ); #endif #ifdef ASE_DEPTH_WRITE_ON outputDepth = DepthValue; #endif return 0; } ENDHLSL } Pass { Name "DepthOnly" Tags { "LightMode"="DepthOnly" } ZWrite On ColorMask R AlphaToMask Off HLSLPROGRAM #pragma multi_compile _ALPHATEST_ON #define _NORMAL_DROPOFF_TS 1 #pragma multi_compile_instancing #pragma multi_compile _ LOD_FADE_CROSSFADE #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SHADERPASS SHADERPASS_DEPTHONLY #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #if defined(LOD_FADE_CROSSFADE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" #endif #define ASE_NEEDS_FRAG_SCREEN_POSITION #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45) #define ASE_SV_DEPTH SV_DepthLessEqual #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid #else #define ASE_SV_DEPTH SV_Depth #define ASE_SV_POSITION_QUALIFIERS #endif struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION; float4 clipPosV : TEXCOORD0; float3 positionWS : TEXCOORD1; #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD2; #endif float4 ase_texcoord3 : TEXCOORD3; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } PackedVaryings VertexFunction( Attributes input ) { PackedVaryings output = (PackedVaryings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; output.ase_texcoord3.xy = input.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord3.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz ); #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) output.shadowCoord = GetShadowCoord( vertexInput ); #endif output.positionCS = vertexInput.positionCS; output.clipPosV = vertexInput.positionCS; output.positionWS = vertexInput.positionWS; return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.ase_texcoord = input.ase_texcoord; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif half4 frag( PackedVaryings input #ifdef ASE_DEPTH_WRITE_ON ,out float outputDepth : ASE_SV_DEPTH #endif ) : SV_Target { UNITY_SETUP_INSTANCE_ID(input); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input ); float3 WorldPosition = input.positionWS; float4 ShadowCoords = float4( 0, 0, 0, 0 ); float4 ClipPos = input.clipPosV; float4 ScreenPos = ComputeScreenPos( input.clipPosV ); #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) ShadowCoords = input.shadowCoord; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); #endif #endif float4 ase_positionSSNorm = ScreenPos / ScreenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float DeepShallowMask197 = clampResult81; float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_0 = (_FoamNoiseScale).xx; float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord3.xy * temp_cast_0 + temp_cast_1; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float FoamMask439 = temp_output_471_0; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); float Alpha = TRANSPARENCYFINAL267; float AlphaClipThreshold = 0.5; #ifdef ASE_DEPTH_WRITE_ON float DepthValue = input.positionCS.z; #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif #if defined(LOD_FADE_CROSSFADE) LODFadeCrossFade( input.positionCS ); #endif #ifdef ASE_DEPTH_WRITE_ON outputDepth = DepthValue; #endif return 0; } ENDHLSL } Pass { Name "Meta" Tags { "LightMode"="Meta" } Cull Off HLSLPROGRAM #pragma multi_compile_fragment _ALPHATEST_ON #define _NORMAL_DROPOFF_TS 1 #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #define REQUIRE_OPAQUE_TEXTURE 1 #pragma shader_feature EDITOR_VISUALIZATION #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SHADERPASS SHADERPASS_META #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 texcoord0 : TEXCOORD0; float4 texcoord1 : TEXCOORD1; float4 texcoord2 : TEXCOORD2; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { float4 positionCS : SV_POSITION; #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 positionWS : TEXCOORD0; #endif #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD1; #endif #ifdef EDITOR_VISUALIZATION float4 VizUV : TEXCOORD2; float4 LightCoord : TEXCOORD3; #endif float4 ase_texcoord4 : TEXCOORD4; float4 ase_texcoord5 : TEXCOORD5; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif sampler2D _NormalMapTexture; float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } inline float4 ASE_ComputeGrabScreenPos( float4 pos ) { #if UNITY_UV_STARTS_AT_TOP float scale = -1.0; #else float scale = 1.0; #endif float4 o = pos; o.y = pos.w * 0.5f; o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y; return o; } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } PackedVaryings VertexFunction( Attributes input ) { PackedVaryings output = (PackedVaryings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz); float4 screenPos = ComputeScreenPos(ase_positionCS); output.ase_texcoord4 = screenPos; output.ase_texcoord5.xy = input.texcoord0.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord5.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; float3 positionWS = TransformObjectToWorld( input.positionOS.xyz ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) output.positionWS = positionWS; #endif output.positionCS = MetaVertexPosition( input.positionOS, input.texcoord1.xy, input.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST ); #ifdef EDITOR_VISUALIZATION float2 VizUV = 0; float4 LightCoord = 0; UnityEditorVizData(input.positionOS.xyz, input.texcoord0.xy, input.texcoord1.xy, input.texcoord2.xy, VizUV, LightCoord); output.VizUV = float4(VizUV, 0, 0); output.LightCoord = LightCoord; #endif #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) VertexPositionInputs vertexInput = (VertexPositionInputs)0; vertexInput.positionWS = positionWS; vertexInput.positionCS = output.positionCS; output.shadowCoord = GetShadowCoord( vertexInput ); #endif return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 texcoord0 : TEXCOORD0; float4 texcoord1 : TEXCOORD1; float4 texcoord2 : TEXCOORD2; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.texcoord0 = input.texcoord0; output.texcoord1 = input.texcoord1; output.texcoord2 = input.texcoord2; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z; output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif half4 frag(PackedVaryings input ) : SV_Target { UNITY_SETUP_INSTANCE_ID(input); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 WorldPosition = input.positionWS; #endif float4 ShadowCoords = float4( 0, 0, 0, 0 ); #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) ShadowCoords = input.shadowCoord; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); #endif #endif float4 screenPos = input.ase_texcoord4; float4 ase_positionSSNorm = screenPos / screenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float screenDepth350 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth350 = abs( ( screenDepth350 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( 100.0 ) ); float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos ); float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w; float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0)); float mulTime251 = _TimeParameters.x * 0.1; float2 temp_cast_1 = (( mulTime251 * _NormalMapWavesSpeed )).xx; float2 texCoord254 = input.ase_texcoord5.xy * appendResult405.xy + temp_cast_1; float2 temp_output_2_0_g9 = texCoord254; float2 break6_g9 = temp_output_2_0_g9; float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 ); float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y)); float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 ); float temp_output_4_0_g9 = 1.0; float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 ))); float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) ); float3 NORMALMAPWAVES243 = normalizeResult22_g9; float4 fetchOpaqueVal314 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( (ase_grabScreenPosNorm).xyzw + float4( ( NORMALMAPWAVES243 * 1.0 ) , 0.0 ) ).xy.xy ), 1.0 ); float4 FAKEREFRACTIONS415 = ( ( 1.0 - distanceDepth350 ) * fetchOpaqueVal314 ); float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float4 lerpResult86 = lerp( _ShallowColor , _DeepColor , clampResult81); float4 DeepShallowColor196 = lerpResult86; float4 lerpResult470 = lerp( FAKEREFRACTIONS415 , DeepShallowColor196 , float4( 0.6132076,0.6132076,0.6132076,0 )); float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_4 = (_FoamNoiseScale).xx; float2 temp_cast_5 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord5.xy * temp_cast_4 + temp_cast_5; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float4 FoamColor442 = ( temp_output_471_0 * _FoamColor ); float DeepShallowMask197 = clampResult81; float FoamMask439 = temp_output_471_0; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); float3 BaseColor = ( lerpResult470 + FoamColor442 ).rgb; float3 Emission = 0; float Alpha = TRANSPARENCYFINAL267; float AlphaClipThreshold = 0.5; #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif MetaInput metaInput = (MetaInput)0; metaInput.Albedo = BaseColor; metaInput.Emission = Emission; #ifdef EDITOR_VISUALIZATION metaInput.VizUV = input.VizUV.xy; metaInput.LightCoord = input.LightCoord; #endif return UnityMetaFragment(metaInput); } ENDHLSL } Pass { Name "Universal2D" Tags { "LightMode"="Universal2D" } Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha ZWrite On ZTest LEqual Offset 0 , 0 ColorMask RGBA HLSLPROGRAM #pragma multi_compile_fragment _ALPHATEST_ON #define _NORMAL_DROPOFF_TS 1 #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #define REQUIRE_OPAQUE_TEXTURE 1 #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SHADERPASS SHADERPASS_2D #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { float4 positionCS : SV_POSITION; #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 positionWS : TEXCOORD0; #endif #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD1; #endif float4 ase_texcoord2 : TEXCOORD2; float4 ase_texcoord3 : TEXCOORD3; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif sampler2D _NormalMapTexture; float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } inline float4 ASE_ComputeGrabScreenPos( float4 pos ) { #if UNITY_UV_STARTS_AT_TOP float scale = -1.0; #else float scale = 1.0; #endif float4 o = pos; o.y = pos.w * 0.5f; o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y; return o; } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } PackedVaryings VertexFunction( Attributes input ) { PackedVaryings output = (PackedVaryings)0; UNITY_SETUP_INSTANCE_ID( input ); UNITY_TRANSFER_INSTANCE_ID( input, output ); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( output ); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz); float4 screenPos = ComputeScreenPos(ase_positionCS); output.ase_texcoord2 = screenPos; output.ase_texcoord3.xy = input.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord3.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) output.positionWS = vertexInput.positionWS; #endif #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) output.shadowCoord = GetShadowCoord( vertexInput ); #endif output.positionCS = vertexInput.positionCS; return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.ase_texcoord = input.ase_texcoord; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif half4 frag(PackedVaryings input ) : SV_Target { UNITY_SETUP_INSTANCE_ID( input ); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input ); #if defined(ASE_NEEDS_FRAG_WORLD_POSITION) float3 WorldPosition = input.positionWS; #endif float4 ShadowCoords = float4( 0, 0, 0, 0 ); #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) ShadowCoords = input.shadowCoord; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); #endif #endif float4 screenPos = input.ase_texcoord2; float4 ase_positionSSNorm = screenPos / screenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float screenDepth350 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth350 = abs( ( screenDepth350 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( 100.0 ) ); float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos ); float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w; float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0)); float mulTime251 = _TimeParameters.x * 0.1; float2 temp_cast_1 = (( mulTime251 * _NormalMapWavesSpeed )).xx; float2 texCoord254 = input.ase_texcoord3.xy * appendResult405.xy + temp_cast_1; float2 temp_output_2_0_g9 = texCoord254; float2 break6_g9 = temp_output_2_0_g9; float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 ); float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y)); float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 ); float temp_output_4_0_g9 = 1.0; float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 ))); float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) ); float3 NORMALMAPWAVES243 = normalizeResult22_g9; float4 fetchOpaqueVal314 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( (ase_grabScreenPosNorm).xyzw + float4( ( NORMALMAPWAVES243 * 1.0 ) , 0.0 ) ).xy.xy ), 1.0 ); float4 FAKEREFRACTIONS415 = ( ( 1.0 - distanceDepth350 ) * fetchOpaqueVal314 ); float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float4 lerpResult86 = lerp( _ShallowColor , _DeepColor , clampResult81); float4 DeepShallowColor196 = lerpResult86; float4 lerpResult470 = lerp( FAKEREFRACTIONS415 , DeepShallowColor196 , float4( 0.6132076,0.6132076,0.6132076,0 )); float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_4 = (_FoamNoiseScale).xx; float2 temp_cast_5 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord3.xy * temp_cast_4 + temp_cast_5; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float4 FoamColor442 = ( temp_output_471_0 * _FoamColor ); float DeepShallowMask197 = clampResult81; float FoamMask439 = temp_output_471_0; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); float3 BaseColor = ( lerpResult470 + FoamColor442 ).rgb; float Alpha = TRANSPARENCYFINAL267; float AlphaClipThreshold = 0.5; half4 color = half4(BaseColor, Alpha ); #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif return color; } ENDHLSL } Pass { Name "DepthNormals" Tags { "LightMode"="DepthNormals" } ZWrite On Blend One Zero ZTest LEqual ZWrite On HLSLPROGRAM #pragma multi_compile _ALPHATEST_ON #define _NORMAL_DROPOFF_TS 1 #pragma multi_compile_instancing #pragma multi_compile _ LOD_FADE_CROSSFADE #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY //#define SHADERPASS SHADERPASS_DEPTHNORMALS #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #if defined(LOD_FADE_CROSSFADE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" #endif #define ASE_NEEDS_FRAG_SCREEN_POSITION #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45) #define ASE_SV_DEPTH SV_DepthLessEqual #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid #else #define ASE_SV_DEPTH SV_Depth #define ASE_SV_POSITION_QUALIFIERS #endif struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 tangentOS : TANGENT; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION; float4 clipPosV : TEXCOORD0; float3 positionWS : TEXCOORD1; float3 normalWS : TEXCOORD2; float4 tangentWS : TEXCOORD3; #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) float4 shadowCoord : TEXCOORD4; #endif float4 ase_texcoord5 : TEXCOORD5; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif sampler2D _NormalMapTexture; float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } PackedVaryings VertexFunction( Attributes input ) { PackedVaryings output = (PackedVaryings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; output.ase_texcoord5.xy = input.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord5.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; input.tangentOS = input.tangentOS; VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz ); float3 normalWS = TransformObjectToWorldNormal( input.normalOS ); float4 tangentWS = float4( TransformObjectToWorldDir( input.tangentOS.xyz ), input.tangentOS.w ); #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS) output.shadowCoord = GetShadowCoord( vertexInput ); #endif output.positionCS = vertexInput.positionCS; output.clipPosV = vertexInput.positionCS; output.positionWS = vertexInput.positionWS; output.normalWS = normalWS; output.tangentWS = tangentWS; return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 tangentOS : TANGENT; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.tangentOS = input.tangentOS; output.ase_texcoord = input.ase_texcoord; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z; output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif void frag( PackedVaryings input , out half4 outNormalWS : SV_Target0 #ifdef ASE_DEPTH_WRITE_ON ,out float outputDepth : ASE_SV_DEPTH #endif #ifdef _WRITE_RENDERING_LAYERS , out float4 outRenderingLayers : SV_Target1 #endif ) { UNITY_SETUP_INSTANCE_ID(input); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input ); float4 ShadowCoords = float4( 0, 0, 0, 0 ); float3 WorldNormal = input.normalWS; float4 WorldTangent = input.tangentWS; float3 WorldPosition = input.positionWS; float4 ClipPos = input.clipPosV; float4 ScreenPos = ComputeScreenPos( input.clipPosV ); #if defined(ASE_NEEDS_FRAG_SHADOWCOORDS) #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) ShadowCoords = input.shadowCoord; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); #endif #endif float4 ase_positionSSNorm = ScreenPos / ScreenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_0 = (_FoamNoiseScale).xx; float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord5.xy * temp_cast_0 + temp_cast_1; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float FoamMask439 = temp_output_471_0; float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0)); float mulTime251 = _TimeParameters.x * 0.1; float2 temp_cast_3 = (( mulTime251 * _NormalMapWavesSpeed )).xx; float2 texCoord254 = input.ase_texcoord5.xy * appendResult405.xy + temp_cast_3; float2 temp_output_2_0_g9 = texCoord254; float2 break6_g9 = temp_output_2_0_g9; float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 ); float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y)); float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 ); float temp_output_4_0_g9 = 1.0; float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 ))); float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) ); float3 NORMALMAPWAVES243 = normalizeResult22_g9; float4 color478 = IsGammaSpace() ? float4(0.4980392,0.4980392,1,0) : float4(0.2122307,0.2122307,1,0); float layeredBlendVar477 = FoamMask439; float4 layeredBlend477 = ( lerp( float4( NORMALMAPWAVES243 , 0.0 ),color478 , layeredBlendVar477 ) ); float4 normalizeResult474 = normalize( layeredBlend477 ); float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float DeepShallowMask197 = clampResult81; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); float3 Normal = normalizeResult474.rgb; float Alpha = TRANSPARENCYFINAL267; float AlphaClipThreshold = 0.5; #ifdef ASE_DEPTH_WRITE_ON float DepthValue = input.positionCS.z; #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif #if defined(LOD_FADE_CROSSFADE) LODFadeCrossFade( input.positionCS ); #endif #ifdef ASE_DEPTH_WRITE_ON outputDepth = DepthValue; #endif #if defined(_GBUFFER_NORMALS_OCT) float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal); float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); outNormalWS = half4(packedNormalWS, 0.0); #else #if defined(_NORMALMAP) #if _NORMAL_DROPOFF_TS float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale(); float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz); float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz)); #elif _NORMAL_DROPOFF_OS float3 normalWS = TransformObjectToWorldNormal(Normal); #elif _NORMAL_DROPOFF_WS float3 normalWS = Normal; #endif #else float3 normalWS = WorldNormal; #endif outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0); #endif #ifdef _WRITE_RENDERING_LAYERS uint renderingLayers = GetMeshRenderingLayer(); outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0); #endif } ENDHLSL } Pass { Name "GBuffer" Tags { "LightMode"="UniversalGBuffer" } Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha ZWrite On ZTest LEqual Offset 0 , 0 ColorMask RGBA HLSLPROGRAM #pragma multi_compile_fragment _ALPHATEST_ON #define _NORMAL_DROPOFF_TS 1 #pragma shader_feature_local _RECEIVE_SHADOWS_OFF #pragma multi_compile_instancing #pragma instancing_options renderinglayer #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile_fog #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #define REQUIRE_OPAQUE_TEXTURE 1 #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE #pragma multi_compile _ SHADOWS_SHADOWMASK #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ USE_LEGACY_LIGHTMAPS #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SHADERPASS SHADERPASS_GBUFFER #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #if defined(LOD_FADE_CROSSFADE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" #endif #if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL) #define ENABLE_TERRAIN_PERPIXEL_NORMAL #endif #define ASE_NEEDS_FRAG_SCREEN_POSITION #if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45) #define ASE_SV_DEPTH SV_DepthLessEqual #define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid #else #define ASE_SV_DEPTH SV_Depth #define ASE_SV_POSITION_QUALIFIERS #endif struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 tangentOS : TANGENT; float4 texcoord : TEXCOORD0; float4 texcoord1 : TEXCOORD1; float4 texcoord2 : TEXCOORD2; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION; float4 clipPosV : TEXCOORD0; float4 lightmapUVOrVertexSH : TEXCOORD1; #if defined(ASE_FOG) || defined(_ADDITIONAL_LIGHTS_VERTEX) half4 fogFactorAndVertexLight : TEXCOORD2; #endif float4 tSpace0 : TEXCOORD3; float4 tSpace1 : TEXCOORD4; float4 tSpace2 : TEXCOORD5; #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) float4 shadowCoord : TEXCOORD6; #endif #if defined(DYNAMICLIGHTMAP_ON) float2 dynamicLightmapUV : TEXCOORD7; #endif #if defined(USE_APV_PROBE_OCCLUSION) float4 probeOcclusion : TEXCOORD8; #endif float4 ase_texcoord9 : TEXCOORD9; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif sampler2D _NormalMapTexture; #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } inline float4 ASE_ComputeGrabScreenPos( float4 pos ) { #if UNITY_UV_STARTS_AT_TOP float scale = -1.0; #else float scale = 1.0; #endif float4 o = pos; o.y = pos.w * 0.5f; o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y; return o; } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } PackedVaryings VertexFunction( Attributes input ) { PackedVaryings output = (PackedVaryings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; output.ase_texcoord9.xy = input.texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord9.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; input.tangentOS = input.tangentOS; VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz ); VertexNormalInputs normalInput = GetVertexNormalInputs( input.normalOS, input.tangentOS ); output.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x); output.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y); output.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z); #if defined(LIGHTMAP_ON) OUTPUT_LIGHTMAP_UV(input.texcoord1, unity_LightmapST, output.lightmapUVOrVertexSH.xy); #endif #if defined(DYNAMICLIGHTMAP_ON) output.dynamicLightmapUV.xy = input.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; #endif OUTPUT_SH4( vertexInput.positionWS, normalInput.normalWS.xyz, GetWorldSpaceNormalizeViewDir( vertexInput.positionWS ), output.lightmapUVOrVertexSH.xyz, output.probeOcclusion ); #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) output.lightmapUVOrVertexSH.zw = input.texcoord.xy; output.lightmapUVOrVertexSH.xy = input.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw; #endif #if defined(ASE_FOG) || defined(_ADDITIONAL_LIGHTS_VERTEX) output.fogFactorAndVertexLight = 0; #if defined(ASE_FOG) && !defined(_FOG_FRAGMENT) // @diogo: no fog applied in GBuffer #endif #ifdef _ADDITIONAL_LIGHTS_VERTEX half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS ); output.fogFactorAndVertexLight.yzw = vertexLight; #endif #endif #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) output.shadowCoord = GetShadowCoord( vertexInput ); #endif output.positionCS = vertexInput.positionCS; output.clipPosV = vertexInput.positionCS; return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 tangentOS : TANGENT; float4 texcoord : TEXCOORD0; float4 texcoord1 : TEXCOORD1; float4 texcoord2 : TEXCOORD2; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.tangentOS = input.tangentOS; output.texcoord = input.texcoord; output.texcoord1 = input.texcoord1; output.texcoord2 = input.texcoord2; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z; output.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z; output.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z; output.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif FragmentOutput frag ( PackedVaryings input #ifdef ASE_DEPTH_WRITE_ON ,out float outputDepth : ASE_SV_DEPTH #endif ) { UNITY_SETUP_INSTANCE_ID(input); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); #if defined(LOD_FADE_CROSSFADE) LODFadeCrossFade( input.positionCS ); #endif #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) float2 sampleCoords = (input.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy; float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1)); float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal); float3 WorldBiTangent = cross(WorldNormal, -WorldTangent); #else float3 WorldNormal = normalize( input.tSpace0.xyz ); float3 WorldTangent = input.tSpace1.xyz; float3 WorldBiTangent = input.tSpace2.xyz; #endif float3 WorldPosition = float3(input.tSpace0.w,input.tSpace1.w,input.tSpace2.w); float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition; float4 ShadowCoords = float4( 0, 0, 0, 0 ); float4 ClipPos = input.clipPosV; float4 ScreenPos = ComputeScreenPos( input.clipPosV ); float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS); #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) ShadowCoords = input.shadowCoord; #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) ShadowCoords = TransformWorldToShadowCoord( WorldPosition ); #else ShadowCoords = float4(0, 0, 0, 0); #endif WorldViewDirection = SafeNormalize( WorldViewDirection ); float4 ase_positionSSNorm = ScreenPos / ScreenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float screenDepth350 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth350 = abs( ( screenDepth350 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( 100.0 ) ); float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( ScreenPos ); float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w; float4 appendResult405 = (float4(_NormalMapsWavesSize , _NormalMapsWavesSize , 0.0 , 0.0)); float mulTime251 = _TimeParameters.x * 0.1; float2 temp_cast_1 = (( mulTime251 * _NormalMapWavesSpeed )).xx; float2 texCoord254 = input.ase_texcoord9.xy * appendResult405.xy + temp_cast_1; float2 temp_output_2_0_g9 = texCoord254; float2 break6_g9 = temp_output_2_0_g9; float temp_output_25_0_g9 = ( pow( 0.5 , 3.0 ) * 0.1 ); float2 appendResult8_g9 = (float2(( break6_g9.x + temp_output_25_0_g9 ) , break6_g9.y)); float4 tex2DNode14_g9 = tex2D( _NormalMapTexture, temp_output_2_0_g9 ); float temp_output_4_0_g9 = 1.0; float3 appendResult13_g9 = (float3(1.0 , 0.0 , ( ( tex2D( _NormalMapTexture, appendResult8_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float2 appendResult9_g9 = (float2(break6_g9.x , ( break6_g9.y + temp_output_25_0_g9 ))); float3 appendResult16_g9 = (float3(0.0 , 1.0 , ( ( tex2D( _NormalMapTexture, appendResult9_g9 ).g - tex2DNode14_g9.g ) * temp_output_4_0_g9 ))); float3 normalizeResult22_g9 = normalize( cross( appendResult13_g9 , appendResult16_g9 ) ); float3 NORMALMAPWAVES243 = normalizeResult22_g9; float4 fetchOpaqueVal314 = float4( SHADERGRAPH_SAMPLE_SCENE_COLOR( ( (ase_grabScreenPosNorm).xyzw + float4( ( NORMALMAPWAVES243 * 1.0 ) , 0.0 ) ).xy.xy ), 1.0 ); float4 FAKEREFRACTIONS415 = ( ( 1.0 - distanceDepth350 ) * fetchOpaqueVal314 ); float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( ScreenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float4 lerpResult86 = lerp( _ShallowColor , _DeepColor , clampResult81); float4 DeepShallowColor196 = lerpResult86; float4 lerpResult470 = lerp( FAKEREFRACTIONS415 , DeepShallowColor196 , float4( 0.6132076,0.6132076,0.6132076,0 )); float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_4 = (_FoamNoiseScale).xx; float2 temp_cast_5 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord9.xy * temp_cast_4 + temp_cast_5; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float4 FoamColor442 = ( temp_output_471_0 * _FoamColor ); float FoamMask439 = temp_output_471_0; float4 color478 = IsGammaSpace() ? float4(0.4980392,0.4980392,1,0) : float4(0.2122307,0.2122307,1,0); float layeredBlendVar477 = FoamMask439; float4 layeredBlend477 = ( lerp( float4( NORMALMAPWAVES243 , 0.0 ),color478 , layeredBlendVar477 ) ); float4 normalizeResult474 = normalize( layeredBlend477 ); float4 temp_cast_9 = (_Smootness).xxxx; float4 color484 = IsGammaSpace() ? float4(0.2264151,0.2264151,0.2264151,0) : float4(0.04193995,0.04193995,0.04193995,0); float layeredBlendVar485 = FoamMask439; float4 layeredBlend485 = ( lerp( temp_cast_9,color484 , layeredBlendVar485 ) ); float DeepShallowMask197 = clampResult81; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); float3 BaseColor = ( lerpResult470 + FoamColor442 ).rgb; float3 Normal = normalizeResult474.rgb; float3 Emission = 0; float3 Specular = 0.5; float Metallic = _Mettalic; float Smoothness = layeredBlend485.r; float Occlusion = 1; float Alpha = TRANSPARENCYFINAL267; float AlphaClipThreshold = 0.5; float AlphaClipThresholdShadow = 0.5; float3 BakedGI = 0; float3 RefractionColor = 1; float RefractionIndex = 1; float3 Transmission = 1; float3 Translucency = 1; #ifdef ASE_DEPTH_WRITE_ON float DepthValue = input.positionCS.z; #endif #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif InputData inputData = (InputData)0; inputData.positionWS = WorldPosition; inputData.positionCS = input.positionCS; inputData.shadowCoord = ShadowCoords; #ifdef _NORMALMAP #if _NORMAL_DROPOFF_TS inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal )); #elif _NORMAL_DROPOFF_OS inputData.normalWS = TransformObjectToWorldNormal(Normal); #elif _NORMAL_DROPOFF_WS inputData.normalWS = Normal; #endif #else inputData.normalWS = WorldNormal; #endif inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS); inputData.viewDirectionWS = SafeNormalize( WorldViewDirection ); #ifdef ASE_FOG // @diogo: no fog applied in GBuffer #endif #ifdef _ADDITIONAL_LIGHTS_VERTEX inputData.vertexLighting = input.fogFactorAndVertexLight.yzw; #endif #if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL) float3 SH = SampleSH(inputData.normalWS.xyz); #else float3 SH = input.lightmapUVOrVertexSH.xyz; #endif #if defined(DYNAMICLIGHTMAP_ON) inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, input.dynamicLightmapUV.xy, SH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy); #elif !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) inputData.bakedGI = SAMPLE_GI( SH, GetAbsolutePositionWS(inputData.positionWS), inputData.normalWS, inputData.viewDirectionWS, input.positionCS.xy, input.probeOcclusion, inputData.shadowMask ); #else inputData.bakedGI = SAMPLE_GI(input.lightmapUVOrVertexSH.xy, SH, inputData.normalWS); inputData.shadowMask = SAMPLE_SHADOWMASK(input.lightmapUVOrVertexSH.xy); #endif #ifdef ASE_BAKEDGI inputData.bakedGI = BakedGI; #endif inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV; #if defined(DEBUG_DISPLAY) #if defined(DYNAMICLIGHTMAP_ON) inputData.dynamicLightmapUV = input.dynamicLightmapUV.xy; #endif #if defined(LIGHTMAP_ON) inputData.staticLightmapUV = input.lightmapUVOrVertexSH.xy; #else inputData.vertexSH = SH; #endif #if defined(USE_APV_PROBE_OCCLUSION) inputData.probeOcclusion = input.probeOcclusion; #endif #endif #ifdef _DBUFFER ApplyDecal(input.positionCS, BaseColor, Specular, inputData.normalWS, Metallic, Occlusion, Smoothness); #endif BRDFData brdfData; InitializeBRDFData (BaseColor, Metallic, Specular, Smoothness, Alpha, brdfData); Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); half4 color; MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); color.a = Alpha; #ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY color.rgb *= color.a; #endif #ifdef ASE_DEPTH_WRITE_ON outputDepth = DepthValue; #endif return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb, Occlusion); } ENDHLSL } Pass { Name "SceneSelectionPass" Tags { "LightMode"="SceneSelectionPass" } Cull Off AlphaToMask Off HLSLPROGRAM #define _NORMAL_DROPOFF_TS 1 #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SCENESELECTIONPASS 1 #define ATTRIBUTES_NEED_NORMAL #define ATTRIBUTES_NEED_TANGENT #define SHADERPASS SHADERPASS_DEPTHONLY #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { float4 positionCS : SV_POSITION; float4 ase_texcoord : TEXCOORD0; float4 ase_texcoord1 : TEXCOORD1; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } struct SurfaceDescription { float Alpha; float AlphaClipThreshold; }; PackedVaryings VertexFunction(Attributes input ) { PackedVaryings output; ZERO_INITIALIZE(PackedVaryings, output); UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz); float4 screenPos = ComputeScreenPos(ase_positionCS); output.ase_texcoord = screenPos; output.ase_texcoord1.xy = input.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord1.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; float3 positionWS = TransformObjectToWorld( input.positionOS.xyz ); output.positionCS = TransformWorldToHClip(positionWS); return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.ase_texcoord = input.ase_texcoord; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif half4 frag(PackedVaryings input ) : SV_Target { SurfaceDescription surfaceDescription = (SurfaceDescription)0; float4 screenPos = input.ase_texcoord; float4 ase_positionSSNorm = screenPos / screenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float DeepShallowMask197 = clampResult81; float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_0 = (_FoamNoiseScale).xx; float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord1.xy * temp_cast_0 + temp_cast_1; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float FoamMask439 = temp_output_471_0; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); surfaceDescription.Alpha = TRANSPARENCYFINAL267; surfaceDescription.AlphaClipThreshold = 0.5; #if _ALPHATEST_ON float alphaClipThreshold = 0.01f; #if ALPHA_CLIP_THRESHOLD alphaClipThreshold = surfaceDescription.AlphaClipThreshold; #endif clip(surfaceDescription.Alpha - alphaClipThreshold); #endif half4 outColor = 0; #ifdef SCENESELECTIONPASS outColor = half4(_ObjectId, _PassValue, 1.0, 1.0); #elif defined(SCENEPICKINGPASS) outColor = _SelectionID; #endif return outColor; } ENDHLSL } Pass { Name "ScenePickingPass" Tags { "LightMode"="Picking" } AlphaToMask Off HLSLPROGRAM #define _NORMAL_DROPOFF_TS 1 #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SCENEPICKINGPASS 1 #define ATTRIBUTES_NEED_NORMAL #define ATTRIBUTES_NEED_TANGENT #define SHADERPASS SHADERPASS_DEPTHONLY #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { float4 positionCS : SV_POSITION; float4 ase_texcoord : TEXCOORD0; float4 ase_texcoord1 : TEXCOORD1; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } struct SurfaceDescription { float Alpha; float AlphaClipThreshold; }; PackedVaryings VertexFunction(Attributes input ) { PackedVaryings output; ZERO_INITIALIZE(PackedVaryings, output); UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz); float4 screenPos = ComputeScreenPos(ase_positionCS); output.ase_texcoord = screenPos; output.ase_texcoord1.xy = input.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord1.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif input.normalOS = input.normalOS; float3 positionWS = TransformObjectToWorld( input.positionOS.xyz ); output.positionCS = TransformWorldToHClip(positionWS); return output; } #if defined(ASE_TESSELLATION) struct VertexControl { float4 positionOS : INTERNALTESSPOS; float3 normalOS : NORMAL; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct TessellationFactors { float edge[3] : SV_TessFactor; float inside : SV_InsideTessFactor; }; VertexControl vert ( Attributes input ) { VertexControl output; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); output.positionOS = input.positionOS; output.normalOS = input.normalOS; output.ase_texcoord = input.ase_texcoord; return output; } TessellationFactors TessellationFunction (InputPatch input) { TessellationFactors output; float4 tf = 1; float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax; float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp; #if defined(ASE_FIXED_TESSELLATION) tf = FixedTess( tessValue ); #elif defined(ASE_DISTANCE_TESSELLATION) tf = DistanceBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos ); #elif defined(ASE_LENGTH_TESSELLATION) tf = EdgeLengthBasedTess(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams ); #elif defined(ASE_LENGTH_CULL_TESSELLATION) tf = EdgeLengthBasedTessCull(input[0].positionOS, input[1].positionOS, input[2].positionOS, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes ); #endif output.edge[0] = tf.x; output.edge[1] = tf.y; output.edge[2] = tf.z; output.inside = tf.w; return output; } [domain("tri")] [partitioning("fractional_odd")] [outputtopology("triangle_cw")] [patchconstantfunc("TessellationFunction")] [outputcontrolpoints(3)] VertexControl HullFunction(InputPatch patch, uint id : SV_OutputControlPointID) { return patch[id]; } [domain("tri")] PackedVaryings DomainFunction(TessellationFactors factors, OutputPatch patch, float3 bary : SV_DomainLocation) { Attributes output = (Attributes) 0; output.positionOS = patch[0].positionOS * bary.x + patch[1].positionOS * bary.y + patch[2].positionOS * bary.z; output.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z; output.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z; #if defined(ASE_PHONG_TESSELLATION) float3 pp[3]; for (int i = 0; i < 3; ++i) pp[i] = output.positionOS.xyz - patch[i].normalOS * (dot(output.positionOS.xyz, patch[i].normalOS) - dot(patch[i].positionOS.xyz, patch[i].normalOS)); float phongStrength = _TessPhongStrength; output.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * output.positionOS.xyz; #endif UNITY_TRANSFER_INSTANCE_ID(patch[0], output); return VertexFunction(output); } #else PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } #endif half4 frag(PackedVaryings input ) : SV_Target { SurfaceDescription surfaceDescription = (SurfaceDescription)0; float4 screenPos = input.ase_texcoord; float4 ase_positionSSNorm = screenPos / screenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float DeepShallowMask197 = clampResult81; float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_0 = (_FoamNoiseScale).xx; float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord1.xy * temp_cast_0 + temp_cast_1; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float FoamMask439 = temp_output_471_0; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); surfaceDescription.Alpha = TRANSPARENCYFINAL267; surfaceDescription.AlphaClipThreshold = 0.5; #if _ALPHATEST_ON float alphaClipThreshold = 0.01f; #if ALPHA_CLIP_THRESHOLD alphaClipThreshold = surfaceDescription.AlphaClipThreshold; #endif clip(surfaceDescription.Alpha - alphaClipThreshold); #endif half4 outColor = 0; #ifdef SCENESELECTIONPASS outColor = half4(_ObjectId, _PassValue, 1.0, 1.0); #elif defined(SCENEPICKINGPASS) outColor = _SelectionID; #endif return outColor; } ENDHLSL } Pass { Name "MotionVectors" Tags { "LightMode"="MotionVectors" } ColorMask RG HLSLPROGRAM #pragma multi_compile _ALPHATEST_ON #define _NORMAL_DROPOFF_TS 1 #pragma multi_compile_instancing #pragma multi_compile _ LOD_FADE_CROSSFADE #define ASE_FOG 1 #define _SURFACE_TYPE_TRANSPARENT 1 #define _NORMALMAP 1 #define ASE_VERSION 19800 #define ASE_SRP_VERSION 170003 #define REQUIRE_DEPTH_TEXTURE 1 #pragma vertex vert #pragma fragment frag #if defined(_SPECULAR_SETUP) && defined(_ASE_LIGHTING_SIMPLE) #define _SPECULAR_COLOR 1 #endif #define SHADERPASS SHADERPASS_MOTION_VECTORS #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" #if defined(LOD_FADE_CROSSFADE) #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" #endif #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MotionVectorsCommon.hlsl" struct Attributes { float4 positionOS : POSITION; float3 positionOld : TEXCOORD4; #if _ADD_PRECOMPUTED_VELOCITY float3 alembicMotionVector : TEXCOORD5; #endif float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct PackedVaryings { float4 positionCS : SV_POSITION; float4 positionCSNoJitter : TEXCOORD0; float4 previousPositionCSNoJitter : TEXCOORD1; float4 ase_texcoord2 : TEXCOORD2; float4 ase_texcoord3 : TEXCOORD3; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; CBUFFER_START(UnityPerMaterial) float4 _ShallowColor; float4 _DeepColor; float4 _FoamColor; float _WaveAmplitude; float _WaveSpeed; float _WaveTile; float _NormalMapsWavesSize; float _NormalMapWavesSpeed; float _DepthStrength; float _Depth; float _FoamAmount; float _FoamPower; float _FoamNoiseScale; float _Mettalic; float _Smootness; #ifdef ASE_TRANSMISSION float _TransmissionShadow; #endif #ifdef ASE_TRANSLUCENCY float _TransStrength; float _TransNormal; float _TransScattering; float _TransDirect; float _TransAmbient; float _TransShadow; #endif #ifdef ASE_TESSELLATION float _TessPhongStrength; float _TessValue; float _TessMin; float _TessMax; float _TessEdgeLength; float _TessMaxDisp; #endif CBUFFER_END #ifdef SCENEPICKINGPASS float4 _SelectionID; #endif #ifdef SCENESELECTIONPASS int _ObjectId; int _PassValue; #endif float3 mod2D289( float3 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float2 mod2D289( float2 x ) { return x - floor( x * ( 1.0 / 289.0 ) ) * 289.0; } float3 permute( float3 x ) { return mod2D289( ( ( x * 34.0 ) + 1.0 ) * x ); } float snoise( float2 v ) { const float4 C = float4( 0.211324865405187, 0.366025403784439, -0.577350269189626, 0.024390243902439 ); float2 i = floor( v + dot( v, C.yy ) ); float2 x0 = v - i + dot( i, C.xx ); float2 i1; i1 = ( x0.x > x0.y ) ? float2( 1.0, 0.0 ) : float2( 0.0, 1.0 ); float4 x12 = x0.xyxy + C.xxzz; x12.xy -= i1; i = mod2D289( i ); float3 p = permute( permute( i.y + float3( 0.0, i1.y, 1.0 ) ) + i.x + float3( 0.0, i1.x, 1.0 ) ); float3 m = max( 0.5 - float3( dot( x0, x0 ), dot( x12.xy, x12.xy ), dot( x12.zw, x12.zw ) ), 0.0 ); m = m * m; m = m * m; float3 x = 2.0 * frac( p * C.www ) - 1.0; float3 h = abs( x ) - 0.5; float3 ox = floor( x + 0.5 ); float3 a0 = x - ox; m *= 1.79284291400159 - 0.85373472095314 * ( a0 * a0 + h * h ); float3 g; g.x = a0.x * x0.x + h.x * x0.y; g.yz = a0.yz * x12.xz + h.yz * x12.yw; return 130.0 * dot( m, g ); } float2 UnityGradientNoiseDir( float2 p ) { p = fmod(p , 289); float x = fmod((34 * p.x + 1) * p.x , 289) + p.y; x = fmod( (34 * x + 1) * x , 289); x = frac( x / 41 ) * 2 - 1; return normalize( float2(x - floor(x + 0.5 ), abs( x ) - 0.5 ) ); } float UnityGradientNoise( float2 UV, float Scale ) { float2 p = UV * Scale; float2 ip = floor( p ); float2 fp = frac( p ); float d00 = dot( UnityGradientNoiseDir( ip ), fp ); float d01 = dot( UnityGradientNoiseDir( ip + float2( 0, 1 ) ), fp - float2( 0, 1 ) ); float d10 = dot( UnityGradientNoiseDir( ip + float2( 1, 0 ) ), fp - float2( 1, 0 ) ); float d11 = dot( UnityGradientNoiseDir( ip + float2( 1, 1 ) ), fp - float2( 1, 1 ) ); fp = fp * fp * fp * ( fp * ( fp * 6 - 15 ) + 10 ); return lerp( lerp( d00, d01, fp.y ), lerp( d10, d11, fp.y ), fp.x ) + 0.5; } PackedVaryings VertexFunction( Attributes input ) { PackedVaryings output = (PackedVaryings)0; UNITY_SETUP_INSTANCE_ID(input); UNITY_TRANSFER_INSTANCE_ID(input, output); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); float4 appendResult153 = (float4(0.23 , -0.8 , 0.0 , 0.0)); float3 ase_positionWS = TransformObjectToWorld( (input.positionOS).xyz ); float4 appendResult156 = (float4(ase_positionWS.x , ase_positionWS.z , 0.0 , 0.0)); float2 panner145 = ( ( _TimeParameters.x * _WaveSpeed ) * appendResult153.xy + ( ( appendResult156 * float4( float2( 6.5,0.9 ), 0.0 , 0.0 ) ) * _WaveTile ).xy); float simplePerlin2D143 = snoise( panner145 ); simplePerlin2D143 = simplePerlin2D143*0.5 + 0.5; float WAVESDISPLACEMENT245 = ( ( float3(0,0.05,0).y * _WaveAmplitude ) * simplePerlin2D143 ); float3 temp_cast_3 = (WAVESDISPLACEMENT245).xxx; float4 ase_positionCS = TransformObjectToHClip((input.positionOS).xyz); float4 screenPos = ComputeScreenPos(ase_positionCS); output.ase_texcoord2 = screenPos; output.ase_texcoord3.xy = input.ase_texcoord.xy; //setting value to unused interpolator channels and avoid initialization warnings output.ase_texcoord3.zw = 0; #ifdef ASE_ABSOLUTE_VERTEX_POS float3 defaultVertexValue = input.positionOS.xyz; #else float3 defaultVertexValue = float3(0, 0, 0); #endif float3 vertexValue = temp_cast_3; #ifdef ASE_ABSOLUTE_VERTEX_POS input.positionOS.xyz = vertexValue; #else input.positionOS.xyz += vertexValue; #endif VertexPositionInputs vertexInput = GetVertexPositionInputs( input.positionOS.xyz ); #if defined(APLICATION_SPACE_WARP_MOTION) // We do not need jittered position in ASW output.positionCSNoJitter = mul(_NonJitteredViewProjMatrix, mul(UNITY_MATRIX_M, input.positionOS));; output.positionCS = output.positionCSNoJitter; #else // Jittered. Match the frame. output.positionCS = vertexInput.positionCS; output.positionCSNoJitter = mul( _NonJitteredViewProjMatrix, mul( UNITY_MATRIX_M, input.positionOS)); #endif float4 prevPos = ( unity_MotionVectorsParams.x == 1 ) ? float4( input.positionOld, 1 ) : input.positionOS; #if _ADD_PRECOMPUTED_VELOCITY prevPos = prevPos - float4(input.alembicMotionVector, 0); #endif output.previousPositionCSNoJitter = mul( _PrevViewProjMatrix, mul( UNITY_PREV_MATRIX_M, prevPos ) ); // removed in ObjectMotionVectors.hlsl found in unity 6000.0.23 and higher //ApplyMotionVectorZBias( output.positionCS ); return output; } PackedVaryings vert ( Attributes input ) { return VertexFunction( input ); } half4 frag( PackedVaryings input ) : SV_Target { UNITY_SETUP_INSTANCE_ID(input); UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( input ); float4 screenPos = input.ase_texcoord2; float4 ase_positionSSNorm = screenPos / screenPos.w; ase_positionSSNorm.z = ( UNITY_NEAR_CLIP_VALUE >= 0 ) ? ase_positionSSNorm.z : ase_positionSSNorm.z * 0.5 + 0.5; float depthLinearEye64 = LinearEyeDepth( SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ), _ZBufferParams ); float clampResult81 = clamp( ( _DepthStrength * ( depthLinearEye64 - ( screenPos.w + _Depth ) ) ) , 0.0 , 1.0 ); float DeepShallowMask197 = clampResult81; float screenDepth434 = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH( ase_positionSSNorm.xy ),_ZBufferParams); float distanceDepth434 = abs( ( screenDepth434 - LinearEyeDepth( ase_positionSSNorm.z,_ZBufferParams ) ) / ( _FoamAmount ) ); float saferPower436 = abs( distanceDepth434 ); float temp_output_436_0 = pow( saferPower436 , _FoamPower ); float2 temp_cast_0 = (_FoamNoiseScale).xx; float2 temp_cast_1 = (( _TimeParameters.x * 0.2 )).xx; float2 texCoord433 = input.ase_texcoord3.xy * temp_cast_0 + temp_cast_1; float gradientNoise437 = UnityGradientNoise(texCoord433,1.0); gradientNoise437 = gradientNoise437*0.5 + 0.5; float temp_output_471_0 = step( temp_output_436_0 , gradientNoise437 ); float FoamMask439 = temp_output_471_0; float smoothstepResult400 = smoothstep( 0.2 , 1.2 , FoamMask439); float clampResult401 = clamp( ( smoothstepResult400 * 0.05 ) , 0.0 , 1.0 ); float TRANSPARENCYFINAL267 = ( DeepShallowMask197 + (1.0 + (0.95 - 0.0) * (0.0 - 1.0) / (1.0 - 0.0)) + clampResult401 ); float Alpha = TRANSPARENCYFINAL267; float AlphaClipThreshold = 0.5; #ifdef _ALPHATEST_ON clip(Alpha - AlphaClipThreshold); #endif #if defined(LOD_FADE_CROSSFADE) LODFadeCrossFade( input.positionCS ); #endif #if defined(APLICATION_SPACE_WARP_MOTION) return float4( CalcAswNdcMotionVectorFromCsPositions( input.positionCSNoJitter, input.previousPositionCSNoJitter ), 1 ); #else return float4( CalcNdcMotionVectorFromCsPositions( input.positionCSNoJitter, input.previousPositionCSNoJitter ), 0, 0 ); #endif } ENDHLSL } } FallBack "Hidden/Shader Graph/FallbackError" Fallback Off } /*ASEBEGIN Version=19800 Node;AmplifyShaderEditor.CommentaryNode;428;-65.96826,-1461.15;Inherit;False;1745.648;737.933;Foam;16;445;443;442;441;440;439;437;436;435;434;433;432;431;430;429;471;Foam;1,1,1,1;0;0 Node;AmplifyShaderEditor.RangedFloatNode;445;-71.74513,-811.948;Inherit;False;Constant;_FoamSpeed;Foam Speed;20;0;Create;True;0;0;0;False;0;False;0.2;0.5;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleTimeNode;429;-17.23541,-917.0339;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.CommentaryNode;91;-2474.408,466.2085;Inherit;False;1982.289;589.8825;Comment;14;63;65;67;64;83;82;66;74;81;85;86;84;197;196;Deep&ShallowColor;1,1,1,1;0;0 Node;AmplifyShaderEditor.RangedFloatNode;430;-26.14526,-1064.283;Inherit;False;Property;_FoamNoiseScale;Foam Noise Scale;17;0;Create;True;0;0;0;False;0;False;150;150;0;1000;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;431;-27.87524,-1268.683;Inherit;False;Property;_FoamAmount;Foam Amount;15;0;Create;True;0;0;0;False;0;False;1.5;1.5;0;10;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;432;227.9714,-894.1125;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;435;256.7495,-1206.154;Inherit;False;Property;_FoamPower;Foam Power;16;0;Create;True;0;0;0;False;0;False;0.5;0.5;0.1;5;0;1;FLOAT;0 Node;AmplifyShaderEditor.ScreenPosInputsNode;63;-2442.563,708.9407;Float;False;1;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.TextureCoordinatesNode;433;290.627,-1062.13;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.DepthFade;434;224.4038,-1418.474;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.CommentaryNode;183;-2427.607,1285.62;Inherit;False;1957.563;1136.648;Comment;21;155;156;158;151;148;150;152;157;160;149;159;153;145;162;168;170;143;169;163;188;245;WavesVertexOffset;1,1,1,1;0;0 Node;AmplifyShaderEditor.RangedFloatNode;67;-2355.368,899.1294;Inherit;False;Property;_Depth;Depth;4;0;Create;True;0;0;0;False;0;False;0.3;0.3;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.PowerNode;436;594.9379,-1353.827;Inherit;False;True;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.NoiseGeneratorNode;437;667.4668,-1066.86;Inherit;True;Gradient;True;True;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.BreakToComponentsNode;65;-2215.166,717.8157;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15 Node;AmplifyShaderEditor.StepOpNode;471;841.0071,-1233.626;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;83;-2088.616,791.182;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.WorldPosInputsNode;155;-2377.607,1537.926;Inherit;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 Node;AmplifyShaderEditor.ScreenDepthNode;64;-2258.576,616.881;Inherit;False;0;1;0;FLOAT4;0,0,0,0;False;1;FLOAT;0 Node;AmplifyShaderEditor.CommentaryNode;266;170.6061,898.9609;Inherit;False;1198.132;582.9205;Comment;9;3;192;90;265;198;267;398;400;401;TRANSPARENCY FINAL;1,1,1,1;0;0 Node;AmplifyShaderEditor.SimpleSubtractOpNode;66;-1956.295,733.16;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;439;1437.562,-1352.665;Inherit;False;FoamMask;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;82;-2058.965,595.7329;Inherit;False;Property;_DepthStrength;Depth Strength;5;0;Create;True;0;0;0;False;0;False;0.3;0.3;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.Vector2Node;158;-2163.74,1704.801;Inherit;False;Constant;_Vector0;Vector 0;15;0;Create;True;0;0;0;False;0;False;6.5,0.9;1,10;0;3;FLOAT2;0;FLOAT;1;FLOAT;2 Node;AmplifyShaderEditor.DynamicAppendNode;156;-2155.255,1544.367;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.RangedFloatNode;160;-1960.265,1772.124;Inherit;False;Property;_WaveTile;Wave Tile;9;0;Create;True;0;0;0;False;0;False;0.5;0.5;0;0.9;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;151;-2243.51,1996.039;Inherit;False;Constant;_wavedirectionx;wave direction x;17;0;Create;True;0;0;0;False;0;False;0.23;-1;-1;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;150;-1855.533,2306.268;Inherit;False;Property;_WaveSpeed;Wave Speed;8;0;Create;True;0;0;0;False;0;False;0.5;0.5;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;74;-1761.804,708.0941;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;157;-1896.241,1546.953;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT2;0,0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.SimpleTimeNode;148;-1754.768,2203.957;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.GetLocalVarNode;192;41.23421,1217.474;Inherit;False;439;FoamMask;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;152;-2236.342,2081.59;Inherit;False;Constant;_wavedirectiony;wave direction y;24;0;Create;True;0;0;0;False;0;False;-0.8;0.067;-1;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.ClampOpNode;81;-1596.362,711.3876;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;149;-1530.768,2253.957;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;159;-1643.2,1549.363;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT;0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.Vector3Node;162;-1513.271,1361.713;Inherit;False;Constant;_Vector1;Vector 1;14;0;Create;True;0;0;0;False;0;False;0,0.05,0;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 Node;AmplifyShaderEditor.DynamicAppendNode;153;-1867.231,2019.957;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.RangedFloatNode;399;277.303,1436.751;Inherit;False;Constant;_Float0;Float 0;29;0;Create;True;0;0;0;True;0;False;0.05;1;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.SmoothstepOpNode;400;362.052,1219.602;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0.2;False;2;FLOAT;1.2;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;398;577.6862,1288.293;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.PannerNode;145;-1386.378,1988.409;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.RangedFloatNode;3;193.7791,1014.227;Inherit;False;Constant;_Transparency;Transparency;2;0;Create;True;0;0;0;False;0;False;0.95;0.5;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.BreakToComponentsNode;168;-1298.1,1387.307;Inherit;False;FLOAT3;1;0;FLOAT3;0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15 Node;AmplifyShaderEditor.RangedFloatNode;170;-1409.1,1596.307;Inherit;False;Property;_WaveAmplitude;Wave Amplitude;10;0;Create;True;0;0;0;False;0;False;0.2;0.2;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;197;-1377.094,528.7972;Inherit;False;DeepShallowMask;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.ClampOpNode;401;715.3116,1244.153;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.NoiseGeneratorNode;143;-1126.841,1911.796;Inherit;True;Simplex2D;True;False;2;0;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.GetLocalVarNode;198;494.371,948.9609;Inherit;False;197;DeepShallowMask;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.TFHCRemapNode;265;508.0719,1046.37;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;1;False;4;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;169;-1167.1,1475.307;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;90;833.869,1012.861;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;163;-963.286,1360.345;Inherit;True;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.CommentaryNode;248;-2607.635,-1748.536;Inherit;False;1847.655;579.5157;Comment;9;243;352;254;405;249;257;251;252;351;Normal Map Waves;1,1,1,1;0;0 Node;AmplifyShaderEditor.CommentaryNode;414;-2408.578,-776.7009;Inherit;False;1714.404;696.3644;Comment;12;290;342;280;333;279;341;415;335;336;314;350;282;FAKE REFRACTIONS;1,1,1,1;0;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;267;1047.772,1004.04;Inherit;False;TRANSPARENCYFINAL;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;245;-729.6497,1371.044;Inherit;False;WAVESDISPLACEMENT;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleTimeNode;251;-2324.447,-1362.269;Inherit;False;1;0;FLOAT;0.1;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;257;-2561.399,-1535.609;Inherit;False;Property;_NormalMapsWavesSize;Normal Maps Waves Size;13;0;Create;True;0;0;0;False;0;False;5;5;0;10;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;252;-2485.628,-1264.38;Inherit;False;Property;_NormalMapWavesSpeed;Normal Map Waves Speed;12;0;Create;True;0;0;0;False;0;False;0.1;0.1;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;405;-2190.042,-1513.174;Inherit;False;FLOAT4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;249;-2082.218,-1380.983;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.TexturePropertyNode;351;-2189.521,-1740.015;Inherit;True;Property;_NormalMapTexture;Normal Map Texture ;11;2;[NoScaleOffset];[Normal];Create;True;0;0;0;True;0;False;a78adb8868cccbe4a92d9d81db916e6e;a78adb8868cccbe4a92d9d81db916e6e;True;bump;Auto;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1 Node;AmplifyShaderEditor.TextureCoordinatesNode;254;-1992.74,-1514.106;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,5;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.FunctionNode;352;-1730.17,-1725.82;Inherit;True;NormalCreate;0;;9;e12f7ae19d416b942820e3932b56220f;0;4;1;SAMPLER2D;;False;2;FLOAT2;0,0;False;3;FLOAT;0.5;False;4;FLOAT;1;False;1;FLOAT3;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;243;-1071.836,-1714.044;Inherit;False;NORMALMAPWAVES;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.GetLocalVarNode;279;-2170.569,-303.5186;Inherit;False;243;NORMALMAPWAVES;1;0;OBJECT;;False;1;FLOAT3;0 Node;AmplifyShaderEditor.GrabScreenPosition;341;-2358.578,-519.3195;Inherit;False;0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.RangedFloatNode;290;-2208.454,-202.0541;Inherit;False;Constant;_Float3;Float 3;18;0;Create;True;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;333;-1985.109,-686.3021;Inherit;False;Constant;_Float4;Float 4;22;0;Create;True;0;0;0;False;0;False;100;1;0;100;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;280;-1875.663,-306.6546;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.ComponentMaskNode;342;-2090.173,-513.0981;Inherit;False;True;True;True;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.SimpleAddOpNode;282;-1591.159,-357.7633;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT4;0 Node;AmplifyShaderEditor.DepthFade;350;-1684.137,-726.7009;Inherit;False;True;False;True;2;1;FLOAT3;0,0,0;False;0;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.ScreenColorNode;314;-1416.112,-356.7128;Inherit;False;Global;_GrabScreen0;Grab Screen 0;21;0;Create;True;0;0;0;False;0;False;Object;-1;False;False;False;False;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.ColorNode;85;-1353.423,608.9352;Inherit;False;Property;_ShallowColor;Shallow Color;3;0;Create;True;0;0;0;False;0;False;0.5238074,0.7314408,0.745283,0;0.2003827,0.745283,0.3747112,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5 Node;AmplifyShaderEditor.OneMinusNode;335;-1387.788,-726.2308;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.ColorNode;84;-1327.132,818.0287;Inherit;False;Property;_DeepColor;Deep Color;2;0;Create;True;0;0;0;False;0;False;0.3114988,0.5266015,0.5283019,0;1,0.8726415,0.8726415,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;336;-1165.583,-388.4095;Inherit;True;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.LerpOp;86;-1045.415,672.1371;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0 Node;AmplifyShaderEditor.ColorNode;440;999.5128,-922.9009;Inherit;False;Property;_FoamColor;Foam Color;14;0;Create;True;0;0;0;False;0;False;0.3066038,1,0.9145772,0;0.2971698,1,0.9126425,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5 Node;AmplifyShaderEditor.RegisterLocalVarNode;415;-925.225,-389.6505;Inherit;False;FAKEREFRACTIONS;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;441;1249.635,-1154.369;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;196;-731.6638,665.9779;Inherit;False;DeepShallowColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.GetLocalVarNode;416;909.8789,-371.3734;Inherit;False;415;FAKEREFRACTIONS;1;0;OBJECT;;False;1;COLOR;0 Node;AmplifyShaderEditor.GetLocalVarNode;476;1045.112,-63.59784;Inherit;False;439;FoamMask;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.ColorNode;478;1017.163,100.7891;Inherit;False;Constant;_Color0;Color 0;15;0;Create;True;0;0;0;False;0;False;0.4980392,0.4980392,1,0;0,0,0,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5 Node;AmplifyShaderEditor.GetLocalVarNode;411;903.5338,-288.2307;Inherit;False;196;DeepShallowColor;1;0;OBJECT;;False;1;COLOR;0 Node;AmplifyShaderEditor.GetLocalVarNode;457;1005.23,19.06134;Inherit;False;243;NORMALMAPWAVES;1;0;OBJECT;;False;1;FLOAT3;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;442;1435.016,-1148.227;Inherit;False;FoamColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.GetLocalVarNode;483;1068.577,311.6291;Inherit;False;439;FoamMask;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;1;1085.717,394.7116;Inherit;False;Property;_Smootness;Smootness;6;0;Create;True;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.GetLocalVarNode;460;1400.639,-169.8729;Inherit;False;442;FoamColor;1;0;OBJECT;;False;1;COLOR;0 Node;AmplifyShaderEditor.LayeredBlendNode;477;1422.112,-51.59784;Inherit;False;6;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0 Node;AmplifyShaderEditor.ColorNode;484;1118.628,475.016;Inherit;False;Constant;_Color1;Color 1;15;0;Create;True;0;0;0;False;0;False;0.2264151,0.2264151,0.2264151,0;0,0,0,0;True;True;0;6;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT3;5 Node;AmplifyShaderEditor.LerpOp;470;1194.726,-397.0083;Inherit;True;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0.6132076,0.6132076,0.6132076,0;False;1;COLOR;0 Node;AmplifyShaderEditor.SimpleAddOpNode;468;1626.736,-390.0578;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.RangedFloatNode;16;1430.962,91.4223;Inherit;False;Property;_Mettalic;Mettalic;7;0;Create;True;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.GetLocalVarNode;246;1792.341,447.4535;Inherit;False;245;WAVESDISPLACEMENT;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;443;802.7948,-1429.559;Inherit;False;newfoammask;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.GetLocalVarNode;268;1802.455,333.9038;Inherit;False;267;TRANSPARENCYFINAL;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;188;-830.4629,1926.917;Inherit;False;OffsetWavesMask;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.LayeredBlendNode;485;1425.577,305.6291;Inherit;False;6;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0 Node;AmplifyShaderEditor.NormalizeNode;474;1650.911,-43.49784;Inherit;False;False;1;0;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;486;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;487;2122.445,-57.32889;Float;False;True;-1;2;;0;12;Polytope Studio/PT_Water_Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;21;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalForward;False;False;0;;0;0;Standard;45;Lighting Model;0;0;Workflow;1;0;Surface;1;638388171280090033; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Alpha Clipping;1;0; Use Shadow Threshold;0;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Forward Only;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0;Receive Shadows;1;0;Receive SSAO;1;0;Motion Vectors;1;0; Add Precomputed Velocity;0;0;GPU Instancing;1;0;LOD CrossFade;1;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;11;False;True;True;True;True;True;True;True;True;True;True;False;;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;488;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;489;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;True;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;490;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;491;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=Universal2D;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;492;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;493;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalGBuffer;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;494;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;495;2122.445,-57.32889;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;False;0;;0;0;Standard;0;False;0 Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;496;2122.445,42.67111;Float;False;False;-1;3;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;MotionVectors;0;10;MotionVectors;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;False;False;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=MotionVectors;False;False;0;;0;0;Standard;0;False;0 WireConnection;432;0;429;0 WireConnection;432;1;445;0 WireConnection;433;0;430;0 WireConnection;433;1;432;0 WireConnection;434;0;431;0 WireConnection;436;0;434;0 WireConnection;436;1;435;0 WireConnection;437;0;433;0 WireConnection;65;0;63;0 WireConnection;471;0;436;0 WireConnection;471;1;437;0 WireConnection;83;0;65;3 WireConnection;83;1;67;0 WireConnection;66;0;64;0 WireConnection;66;1;83;0 WireConnection;439;0;471;0 WireConnection;156;0;155;1 WireConnection;156;1;155;3 WireConnection;74;0;82;0 WireConnection;74;1;66;0 WireConnection;157;0;156;0 WireConnection;157;1;158;0 WireConnection;81;0;74;0 WireConnection;149;0;148;0 WireConnection;149;1;150;0 WireConnection;159;0;157;0 WireConnection;159;1;160;0 WireConnection;153;0;151;0 WireConnection;153;1;152;0 WireConnection;400;0;192;0 WireConnection;398;0;400;0 WireConnection;398;1;399;0 WireConnection;145;0;159;0 WireConnection;145;2;153;0 WireConnection;145;1;149;0 WireConnection;168;0;162;0 WireConnection;197;0;81;0 WireConnection;401;0;398;0 WireConnection;143;0;145;0 WireConnection;265;0;3;0 WireConnection;169;0;168;1 WireConnection;169;1;170;0 WireConnection;90;0;198;0 WireConnection;90;1;265;0 WireConnection;90;2;401;0 WireConnection;163;0;169;0 WireConnection;163;1;143;0 WireConnection;267;0;90;0 WireConnection;245;0;163;0 WireConnection;405;0;257;0 WireConnection;405;1;257;0 WireConnection;249;0;251;0 WireConnection;249;1;252;0 WireConnection;254;0;405;0 WireConnection;254;1;249;0 WireConnection;352;1;351;0 WireConnection;352;2;254;0 WireConnection;243;0;352;0 WireConnection;280;0;279;0 WireConnection;280;1;290;0 WireConnection;342;0;341;0 WireConnection;282;0;342;0 WireConnection;282;1;280;0 WireConnection;350;0;333;0 WireConnection;314;0;282;0 WireConnection;335;0;350;0 WireConnection;336;0;335;0 WireConnection;336;1;314;0 WireConnection;86;0;85;0 WireConnection;86;1;84;0 WireConnection;86;2;81;0 WireConnection;415;0;336;0 WireConnection;441;0;471;0 WireConnection;441;1;440;0 WireConnection;196;0;86;0 WireConnection;442;0;441;0 WireConnection;477;0;476;0 WireConnection;477;1;457;0 WireConnection;477;2;478;0 WireConnection;470;0;416;0 WireConnection;470;1;411;0 WireConnection;468;0;470;0 WireConnection;468;1;460;0 WireConnection;443;0;436;0 WireConnection;188;0;143;0 WireConnection;485;0;483;0 WireConnection;485;1;1;0 WireConnection;485;2;484;0 WireConnection;474;0;477;0 WireConnection;487;0;468;0 WireConnection;487;1;474;0 WireConnection;487;3;16;0 WireConnection;487;4;485;0 WireConnection;487;6;268;0 WireConnection;487;8;246;0 ASEEND*/ //CHKSM=B4EED95D4787ACDB08CAA60A08E617EE2DD2337B