Files
ClickRPG/Assets/MasterStylizedFX/Shaders/CommonParticleLoop.shader
2025-10-04 12:25:29 +01:00

2095 lines
87 KiB
GLSL

// Made with Amplify Shader Editor v1.9.3.2
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "CommonParticleLoop"
{
Properties
{
[HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
[Header(Main)][NoScaleOffset]_Main("Main", 2D) = "white" {}
_Tiling("Tiling", Vector) = (1,1,0,0)
_Offset("Offset", Vector) = (0,0,0,0)
_Scroll("Scroll", Vector) = (1,0,0,0)
[Header(LimitUV)]_LimitUVRange("LimitUVRange", Vector) = (0,1,0,1)
[Toggle]_LimitUV("LimitUV", Float) = 0
[Header(Mask)][NoScaleOffset]_NoiseMask("NoiseMask", 2D) = "white" {}
[Toggle]_Mask("Mask", Float) = 0
_MaskScroll("MaskScroll", Vector) = (0,0,0,0)
_MaskTiling("MaskTiling", Vector) = (0,0,0,0)
_MaskOffset("MaskOffset", Vector) = (0,0,0,0)
_Feather("Feather", Range( 0 , 1)) = 0
[Header(StaticMask)]_StaticMask("StaticMask", 2D) = "white" {}
_SmoothStep("SmoothStep", Vector) = (0,1,0,0)
[HideInInspector] _texcoord( "", 2D ) = "white" {}
//_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] _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][ToggleOff] _ReceiveShadows("Receive Shadows", Float) = 1.0
}
SubShader
{
LOD 0
Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" "UniversalMaterialType"="Unlit" }
Cull Off
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"="UniversalForwardOnly" }
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
ZWrite Off
ZTest LEqual
Offset 0 , 0
ColorMask RGBA
HLSLPROGRAM
#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 ASE_SRP_VERSION 140007
#pragma shader_feature_local _RECEIVE_SHADOWS_OFF
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
#pragma multi_compile_fragment _ DEBUG_DISPLAY
#pragma vertex vert
#pragma fragment frag
#define SHADERPASS SHADERPASS_UNLIT
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#endif
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
#endif
#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 "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"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging3D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceData.hlsl"
#if defined(LOD_FADE_CROSSFADE)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
#endif
#define ASE_NEEDS_FRAG_COLOR
struct VertexInput
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
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 ASE_FOG
float fogFactor : TEXCOORD2;
#endif
float4 ase_color : COLOR;
float4 ase_texcoord3 : TEXCOORD3;
float4 ase_texcoord4 : TEXCOORD4;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _LimitUVRange;
float4 _StaticMask_ST;
float2 _Tiling;
float2 _Scroll;
float2 _Offset;
float2 _MaskTiling;
float2 _MaskOffset;
float2 _MaskScroll;
float2 _SmoothStep;
float _LimitUV;
float _Mask;
float _Feather;
#ifdef ASE_TESSELLATION
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _Main;
sampler2D _NoiseMask;
sampler2D _StaticMask;
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.ase_color = v.ase_color;
o.ase_texcoord3.xyz = v.ase_texcoord.xyz;
o.ase_texcoord4 = v.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord3.w = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normalOS = v.normalOS;
float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
float4 positionCS = TransformWorldToHClip( positionWS );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
o.positionWS = positionWS;
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = positionCS;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
#ifdef ASE_FOG
o.fogFactor = ComputeFogFactor( positionCS.z );
#endif
o.positionCS = positionCS;
return o;
}
#if defined(ASE_TESSELLATION)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.vertex = v.positionOS;
o.normalOS = v.normalOS;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
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(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
half4 frag ( VertexOutput IN
#ifdef _WRITE_RENDERING_LAYERS
, out float4 outRenderingLayers : SV_Target1
#endif
) : SV_Target
{
UNITY_SETUP_INSTANCE_ID( IN );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 WorldPosition = IN.positionWS;
#endif
float4 ShadowCoords = float4( 0, 0, 0, 0 );
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#endif
#endif
float3 texCoord76 = IN.ase_texcoord3.xyz;
texCoord76.xy = IN.ase_texcoord3.xyz.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord74 = IN.ase_texcoord3.xyz.xy * _Tiling + ( ( ( texCoord76.z * _Scroll ) * _TimeParameters.x ) + _Offset );
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
float2 texCoord120 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
float4 texCoord137 = IN.ase_texcoord4;
texCoord137.xy = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
float4 texCoord157 = IN.ase_texcoord4;
texCoord157.xy = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord156 = IN.ase_texcoord3.xyz.xy * _MaskTiling + ( _MaskOffset + ( ( texCoord157.w * _TimeParameters.x ) * _MaskScroll ) );
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
float2 uv_StaticMask = IN.ase_texcoord3.xyz.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
float3 BakedAlbedo = 0;
float3 BakedEmission = 0;
float3 Color = ( IN.ase_color * tex2DNode73 * ( 1.0 + texCoord120.x ) ).rgb;
float Alpha = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
float AlphaClipThreshold = 0.5;
float AlphaClipThresholdShadow = 0.5;
#ifdef _ALPHATEST_ON
clip( Alpha - AlphaClipThreshold );
#endif
#if defined(_DBUFFER)
ApplyDecalToBaseColor(IN.positionCS, Color);
#endif
#if defined(_ALPHAPREMULTIPLY_ON)
Color *= Alpha;
#endif
#ifdef LOD_FADE_CROSSFADE
LODFadeCrossFade( IN.positionCS );
#endif
#ifdef ASE_FOG
Color = MixFog( Color, IN.fogFactor );
#endif
#ifdef _WRITE_RENDERING_LAYERS
uint renderingLayers = GetMeshRenderingLayer();
outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 );
#endif
return half4( Color, Alpha );
}
ENDHLSL
}
Pass
{
Name "ShadowCaster"
Tags { "LightMode"="ShadowCaster" }
ZWrite On
ZTest LEqual
AlphaToMask Off
ColorMask 0
HLSLPROGRAM
#pragma multi_compile_instancing
#pragma multi_compile _ LOD_FADE_CROSSFADE
#define ASE_FOG 1
#define _SURFACE_TYPE_TRANSPARENT 1
#define ASE_SRP_VERSION 140007
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
#define SHADERPASS SHADERPASS_SHADOWCASTER
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#endif
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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/ShaderGraphFunctions.hlsl"
#if defined(LOD_FADE_CROSSFADE)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
#endif
struct VertexInput
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
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_color : COLOR;
float4 ase_texcoord2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _LimitUVRange;
float4 _StaticMask_ST;
float2 _Tiling;
float2 _Scroll;
float2 _Offset;
float2 _MaskTiling;
float2 _MaskOffset;
float2 _MaskScroll;
float2 _SmoothStep;
float _LimitUV;
float _Mask;
float _Feather;
#ifdef ASE_TESSELLATION
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _Main;
sampler2D _NoiseMask;
sampler2D _StaticMask;
float3 _LightDirection;
float3 _LightPosition;
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
o.ase_color = v.ase_color;
o.ase_texcoord2.xyz = v.ase_texcoord.xyz;
o.ase_texcoord3 = v.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord2.w = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normalOS = v.normalOS;
float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
o.positionWS = positionWS;
#endif
float3 normalWS = TransformObjectToWorldDir( v.normalOS );
#if _CASTING_PUNCTUAL_LIGHT_SHADOW
float3 lightDirectionWS = normalize(_LightPosition - positionWS);
#else
float3 lightDirectionWS = _LightDirection;
#endif
float4 positionCS = TransformWorldToHClip(ApplyShadowBias(positionWS, normalWS, lightDirectionWS));
#if UNITY_REVERSED_Z
positionCS.z = min(positionCS.z, UNITY_NEAR_CLIP_VALUE);
#else
positionCS.z = max(positionCS.z, UNITY_NEAR_CLIP_VALUE);
#endif
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = positionCS;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
o.positionCS = positionCS;
return o;
}
#if defined(ASE_TESSELLATION)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.vertex = v.positionOS;
o.normalOS = v.normalOS;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
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(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
half4 frag(VertexOutput IN ) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID( IN );
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 WorldPosition = IN.positionWS;
#endif
float4 ShadowCoords = float4( 0, 0, 0, 0 );
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#endif
#endif
float3 texCoord76 = IN.ase_texcoord2.xyz;
texCoord76.xy = IN.ase_texcoord2.xyz.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord74 = IN.ase_texcoord2.xyz.xy * _Tiling + ( ( ( texCoord76.z * _Scroll ) * _TimeParameters.x ) + _Offset );
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
float4 texCoord137 = IN.ase_texcoord3;
texCoord137.xy = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
float4 texCoord157 = IN.ase_texcoord3;
texCoord157.xy = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord156 = IN.ase_texcoord2.xyz.xy * _MaskTiling + ( _MaskOffset + ( ( texCoord157.w * _TimeParameters.x ) * _MaskScroll ) );
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
float2 uv_StaticMask = IN.ase_texcoord2.xyz.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
float Alpha = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
float AlphaClipThreshold = 0.5;
float AlphaClipThresholdShadow = 0.5;
#ifdef _ALPHATEST_ON
#ifdef _ALPHATEST_SHADOW_ON
clip(Alpha - AlphaClipThresholdShadow);
#else
clip(Alpha - AlphaClipThreshold);
#endif
#endif
#ifdef LOD_FADE_CROSSFADE
LODFadeCrossFade( IN.positionCS );
#endif
return 0;
}
ENDHLSL
}
Pass
{
Name "DepthOnly"
Tags { "LightMode"="DepthOnly" }
ZWrite On
ColorMask R
AlphaToMask Off
HLSLPROGRAM
#pragma multi_compile_instancing
#pragma multi_compile _ LOD_FADE_CROSSFADE
#define ASE_FOG 1
#define _SURFACE_TYPE_TRANSPARENT 1
#define ASE_SRP_VERSION 140007
#pragma vertex vert
#pragma fragment frag
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#endif
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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/ShaderGraphFunctions.hlsl"
#if defined(LOD_FADE_CROSSFADE)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
#endif
struct VertexInput
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
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_color : COLOR;
float4 ase_texcoord2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _LimitUVRange;
float4 _StaticMask_ST;
float2 _Tiling;
float2 _Scroll;
float2 _Offset;
float2 _MaskTiling;
float2 _MaskOffset;
float2 _MaskScroll;
float2 _SmoothStep;
float _LimitUV;
float _Mask;
float _Feather;
#ifdef ASE_TESSELLATION
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _Main;
sampler2D _NoiseMask;
sampler2D _StaticMask;
VertexOutput VertexFunction( VertexInput v )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.ase_color = v.ase_color;
o.ase_texcoord2.xyz = v.ase_texcoord.xyz;
o.ase_texcoord3 = v.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord2.w = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normalOS = v.normalOS;
float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
o.positionWS = positionWS;
#endif
o.positionCS = TransformWorldToHClip( positionWS );
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
vertexInput.positionWS = positionWS;
vertexInput.positionCS = o.positionCS;
o.shadowCoord = GetShadowCoord( vertexInput );
#endif
return o;
}
#if defined(ASE_TESSELLATION)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.vertex = v.positionOS;
o.normalOS = v.normalOS;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
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(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
half4 frag(VertexOutput IN ) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
float3 WorldPosition = IN.positionWS;
#endif
float4 ShadowCoords = float4( 0, 0, 0, 0 );
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
ShadowCoords = IN.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
#endif
#endif
float3 texCoord76 = IN.ase_texcoord2.xyz;
texCoord76.xy = IN.ase_texcoord2.xyz.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord74 = IN.ase_texcoord2.xyz.xy * _Tiling + ( ( ( texCoord76.z * _Scroll ) * _TimeParameters.x ) + _Offset );
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
float4 texCoord137 = IN.ase_texcoord3;
texCoord137.xy = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
float4 texCoord157 = IN.ase_texcoord3;
texCoord157.xy = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord156 = IN.ase_texcoord2.xyz.xy * _MaskTiling + ( _MaskOffset + ( ( texCoord157.w * _TimeParameters.x ) * _MaskScroll ) );
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
float2 uv_StaticMask = IN.ase_texcoord2.xyz.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
float Alpha = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
float AlphaClipThreshold = 0.5;
#ifdef _ALPHATEST_ON
clip(Alpha - AlphaClipThreshold);
#endif
#ifdef LOD_FADE_CROSSFADE
LODFadeCrossFade( IN.positionCS );
#endif
return 0;
}
ENDHLSL
}
Pass
{
Name "SceneSelectionPass"
Tags { "LightMode"="SceneSelectionPass" }
Cull Off
AlphaToMask Off
HLSLPROGRAM
#define ASE_FOG 1
#define _SURFACE_TYPE_TRANSPARENT 1
#define ASE_SRP_VERSION 140007
#pragma vertex vert
#pragma fragment frag
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define SHADERPASS SHADERPASS_DEPTHONLY
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#endif
#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.core/ShaderLibrary/TextureStack.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
struct VertexInput
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _LimitUVRange;
float4 _StaticMask_ST;
float2 _Tiling;
float2 _Scroll;
float2 _Offset;
float2 _MaskTiling;
float2 _MaskOffset;
float2 _MaskScroll;
float2 _SmoothStep;
float _LimitUV;
float _Mask;
float _Feather;
#ifdef ASE_TESSELLATION
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _Main;
sampler2D _NoiseMask;
sampler2D _StaticMask;
int _ObjectId;
int _PassValue;
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
VertexOutput VertexFunction(VertexInput v )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.ase_color = v.ase_color;
o.ase_texcoord.xyz = v.ase_texcoord.xyz;
o.ase_texcoord1 = v.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord.w = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normalOS = v.normalOS;
float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
o.positionCS = TransformWorldToHClip(positionWS);
return o;
}
#if defined(ASE_TESSELLATION)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.vertex = v.positionOS;
o.normalOS = v.normalOS;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
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(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
half4 frag(VertexOutput IN ) : SV_TARGET
{
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float3 texCoord76 = IN.ase_texcoord.xyz;
texCoord76.xy = IN.ase_texcoord.xyz.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord74 = IN.ase_texcoord.xyz.xy * _Tiling + ( ( ( texCoord76.z * _Scroll ) * _TimeParameters.x ) + _Offset );
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
float4 texCoord137 = IN.ase_texcoord1;
texCoord137.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
float4 texCoord157 = IN.ase_texcoord1;
texCoord157.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord156 = IN.ase_texcoord.xyz.xy * _MaskTiling + ( _MaskOffset + ( ( texCoord157.w * _TimeParameters.x ) * _MaskScroll ) );
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
float2 uv_StaticMask = IN.ase_texcoord.xyz.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
surfaceDescription.Alpha = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
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 = half4(_ObjectId, _PassValue, 1.0, 1.0);
return outColor;
}
ENDHLSL
}
Pass
{
Name "ScenePickingPass"
Tags { "LightMode"="Picking" }
AlphaToMask Off
HLSLPROGRAM
#define ASE_FOG 1
#define _SURFACE_TYPE_TRANSPARENT 1
#define ASE_SRP_VERSION 140007
#pragma vertex vert
#pragma fragment frag
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define SHADERPASS SHADERPASS_DEPTHONLY
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#endif
#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.core/ShaderLibrary/TextureStack.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
struct VertexInput
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _LimitUVRange;
float4 _StaticMask_ST;
float2 _Tiling;
float2 _Scroll;
float2 _Offset;
float2 _MaskTiling;
float2 _MaskOffset;
float2 _MaskScroll;
float2 _SmoothStep;
float _LimitUV;
float _Mask;
float _Feather;
#ifdef ASE_TESSELLATION
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _Main;
sampler2D _NoiseMask;
sampler2D _StaticMask;
float4 _SelectionID;
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
VertexOutput VertexFunction(VertexInput v )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.ase_color = v.ase_color;
o.ase_texcoord.xyz = v.ase_texcoord.xyz;
o.ase_texcoord1 = v.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord.w = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normalOS = v.normalOS;
float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
o.positionCS = TransformWorldToHClip(positionWS);
return o;
}
#if defined(ASE_TESSELLATION)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.vertex = v.positionOS;
o.normalOS = v.normalOS;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
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(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
half4 frag(VertexOutput IN ) : SV_TARGET
{
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float3 texCoord76 = IN.ase_texcoord.xyz;
texCoord76.xy = IN.ase_texcoord.xyz.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord74 = IN.ase_texcoord.xyz.xy * _Tiling + ( ( ( texCoord76.z * _Scroll ) * _TimeParameters.x ) + _Offset );
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
float4 texCoord137 = IN.ase_texcoord1;
texCoord137.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
float4 texCoord157 = IN.ase_texcoord1;
texCoord157.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord156 = IN.ase_texcoord.xyz.xy * _MaskTiling + ( _MaskOffset + ( ( texCoord157.w * _TimeParameters.x ) * _MaskScroll ) );
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
float2 uv_StaticMask = IN.ase_texcoord.xyz.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
surfaceDescription.Alpha = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
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;
outColor = _SelectionID;
return outColor;
}
ENDHLSL
}
Pass
{
Name "DepthNormals"
Tags { "LightMode"="DepthNormalsOnly" }
ZTest LEqual
ZWrite On
HLSLPROGRAM
#pragma multi_compile_instancing
#pragma multi_compile _ LOD_FADE_CROSSFADE
#define ASE_FOG 1
#define _SURFACE_TYPE_TRANSPARENT 1
#define ASE_SRP_VERSION 140007
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define VARYINGS_NEED_NORMAL_WS
#define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
#endif
#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.core/ShaderLibrary/TextureStack.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
struct VertexInput
{
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float3 normalWS : TEXCOORD0;
float4 ase_color : COLOR;
float4 ase_texcoord1 : TEXCOORD1;
float4 ase_texcoord2 : TEXCOORD2;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
CBUFFER_START(UnityPerMaterial)
float4 _LimitUVRange;
float4 _StaticMask_ST;
float2 _Tiling;
float2 _Scroll;
float2 _Offset;
float2 _MaskTiling;
float2 _MaskOffset;
float2 _MaskScroll;
float2 _SmoothStep;
float _LimitUV;
float _Mask;
float _Feather;
#ifdef ASE_TESSELLATION
float _TessPhongStrength;
float _TessValue;
float _TessMin;
float _TessMax;
float _TessEdgeLength;
float _TessMaxDisp;
#endif
CBUFFER_END
sampler2D _Main;
sampler2D _NoiseMask;
sampler2D _StaticMask;
struct SurfaceDescription
{
float Alpha;
float AlphaClipThreshold;
};
VertexOutput VertexFunction(VertexInput v )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.ase_color = v.ase_color;
o.ase_texcoord1.xyz = v.ase_texcoord.xyz;
o.ase_texcoord2 = v.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.w = 0;
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = defaultVertexValue;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normalOS = v.normalOS;
float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
float3 normalWS = TransformObjectToWorldNormal(v.normalOS);
o.positionCS = TransformWorldToHClip(positionWS);
o.normalWS.xyz = normalWS;
return o;
}
#if defined(ASE_TESSELLATION)
struct VertexControl
{
float4 vertex : INTERNALTESSPOS;
float3 normalOS : NORMAL;
float4 ase_color : COLOR;
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct TessellationFactors
{
float edge[3] : SV_TessFactor;
float inside : SV_InsideTessFactor;
};
VertexControl vert ( VertexInput v )
{
VertexControl o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.vertex = v.positionOS;
o.normalOS = v.normalOS;
o.ase_color = v.ase_color;
o.ase_texcoord = v.ase_texcoord;
o.ase_texcoord1 = v.ase_texcoord1;
return o;
}
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
{
TessellationFactors o;
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(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
#elif defined(ASE_LENGTH_TESSELLATION)
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
#endif
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
return o;
}
[domain("tri")]
[partitioning("fractional_odd")]
[outputtopology("triangle_cw")]
[patchconstantfunc("TessellationFunction")]
[outputcontrolpoints(3)]
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
{
return patch[id];
}
[domain("tri")]
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
{
VertexInput o = (VertexInput) 0;
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
#if defined(ASE_PHONG_TESSELLATION)
float3 pp[3];
for (int i = 0; i < 3; ++i)
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
float phongStrength = _TessPhongStrength;
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
#endif
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
return VertexFunction(o);
}
#else
VertexOutput vert ( VertexInput v )
{
return VertexFunction( v );
}
#endif
void frag( VertexOutput IN
, out half4 outNormalWS : SV_Target0
#ifdef _WRITE_RENDERING_LAYERS
, out float4 outRenderingLayers : SV_Target1
#endif
)
{
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
float3 texCoord76 = IN.ase_texcoord1.xyz;
texCoord76.xy = IN.ase_texcoord1.xyz.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord74 = IN.ase_texcoord1.xyz.xy * _Tiling + ( ( ( texCoord76.z * _Scroll ) * _TimeParameters.x ) + _Offset );
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
float4 texCoord137 = IN.ase_texcoord2;
texCoord137.xy = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
float4 texCoord157 = IN.ase_texcoord2;
texCoord157.xy = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
float2 texCoord156 = IN.ase_texcoord1.xyz.xy * _MaskTiling + ( _MaskOffset + ( ( texCoord157.w * _TimeParameters.x ) * _MaskScroll ) );
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
float2 uv_StaticMask = IN.ase_texcoord1.xyz.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
surfaceDescription.Alpha = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
surfaceDescription.AlphaClipThreshold = 0.5;
#if _ALPHATEST_ON
clip(surfaceDescription.Alpha - surfaceDescription.AlphaClipThreshold);
#endif
#ifdef LOD_FADE_CROSSFADE
LODFadeCrossFade( IN.positionCS );
#endif
#if defined(_GBUFFER_NORMALS_OCT)
float3 normalWS = normalize(IN.normalWS);
float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms
float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1]
half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1]
outNormalWS = half4(packedNormalWS, 0.0);
#else
float3 normalWS = IN.normalWS;
outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0);
#endif
#ifdef _WRITE_RENDERING_LAYERS
uint renderingLayers = GetMeshRenderingLayer();
outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0);
#endif
}
ENDHLSL
}
}
// CustomEditor "UnityEditor.ShaderGraphUnlitGUI"
FallBack "Hidden/Shader Graph/FallbackError"
Fallback Off
}
/*ASEBEGIN
Version=19302
Node;AmplifyShaderEditor.CommentaryNode;87;164.4255,-288.6086;Inherit;False;1122.08;1253.271;Scroll;8;74;78;82;81;77;76;75;179;;1,1,1,1;0;0
Node;AmplifyShaderEditor.Vector2Node;75;225.251,169.3847;Inherit;False;Property;_Scroll;Scroll;3;0;Create;True;0;0;0;False;0;False;1,0;-1,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.TextureCoordinatesNode;76;223.2823,-11.87827;Inherit;False;0;-1;3;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.CommentaryNode;160;1302.843,700.6349;Inherit;False;781.2883;525.4138;NoiseScroll;9;156;158;159;157;161;162;163;180;182;;1,1,1,1;0;0
Node;AmplifyShaderEditor.SimpleTimeNode;179;208.8785,347.58;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;77;463.8764,57.88174;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;157;1383.586,750.6349;Inherit;False;1;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleTimeNode;180;1386.317,1130.467;Inherit;False;1;0;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;86;1321.36,-797.9218;Inherit;False;1078.309;819.3665;UVlimitation;5;80;85;84;83;109;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;146;2160.628,535.6385;Inherit;False;1444.062;1209.11;Mask;11;170;169;137;125;147;155;148;171;172;173;174;;1,1,1,1;0;0
Node;AmplifyShaderEditor.Vector2Node;81;227.2378,643.7848;Inherit;False;Property;_Offset;Offset;2;1;[Header];Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.Vector2Node;159;1385.377,954.4927;Inherit;False;Property;_MaskScroll;MaskScroll;11;0;Create;True;0;0;0;False;0;False;0,0;0,-1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;181;646.2254,56.77286;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;158;1605.095,903.4907;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;162;1644.921,1093.576;Inherit;False;Property;_MaskOffset;MaskOffset;13;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.Vector2Node;78;772.4404,-184.6765;Inherit;False;Property;_Tiling;Tiling;1;0;Create;True;0;0;0;False;0;False;1,1;0.3,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.Vector4Node;83;1367.36,-657.3679;Inherit;False;Property;_LimitUVRange;LimitUVRange;4;1;[Header];Create;True;1;LimitUV;0;0;False;0;False;0,1,0,1;0,1,0,1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;173;2365.489,1175.01;Inherit;False;Constant;_Float3;Float 3;19;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;174;2405.195,1359.424;Inherit;False;Constant;_Float5;Float 5;19;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;170;2189.666,1281.503;Inherit;False;Property;_Feather;Feather;14;0;Create;True;0;0;0;False;0;False;0;0.371;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;82;842.7636,109.001;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;182;1745.024,966.5553;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.Vector2Node;161;1608.19,748.5315;Inherit;False;Property;_MaskTiling;MaskTiling;12;0;Create;True;0;0;0;False;0;False;0,0;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.DynamicAppendNode;84;1594.783,-747.9218;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.DynamicAppendNode;85;1595.883,-532.4218;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.TextureCoordinatesNode;74;1020.081,-44.5886;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.SimpleSubtractOpNode;171;2530.214,1162.544;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;169;2557.224,1287.075;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;137;2261.345,1453.058;Inherit;False;1;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleAddOpNode;163;1940.046,999.2209;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;156;1842.131,810.5052;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.ClampOpNode;80;1889.626,-389.0704;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT2;1,1;False;1;FLOAT2;0
Node;AmplifyShaderEditor.LerpOp;172;2698.201,1299.677;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;167;2765.758,1850.221;Inherit;False;715.4617;522.7068;StaticMask;3;166;165;164;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;98;2929.765,-423.1228;Inherit;False;527.905;715.6232;VertexColor;5;97;95;96;120;122;;1,1,1,1;0;0
Node;AmplifyShaderEditor.ToggleSwitchNode;109;2179.447,-325.5556;Inherit;False;Property;_LimitUV;LimitUV;5;0;Create;True;0;0;0;False;0;False;0;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;175;2984.314,1256.771;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;176;2970.993,1420.424;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;125;2604.117,826.5101;Inherit;True;Property;_NoiseMask;NoiseMask;9;2;[Header];[NoScaleOffset];Create;True;1;Mask;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;73;2583.71,-121.8407;Inherit;True;Property;_Main;Main;0;2;[Header];[NoScaleOffset];Create;True;1;Main;0;0;False;0;False;-1;None;4e3951c538fc8a647a4a10a99b480987;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.VertexColorNode;96;2956.925,-172.8337;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;148;2824.794,646.5159;Inherit;False;Constant;_Float2;Float 2;12;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;164;2815.758,1900.221;Inherit;True;Property;_StaticMask;StaticMask;15;1;[Header];Create;True;1;StaticMask;0;0;False;0;False;-1;None;8cc658b6018e2034386528e65b607b64;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.Vector2Node;166;2867.849,2130.773;Inherit;False;Property;_SmoothStep;SmoothStep;16;0;Create;True;0;0;0;False;0;False;0,1;0,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.SmoothstepOpNode;155;3270.459,987.067;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;107;-97.24704,1076.068;Inherit;False;981.2;834.1053;StretchUV;9;119;106;114;118;103;102;115;123;124;;1,1,1,1;0;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;97;3214.735,62.38358;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SmoothstepOpNode;165;3214.41,1984.56;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.ToggleSwitchNode;147;3171.941,733.5972;Inherit;False;Property;_Mask;Mask;10;0;Create;True;0;0;0;False;0;False;0;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;120;2967.5,-290.9236;Inherit;False;1;-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.RangedFloatNode;122;2976.133,-363.7119;Inherit;False;Constant;_Float0;Float 0;8;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;121;3237.433,-342.9119;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;115;-77.15573,1593.25;Inherit;False;Property;_StretchUVDes;StretchUVDes;6;1;[Header];Create;True;1;StretchUV;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.TextureCoordinatesNode;102;-73.93272,1408.671;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.SimpleSubtractOpNode;103;175.7717,1477.859;Inherit;False;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.Vector2Node;118;207.5538,1247.947;Inherit;False;Property;_StretchMultiplier;StretchMultiplier;7;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.TextureCoordinatesNode;119;115.9227,1689.141;Inherit;False;0;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;114;419.421,1426.666;Inherit;False;3;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.DynamicAppendNode;106;565.1396,1403.484;Inherit;False;FLOAT2;4;0;FLOAT2;0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.RangedFloatNode;124;469.7593,1201.906;Inherit;False;Constant;_Float1;Float 1;9;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.ToggleSwitchNode;123;641.1641,1216.096;Inherit;False;Property;_Stretch;Stretch;8;0;Create;True;0;0;0;False;0;False;0;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;95;3281.31,-139.3132;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;126;3540.395,90.70631;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;183;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;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;185;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;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;186;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;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;187;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;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;188;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;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;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=Universal2D;False;False;0;;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;189;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;SceneSelectionPass;0;6;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;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;190;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;ScenePickingPass;0;7;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;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;191;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;DepthNormals;0;8;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;True;5;True;12;all;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;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormalsOnly;False;False;0;;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;192;3775.039,-172.4037;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;1;New Amplify Shader;2992e84f91cbeb14eab234972e07ea9d;True;DepthNormalsOnly;0;9;DepthNormalsOnly;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Unlit;True;5;True;12;all;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;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormalsOnly;False;True;9;d3d11;metal;vulkan;xboxone;xboxseries;playstation;ps4;ps5;switch;0;;0;0;Standard;0;False;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;184;3775.039,-172.4037;Float;False;True;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;CommonParticleLoop;2992e84f91cbeb14eab234972e07ea9d;True;Forward;0;1;Forward;8;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;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;False;False;False;True;4;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;UniversalMaterialType=Unlit;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;2;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalForwardOnly;False;False;0;;0;0;Standard;21;Surface;1;638465772674518538; Blend;0;0;Two Sided;0;638465772742131491;Forward Only;0;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;GPU Instancing;1;0;LOD CrossFade;1;0;Built-in Fog;1;0;Meta Pass;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;Vertex Position,InvertActionOnDeselection;1;0;0;10;False;True;True;True;False;False;True;True;True;False;False;;False;0
WireConnection;77;0;76;3
WireConnection;77;1;75;0
WireConnection;181;0;77;0
WireConnection;181;1;179;0
WireConnection;158;0;157;4
WireConnection;158;1;180;0
WireConnection;82;0;181;0
WireConnection;82;1;81;0
WireConnection;182;0;158;0
WireConnection;182;1;159;0
WireConnection;84;0;83;1
WireConnection;84;1;83;3
WireConnection;85;0;83;2
WireConnection;85;1;83;4
WireConnection;74;0;78;0
WireConnection;74;1;82;0
WireConnection;171;0;173;0
WireConnection;171;1;170;0
WireConnection;169;0;174;0
WireConnection;169;1;170;0
WireConnection;163;0;162;0
WireConnection;163;1;182;0
WireConnection;156;0;161;0
WireConnection;156;1;163;0
WireConnection;80;0;74;0
WireConnection;80;1;84;0
WireConnection;80;2;85;0
WireConnection;172;0;171;0
WireConnection;172;1;169;0
WireConnection;172;2;137;3
WireConnection;109;0;74;0
WireConnection;109;1;80;0
WireConnection;175;0;172;0
WireConnection;175;1;170;0
WireConnection;176;0;172;0
WireConnection;176;1;170;0
WireConnection;125;1;156;0
WireConnection;73;1;109;0
WireConnection;155;0;125;1
WireConnection;155;1;175;0
WireConnection;155;2;176;0
WireConnection;97;0;96;4
WireConnection;97;1;73;4
WireConnection;165;0;164;1
WireConnection;165;1;166;1
WireConnection;165;2;166;2
WireConnection;147;0;148;0
WireConnection;147;1;155;0
WireConnection;121;0;122;0
WireConnection;121;1;120;1
WireConnection;103;0;115;0
WireConnection;103;1;102;0
WireConnection;114;0;118;0
WireConnection;114;1;103;0
WireConnection;114;2;119;4
WireConnection;106;0;114;0
WireConnection;123;0;124;0
WireConnection;123;1;106;0
WireConnection;95;0;96;0
WireConnection;95;1;73;0
WireConnection;95;2;121;0
WireConnection;126;0;97;0
WireConnection;126;1;147;0
WireConnection;126;2;165;0
WireConnection;184;2;95;0
WireConnection;184;3;126;0
ASEEND*/
//CHKSM=BA5A8911D164EF5972DAC76D89B5D4865F563A77