2581 lines
108 KiB
GLSL
2581 lines
108 KiB
GLSL
// Made with Amplify Shader Editor v1.9.3.2
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "EnergyExpSphere"
|
|
{
|
|
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) = 1
|
|
[Header(StretchUV)]_StretchUVDes("StretchUVDes", Vector) = (0,0,0,0)
|
|
_StretchMultiplier("StretchMultiplier", Vector) = (0,0,0,0)
|
|
[Toggle]_Stretch("Stretch", Float) = 1
|
|
[Header(Mask)][NoScaleOffset]_NoiseMask("NoiseMask", 2D) = "white" {}
|
|
[Toggle]_Mask("Mask", Float) = 1
|
|
_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)
|
|
_FresnelScale("FresnelScale", Float) = 1
|
|
_BackColor("BackColor", Color) = (0,0,0,0)
|
|
_TextureSample0("Texture Sample 0", 2D) = "white" {}
|
|
[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 Back
|
|
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 "ExtraPrePass"
|
|
|
|
|
|
Blend SrcAlpha OneMinusSrcAlpha
|
|
Cull Back
|
|
ZWrite On
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
ColorMask RGBA
|
|
|
|
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define ASE_FOG 1
|
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#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/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.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;
|
|
|
|
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
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BackColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _TextureSample0_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Mask;
|
|
float _Feather;
|
|
float _FresnelScale;
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
#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;
|
|
|
|
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;
|
|
|
|
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;
|
|
|
|
#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 Color = _BackColor.rgb;
|
|
float Alpha = _BackColor.a;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip( Alpha - AlphaClipThreshold );
|
|
#endif
|
|
|
|
#ifdef ASE_FOG
|
|
Color = MixFog( Color, IN.fogFactor );
|
|
#endif
|
|
|
|
#ifdef LOD_FADE_CROSSFADE
|
|
LODFadeCrossFade( IN.positionCS );
|
|
#endif
|
|
|
|
return half4( Color, Alpha );
|
|
}
|
|
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 140010
|
|
|
|
|
|
#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_WORLD_POSITION
|
|
#define ASE_NEEDS_VERT_NORMAL
|
|
#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;
|
|
float4 ase_texcoord5 : TEXCOORD5;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BackColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _TextureSample0_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Mask;
|
|
float _Feather;
|
|
float _FresnelScale;
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
sampler2D _TextureSample0;
|
|
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);
|
|
|
|
float3 ase_worldNormal = TransformObjectToWorldNormal(v.normalOS);
|
|
o.ase_texcoord4.xyz = ase_worldNormal;
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord3 = v.ase_texcoord;
|
|
o.ase_texcoord5 = v.ase_texcoord1;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
o.ase_texcoord4.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
|
|
|
|
float2 uv_TextureSample0 = IN.ase_texcoord3.xy * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
|
|
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition );
|
|
ase_worldViewDir = normalize(ase_worldViewDir);
|
|
float3 ase_worldNormal = IN.ase_texcoord4.xyz;
|
|
float2 texCoord205 = IN.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float fresnelNdotV179 = dot( ase_worldNormal, ase_worldViewDir );
|
|
float fresnelNode179 = ( 0.0 + _FresnelScale * pow( 1.0 - fresnelNdotV179, texCoord205.y ) );
|
|
float4 myVarName199 = ( IN.ase_color.a * tex2D( _TextureSample0, uv_TextureSample0 ) * fresnelNode179 );
|
|
float2 texCoord120 = IN.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 texCoord76 = IN.ase_texcoord3.xyz;
|
|
texCoord76.xy = IN.ase_texcoord3.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_0 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord3;
|
|
texCoord119.xy = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord3.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_0 )) );
|
|
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_texcoord5;
|
|
texCoord137.xy = IN.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord5;
|
|
texCoord157.xy = IN.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord3.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord3.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float clampResult194 = clamp( ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 ) , 0.0 , 1.0 );
|
|
float4 appendResult145 = (float4(( ( 1.0 + texCoord120.x ) * tex2DNode73 * IN.ase_color ).rgb , clampResult194));
|
|
float4 temp_output_192_0 = ( myVarName199 + ( appendResult145.w > 0.02 ? appendResult145 : myVarName199 ) );
|
|
|
|
float3 BakedAlbedo = 0;
|
|
float3 BakedEmission = 0;
|
|
float3 Color = temp_output_192_0.rgb;
|
|
float Alpha = temp_output_192_0.a;
|
|
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 140010
|
|
|
|
|
|
#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
|
|
|
|
#define ASE_NEEDS_FRAG_WORLD_POSITION
|
|
#define ASE_NEEDS_VERT_NORMAL
|
|
#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
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
float4 ase_texcoord4 : TEXCOORD4;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BackColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _TextureSample0_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Mask;
|
|
float _Feather;
|
|
float _FresnelScale;
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
sampler2D _TextureSample0;
|
|
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 );
|
|
|
|
float3 ase_worldNormal = TransformObjectToWorldNormal(v.normalOS);
|
|
o.ase_texcoord3.xyz = ase_worldNormal;
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord2 = v.ase_texcoord;
|
|
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 );
|
|
|
|
#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
|
|
|
|
float2 uv_TextureSample0 = IN.ase_texcoord2.xy * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
|
|
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition );
|
|
ase_worldViewDir = normalize(ase_worldViewDir);
|
|
float3 ase_worldNormal = IN.ase_texcoord3.xyz;
|
|
float2 texCoord205 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float fresnelNdotV179 = dot( ase_worldNormal, ase_worldViewDir );
|
|
float fresnelNode179 = ( 0.0 + _FresnelScale * pow( 1.0 - fresnelNdotV179, texCoord205.y ) );
|
|
float4 myVarName199 = ( IN.ase_color.a * tex2D( _TextureSample0, uv_TextureSample0 ) * fresnelNode179 );
|
|
float2 texCoord120 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 texCoord76 = IN.ase_texcoord2.xyz;
|
|
texCoord76.xy = IN.ase_texcoord2.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_0 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord2;
|
|
texCoord119.xy = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord2.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_0 )) );
|
|
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_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_texcoord2.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord2.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float clampResult194 = clamp( ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 ) , 0.0 , 1.0 );
|
|
float4 appendResult145 = (float4(( ( 1.0 + texCoord120.x ) * tex2DNode73 * IN.ase_color ).rgb , clampResult194));
|
|
float4 temp_output_192_0 = ( myVarName199 + ( appendResult145.w > 0.02 ? appendResult145 : myVarName199 ) );
|
|
|
|
|
|
float Alpha = temp_output_192_0.a;
|
|
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 140010
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
#define ASE_NEEDS_FRAG_WORLD_POSITION
|
|
#define ASE_NEEDS_VERT_NORMAL
|
|
#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
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
float4 ase_texcoord4 : TEXCOORD4;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BackColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _TextureSample0_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Mask;
|
|
float _Feather;
|
|
float _FresnelScale;
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
sampler2D _TextureSample0;
|
|
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);
|
|
|
|
float3 ase_worldNormal = TransformObjectToWorldNormal(v.normalOS);
|
|
o.ase_texcoord3.xyz = ase_worldNormal;
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord2 = v.ase_texcoord;
|
|
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 );
|
|
|
|
#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
|
|
|
|
float2 uv_TextureSample0 = IN.ase_texcoord2.xy * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
|
|
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition );
|
|
ase_worldViewDir = normalize(ase_worldViewDir);
|
|
float3 ase_worldNormal = IN.ase_texcoord3.xyz;
|
|
float2 texCoord205 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float fresnelNdotV179 = dot( ase_worldNormal, ase_worldViewDir );
|
|
float fresnelNode179 = ( 0.0 + _FresnelScale * pow( 1.0 - fresnelNdotV179, texCoord205.y ) );
|
|
float4 myVarName199 = ( IN.ase_color.a * tex2D( _TextureSample0, uv_TextureSample0 ) * fresnelNode179 );
|
|
float2 texCoord120 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 texCoord76 = IN.ase_texcoord2.xyz;
|
|
texCoord76.xy = IN.ase_texcoord2.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_0 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord2;
|
|
texCoord119.xy = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord2.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_0 )) );
|
|
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_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_texcoord2.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord2.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float clampResult194 = clamp( ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 ) , 0.0 , 1.0 );
|
|
float4 appendResult145 = (float4(( ( 1.0 + texCoord120.x ) * tex2DNode73 * IN.ase_color ).rgb , clampResult194));
|
|
float4 temp_output_192_0 = ( myVarName199 + ( appendResult145.w > 0.02 ? appendResult145 : myVarName199 ) );
|
|
|
|
|
|
float Alpha = temp_output_192_0.a;
|
|
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 140010
|
|
|
|
|
|
|
|
|
|
#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"
|
|
|
|
#define ASE_NEEDS_VERT_NORMAL
|
|
#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;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
float4 ase_texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BackColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _TextureSample0_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Mask;
|
|
float _Feather;
|
|
float _FresnelScale;
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
sampler2D _TextureSample0;
|
|
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);
|
|
|
|
float3 ase_worldPos = TransformObjectToWorld( (v.positionOS).xyz );
|
|
o.ase_texcoord1.xyz = ase_worldPos;
|
|
float3 ase_worldNormal = TransformObjectToWorldNormal(v.normalOS);
|
|
o.ase_texcoord2.xyz = ase_worldNormal;
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_texcoord3 = v.ase_texcoord1;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
o.ase_texcoord1.w = 0;
|
|
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 );
|
|
|
|
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;
|
|
|
|
float2 uv_TextureSample0 = IN.ase_texcoord.xy * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
|
|
float3 ase_worldPos = IN.ase_texcoord1.xyz;
|
|
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - ase_worldPos );
|
|
ase_worldViewDir = normalize(ase_worldViewDir);
|
|
float3 ase_worldNormal = IN.ase_texcoord2.xyz;
|
|
float2 texCoord205 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float fresnelNdotV179 = dot( ase_worldNormal, ase_worldViewDir );
|
|
float fresnelNode179 = ( 0.0 + _FresnelScale * pow( 1.0 - fresnelNdotV179, texCoord205.y ) );
|
|
float4 myVarName199 = ( IN.ase_color.a * tex2D( _TextureSample0, uv_TextureSample0 ) * fresnelNode179 );
|
|
float2 texCoord120 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 texCoord76 = IN.ase_texcoord.xyz;
|
|
texCoord76.xy = IN.ase_texcoord.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_0 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord;
|
|
texCoord119.xy = IN.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_0 )) );
|
|
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_texcoord.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float clampResult194 = clamp( ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 ) , 0.0 , 1.0 );
|
|
float4 appendResult145 = (float4(( ( 1.0 + texCoord120.x ) * tex2DNode73 * IN.ase_color ).rgb , clampResult194));
|
|
float4 temp_output_192_0 = ( myVarName199 + ( appendResult145.w > 0.02 ? appendResult145 : myVarName199 ) );
|
|
|
|
|
|
surfaceDescription.Alpha = temp_output_192_0.a;
|
|
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 140010
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
#define ASE_NEEDS_VERT_NORMAL
|
|
#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;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
float4 ase_texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BackColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _TextureSample0_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Mask;
|
|
float _Feather;
|
|
float _FresnelScale;
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
sampler2D _TextureSample0;
|
|
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);
|
|
|
|
float3 ase_worldPos = TransformObjectToWorld( (v.positionOS).xyz );
|
|
o.ase_texcoord1.xyz = ase_worldPos;
|
|
float3 ase_worldNormal = TransformObjectToWorldNormal(v.normalOS);
|
|
o.ase_texcoord2.xyz = ase_worldNormal;
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_texcoord3 = v.ase_texcoord1;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
o.ase_texcoord1.w = 0;
|
|
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 );
|
|
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;
|
|
|
|
float2 uv_TextureSample0 = IN.ase_texcoord.xy * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
|
|
float3 ase_worldPos = IN.ase_texcoord1.xyz;
|
|
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - ase_worldPos );
|
|
ase_worldViewDir = normalize(ase_worldViewDir);
|
|
float3 ase_worldNormal = IN.ase_texcoord2.xyz;
|
|
float2 texCoord205 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float fresnelNdotV179 = dot( ase_worldNormal, ase_worldViewDir );
|
|
float fresnelNode179 = ( 0.0 + _FresnelScale * pow( 1.0 - fresnelNdotV179, texCoord205.y ) );
|
|
float4 myVarName199 = ( IN.ase_color.a * tex2D( _TextureSample0, uv_TextureSample0 ) * fresnelNode179 );
|
|
float2 texCoord120 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 texCoord76 = IN.ase_texcoord.xyz;
|
|
texCoord76.xy = IN.ase_texcoord.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_0 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord;
|
|
texCoord119.xy = IN.ase_texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_0 )) );
|
|
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_texcoord.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float clampResult194 = clamp( ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 ) , 0.0 , 1.0 );
|
|
float4 appendResult145 = (float4(( ( 1.0 + texCoord120.x ) * tex2DNode73 * IN.ase_color ).rgb , clampResult194));
|
|
float4 temp_output_192_0 = ( myVarName199 + ( appendResult145.w > 0.02 ? appendResult145 : myVarName199 ) );
|
|
|
|
|
|
surfaceDescription.Alpha = temp_output_192_0.a;
|
|
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 140010
|
|
|
|
|
|
#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
|
|
|
|
#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;
|
|
float3 normalWS : TEXCOORD0;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
float4 ase_texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _BackColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _TextureSample0_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Mask;
|
|
float _Feather;
|
|
float _FresnelScale;
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
sampler2D _TextureSample0;
|
|
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);
|
|
|
|
float3 ase_worldPos = TransformObjectToWorld( (v.positionOS).xyz );
|
|
o.ase_texcoord2.xyz = ase_worldPos;
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord1 = v.ase_texcoord;
|
|
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 );
|
|
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;
|
|
|
|
float2 uv_TextureSample0 = IN.ase_texcoord1.xy * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
|
|
float3 ase_worldPos = IN.ase_texcoord2.xyz;
|
|
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - ase_worldPos );
|
|
ase_worldViewDir = normalize(ase_worldViewDir);
|
|
float2 texCoord205 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float fresnelNdotV179 = dot( IN.normalWS, ase_worldViewDir );
|
|
float fresnelNode179 = ( 0.0 + _FresnelScale * pow( 1.0 - fresnelNdotV179, texCoord205.y ) );
|
|
float4 myVarName199 = ( IN.ase_color.a * tex2D( _TextureSample0, uv_TextureSample0 ) * fresnelNode179 );
|
|
float2 texCoord120 = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 texCoord76 = IN.ase_texcoord1.xyz;
|
|
texCoord76.xy = IN.ase_texcoord1.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_0 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord1;
|
|
texCoord119.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord1.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_0 )) );
|
|
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_texcoord1.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord1.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float clampResult194 = clamp( ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 ) , 0.0 , 1.0 );
|
|
float4 appendResult145 = (float4(( ( 1.0 + texCoord120.x ) * tex2DNode73 * IN.ase_color ).rgb , clampResult194));
|
|
float4 temp_output_192_0 = ( myVarName199 + ( appendResult145.w > 0.02 ? appendResult145 : myVarName199 ) );
|
|
|
|
|
|
surfaceDescription.Alpha = temp_output_192_0.a;
|
|
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;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.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.54;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.CommentaryNode;87;164.4255,-288.6086;Inherit;False;1122.08;1253.271;Scroll;7;74;78;82;81;77;76;75;;1,1,1,1;0;0
|
|
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.CommentaryNode;160;1302.843,700.6349;Inherit;False;781.2883;525.4138;NoiseScroll;7;156;158;159;157;161;162;163;;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.Vector2Node;75;221.351,191.4847;Inherit;False;Property;_Scroll;Scroll;3;0;Create;True;0;0;0;False;0;False;1,0;0,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.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.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.SimpleMultiplyOpNode;77;531.4758,50.08174;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.Vector2Node;81;213.7936,341.0704;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.ToggleSwitchNode;123;641.1641,1216.096;Inherit;False;Property;_Stretch;Stretch;8;0;Create;True;0;0;0;False;0;False;1;True;2;0;FLOAT2;0,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.Vector2Node;159;1372.48,1010.377;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.SimpleAddOpNode;82;787.2185,100.1137;Inherit;False;3;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT2;0
|
|
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;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,3,0,1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;158;1650.095,937.4907;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;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;1.51,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
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;2207.666,1316.503;Inherit;False;Property;_Feather;Feather;14;0;Create;True;0;0;0;False;0;False;0;0.278;0;1;0;1;FLOAT;0
|
|
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.Vector2Node;161;1608.19,748.5315;Inherit;False;Property;_MaskTiling;MaskTiling;12;0;Create;True;0;0;0;False;0;False;0,0;0.5,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;163;1904.504,1022.324;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;137;2261.345,1507.165;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.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.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.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.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;98;3090.025,-536.2324;Inherit;False;601.9905;998.6679;VertexColor;6;121;95;97;96;122;120;;1,1,1,1;0;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.ToggleSwitchNode;109;2179.447,-325.5556;Inherit;False;Property;_LimitUV;LimitUV;5;0;Create;True;0;0;0;False;0;False;1;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;2827.966,834.0557;Inherit;True;Property;_NoiseMask;NoiseMask;9;2;[Header];[NoScaleOffset];Create;True;1;Mask;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.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;7b6d64860c007884ea8aeb170b70d160;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;3114.111,-285.9428;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;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.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;185;3190.522,-1373.765;Inherit;False;1263.672;858.125;Comment;7;199;210;179;205;181;215;216;;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;120;3127.76,-404.0327;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;3136.393,-476.821;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.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;1;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;97;3408.337,212.0015;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;181;3227.23,-1111.672;Inherit;False;Property;_FresnelScale;FresnelScale;17;0;Create;True;0;0;0;False;0;False;1;0.89;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;205;3209.444,-1020.033;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.SimpleAddOpNode;121;3355.341,-456.593;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;126;3595.287,453.4724;Inherit;True;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.FresnelNode;179;3444.263,-1128.889;Inherit;True;Standard;WorldNormal;ViewDir;False;False;5;0;FLOAT3;0,0,1;False;4;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;5;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.VertexColorNode;210;3469.235,-1313.158;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SamplerNode;216;3376.689,-849.959;Inherit;True;Property;_TextureSample0;Texture Sample 0;19;0;Create;True;0;0;0;False;0;False;-1;None;1c1d8a4f9c8b02b48a00e94fe23debd6;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.SimpleMultiplyOpNode;95;3460.323,-196.6636;Inherit;True;3;3;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ClampOpNode;194;3768.789,305.6582;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;215;3931.917,-1274.812;Inherit;True;3;3;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;145;3957.888,76.4185;Inherit;True;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
|
|
Node;AmplifyShaderEditor.RegisterLocalVarNode;199;4251.059,-1249.301;Inherit;False;myVarName;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.BreakToComponentsNode;207;4232.617,58.95951;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.GetLocalVarNode;200;4128.698,-351.4824;Inherit;False;199;myVarName;1;0;OBJECT;;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.Compare;206;4464.412,119.1469;Inherit;False;2;4;0;FLOAT;0;False;1;FLOAT;0.02;False;2;FLOAT4;0,0,0,0;False;3;COLOR;0,0,0,0;False;1;FLOAT4;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;192;4812.337,-57.42535;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ColorNode;209;4274.917,-1524.628;Inherit;False;Property;_BackColor;BackColor;18;0;Create;True;0;0;0;False;0;False;0,0,0,0;0,0.1843911,0.4245283,0.254902;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ColorNode;208;4186.282,368.8572;Inherit;False;Constant;_Color0;Color 0;19;0;Create;True;0;0;0;False;0;False;0,0,0,0;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.BreakToComponentsNode;227;5008.38,128.1231;Inherit;False;COLOR;1;0;COLOR;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.TemplateMultiPassMasterNode;219;4676.583,-1250.358;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;220;4676.583,-1250.358;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;221;4676.583,-1250.358;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;222;4676.583,-1250.358;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;223;4676.583,-1250.358;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;224;4676.583,-1250.358;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;225;4676.583,-1250.358;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;226;4676.583,-1250.358;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;218;5137.935,-14.92027;Float;False;True;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;EnergyExpSphere;2992e84f91cbeb14eab234972e07ea9d;True;Forward;0;1;Forward;8;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=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;638476430471586601; Blend;0;0;Two Sided;1;0;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;1;638476429991213893;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;True;True;True;True;False;False;True;True;True;False;False;;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;217;4712.803,-1492.555;Float;False;False;-1;2;UnityEditor.ShaderGraphUnlitGUI;0;13;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;True;True;2;5;False;;10;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
|
|
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;77;0;76;3
|
|
WireConnection;77;1;75;0
|
|
WireConnection;123;0;124;0
|
|
WireConnection;123;1;106;0
|
|
WireConnection;82;0;77;0
|
|
WireConnection;82;1;81;0
|
|
WireConnection;82;2;123;0
|
|
WireConnection;158;0;157;4
|
|
WireConnection;158;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;163;0;162;0
|
|
WireConnection;163;1;158;0
|
|
WireConnection;171;0;173;0
|
|
WireConnection;171;1;170;0
|
|
WireConnection;169;0;174;0
|
|
WireConnection;169;1;170;0
|
|
WireConnection;80;0;74;0
|
|
WireConnection;80;1;84;0
|
|
WireConnection;80;2;85;0
|
|
WireConnection;156;0;161;0
|
|
WireConnection;156;1;163;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;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;97;0;96;4
|
|
WireConnection;97;1;73;4
|
|
WireConnection;121;0;122;0
|
|
WireConnection;121;1;120;1
|
|
WireConnection;126;0;97;0
|
|
WireConnection;126;1;147;0
|
|
WireConnection;126;2;165;0
|
|
WireConnection;179;2;181;0
|
|
WireConnection;179;3;205;2
|
|
WireConnection;95;0;121;0
|
|
WireConnection;95;1;73;0
|
|
WireConnection;95;2;96;0
|
|
WireConnection;194;0;126;0
|
|
WireConnection;215;0;210;4
|
|
WireConnection;215;1;216;0
|
|
WireConnection;215;2;179;0
|
|
WireConnection;145;0;95;0
|
|
WireConnection;145;3;194;0
|
|
WireConnection;199;0;215;0
|
|
WireConnection;207;0;145;0
|
|
WireConnection;206;0;207;3
|
|
WireConnection;206;2;145;0
|
|
WireConnection;206;3;200;0
|
|
WireConnection;192;0;200;0
|
|
WireConnection;192;1;206;0
|
|
WireConnection;227;0;192;0
|
|
WireConnection;218;2;192;0
|
|
WireConnection;218;3;227;3
|
|
WireConnection;217;0;209;0
|
|
WireConnection;217;1;209;4
|
|
ASEEND*/
|
|
//CHKSM=ADF7E60EBF7FC84B1F585909CC24F39904B1C080 |