4178 lines
164 KiB
GLSL
4178 lines
164 KiB
GLSL
// Made with Amplify Shader Editor v1.9.3.2
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "Smoke"
|
|
{
|
|
Properties
|
|
{
|
|
[HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
|
|
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
|
|
_ToonRamp("Toon Ramp", 2D) = "white" {}
|
|
[Header(Main)][NoScaleOffset]_Main("Main", 2D) = "white" {}
|
|
_Tiling("Tiling", Vector) = (1,1,0,0)
|
|
_Offset("Offset", Vector) = (0,0,0,0)
|
|
_Scroll("Scroll", Vector) = (1,0,0,0)
|
|
[Header(LimitUV)]_LimitUVRange("LimitUVRange", Vector) = (0,1,0,1)
|
|
[Toggle]_LimitUV("LimitUV", Float) = 0
|
|
[Header(StretchUV)]_StretchUVDes("StretchUVDes", Vector) = (0,0,0,0)
|
|
_StretchMultiplier("StretchMultiplier", Vector) = (0,0,0,0)
|
|
[Toggle]_Stretch("Stretch", Float) = 0
|
|
[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)
|
|
[HDR]_FireColor("FireColor", Color) = (0,0,0,0)
|
|
_FireTexture("FireTexture", 2D) = "white" {}
|
|
_Feather1("Feather", Range( 0 , 1)) = 0
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
|
|
|
|
//_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5
|
|
//_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1
|
|
//_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5
|
|
//_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2
|
|
//_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9
|
|
//_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1
|
|
//_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5
|
|
//_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5
|
|
//_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
|
|
//_TessMin( "Tess Min Distance", Float ) = 10
|
|
//_TessMax( "Tess Max Distance", Float ) = 25
|
|
//_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16
|
|
//_TessMaxDisp( "Tess Max Displacement", Float ) = 25
|
|
|
|
[HideInInspector][ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
|
|
[HideInInspector][ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1.0
|
|
[HideInInspector][ToggleOff] _ReceiveShadows("Receive Shadows", Float) = 1.0
|
|
|
|
[HideInInspector] _QueueOffset("_QueueOffset", Float) = 0
|
|
[HideInInspector] _QueueControl("_QueueControl", Float) = -1
|
|
|
|
[HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
|
|
[HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
|
|
[HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
LOD 0
|
|
|
|
|
|
|
|
Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Transparent" "Queue"="Transparent" "UniversalMaterialType"="Lit" }
|
|
|
|
Cull Back
|
|
ZWrite Off
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
AlphaToMask Off
|
|
|
|
|
|
|
|
HLSLINCLUDE
|
|
#pragma target 4.5
|
|
#pragma prefer_hlslcc gles
|
|
// ensure rendering platforms toggle list is visible
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl"
|
|
|
|
#ifndef ASE_TESS_FUNCS
|
|
#define ASE_TESS_FUNCS
|
|
float4 FixedTess( float tessValue )
|
|
{
|
|
return tessValue;
|
|
}
|
|
|
|
float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
|
|
{
|
|
float3 wpos = mul(o2w,vertex).xyz;
|
|
float dist = distance (wpos, cameraPos);
|
|
float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
|
|
return f;
|
|
}
|
|
|
|
float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
|
|
{
|
|
float4 tess;
|
|
tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
|
|
tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
|
|
tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
|
|
tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
|
|
return tess;
|
|
}
|
|
|
|
float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
|
|
{
|
|
float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
|
|
float len = distance(wpos0, wpos1);
|
|
float f = max(len * scParams.y / (edgeLen * dist), 1.0);
|
|
return f;
|
|
}
|
|
|
|
float DistanceFromPlane (float3 pos, float4 plane)
|
|
{
|
|
float d = dot (float4(pos,1.0f), plane);
|
|
return d;
|
|
}
|
|
|
|
bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
|
|
{
|
|
float4 planeTest;
|
|
planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
|
|
planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
|
|
planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
|
|
planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
|
|
return !all (planeTest);
|
|
}
|
|
|
|
float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
|
|
{
|
|
float3 f;
|
|
f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
|
|
f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
|
|
f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
|
|
|
|
return CalcTriEdgeTessFactors (f);
|
|
}
|
|
|
|
float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
|
|
{
|
|
float3 pos0 = mul(o2w,v0).xyz;
|
|
float3 pos1 = mul(o2w,v1).xyz;
|
|
float3 pos2 = mul(o2w,v2).xyz;
|
|
float4 tess;
|
|
tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
|
|
tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
|
|
tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
|
|
tess.w = (tess.x + tess.y + tess.z) / 3.0f;
|
|
return tess;
|
|
}
|
|
|
|
float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
|
|
{
|
|
float3 pos0 = mul(o2w,v0).xyz;
|
|
float3 pos1 = mul(o2w,v1).xyz;
|
|
float3 pos2 = mul(o2w,v2).xyz;
|
|
float4 tess;
|
|
|
|
if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
|
|
{
|
|
tess = 0.0f;
|
|
}
|
|
else
|
|
{
|
|
tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
|
|
tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
|
|
tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
|
|
tess.w = (tess.x + tess.y + tess.z) / 3.0f;
|
|
}
|
|
return tess;
|
|
}
|
|
#endif //ASE_TESS_FUNCS
|
|
ENDHLSL
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "Forward"
|
|
Tags { "LightMode"="UniversalForward" }
|
|
|
|
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
|
ZWrite On
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
ColorMask RGBA
|
|
|
|
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#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 _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
#pragma shader_feature_local _RECEIVE_SHADOWS_OFF
|
|
#pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
|
|
#pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
|
|
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
|
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
|
|
|
|
|
#pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
|
|
|
|
|
|
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
|
|
|
|
|
|
|
|
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
|
|
|
|
|
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
|
|
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
|
|
#pragma multi_compile _ _LIGHT_LAYERS
|
|
#pragma multi_compile_fragment _ _LIGHT_COOKIES
|
|
#pragma multi_compile _ _FORWARD_PLUS
|
|
|
|
|
|
|
|
|
|
|
|
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
|
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile_fragment _ DEBUG_DISPLAY
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS SHADERPASS_FORWARD
|
|
|
|
|
|
#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"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
|
|
#endif
|
|
|
|
#if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
|
|
#define ENABLE_TERRAIN_PERPIXEL_NORMAL
|
|
#endif
|
|
|
|
#define ASE_NEEDS_FRAG_WORLD_NORMAL
|
|
#define ASE_NEEDS_VERT_TEXTURE_COORDINATES1
|
|
#define ASE_NEEDS_FRAG_WORLD_POSITION
|
|
#define ASE_NEEDS_FRAG_SHADOWCOORDS
|
|
#define ASE_NEEDS_FRAG_COLOR
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
|
|
|
|
|
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
|
|
#define ASE_SV_DEPTH SV_DepthLessEqual
|
|
#define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
|
|
#else
|
|
#define ASE_SV_DEPTH SV_Depth
|
|
#define ASE_SV_POSITION_QUALIFIERS
|
|
#endif
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 texcoord : TEXCOORD0;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 clipPosV : TEXCOORD0;
|
|
float4 lightmapUVOrVertexSH : TEXCOORD1;
|
|
half4 fogFactorAndVertexLight : TEXCOORD2;
|
|
float4 tSpace0 : TEXCOORD3;
|
|
float4 tSpace1 : TEXCOORD4;
|
|
float4 tSpace2 : TEXCOORD5;
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord : TEXCOORD6;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV : TEXCOORD7;
|
|
#endif
|
|
float4 ase_texcoord8 : TEXCOORD8;
|
|
float4 ase_texcoord9 : TEXCOORD9;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _FireTexture;
|
|
sampler2D _Main;
|
|
sampler2D _ToonRamp;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
float3 ASEIndirectDiffuse( float2 uvStaticLightmap, float3 normalWS )
|
|
{
|
|
#ifdef LIGHTMAP_ON
|
|
return SampleLightmap( uvStaticLightmap, normalWS );
|
|
#else
|
|
return SampleSH(normalWS);
|
|
#endif
|
|
}
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
o.ase_texcoord8 = v.texcoord1;
|
|
o.ase_texcoord9 = v.texcoord;
|
|
o.ase_color = v.ase_color;
|
|
|
|
#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;
|
|
v.tangentOS = v.tangentOS;
|
|
|
|
VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
|
|
VertexNormalInputs normalInput = GetVertexNormalInputs( v.normalOS, v.tangentOS );
|
|
|
|
o.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x );
|
|
o.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y );
|
|
o.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z );
|
|
|
|
#if defined(LIGHTMAP_ON)
|
|
OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy );
|
|
#endif
|
|
|
|
#if !defined(LIGHTMAP_ON)
|
|
OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz );
|
|
#endif
|
|
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
|
|
#endif
|
|
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
o.lightmapUVOrVertexSH.zw = v.texcoord.xy;
|
|
o.lightmapUVOrVertexSH.xy = v.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw;
|
|
#endif
|
|
|
|
half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS );
|
|
|
|
#ifdef ASE_FOG
|
|
half fogFactor = ComputeFogFactor( vertexInput.positionCS.z );
|
|
#else
|
|
half fogFactor = 0;
|
|
#endif
|
|
|
|
o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
|
|
o.positionCS = vertexInput.positionCS;
|
|
o.clipPosV = vertexInput.positionCS;
|
|
return o;
|
|
}
|
|
|
|
#if defined(ASE_TESSELLATION)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 texcoord : TEXCOORD0;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
float4 ase_color : COLOR;
|
|
|
|
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.tangentOS = v.tangentOS;
|
|
o.texcoord = v.texcoord;
|
|
o.texcoord1 = v.texcoord1;
|
|
o.texcoord2 = v.texcoord2;
|
|
o.ase_color = v.ase_color;
|
|
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.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
|
|
o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
|
|
o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
|
|
o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * 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 ASE_DEPTH_WRITE_ON
|
|
,out float outputDepth : ASE_SV_DEPTH
|
|
#endif
|
|
#ifdef _WRITE_RENDERING_LAYERS
|
|
, out float4 outRenderingLayers : SV_Target1
|
|
#endif
|
|
) : SV_Target
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(IN);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( IN.positionCS );
|
|
#endif
|
|
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
|
|
float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
|
|
float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
|
|
float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
|
|
#else
|
|
float3 WorldNormal = normalize( IN.tSpace0.xyz );
|
|
float3 WorldTangent = IN.tSpace1.xyz;
|
|
float3 WorldBiTangent = IN.tSpace2.xyz;
|
|
#endif
|
|
|
|
float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w);
|
|
float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
|
|
float4 ShadowCoords = float4( 0, 0, 0, 0 );
|
|
|
|
float4 ClipPos = IN.clipPosV;
|
|
float4 ScreenPos = ComputeScreenPos( IN.clipPosV );
|
|
|
|
float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.positionCS);
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
|
|
WorldViewDirection = SafeNormalize( WorldViewDirection );
|
|
|
|
float2 texCoord233 = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult228 = lerp( ( 0.0 - _Feather1 ) , ( 1.0 + _Feather1 ) , texCoord233.y);
|
|
float4 temp_cast_0 = (( lerpResult228 - _Feather1 )).xxxx;
|
|
float4 temp_cast_1 = (( lerpResult228 + _Feather1 )).xxxx;
|
|
float2 uv_FireTexture = IN.ase_texcoord9.xy * _FireTexture_ST.xy + _FireTexture_ST.zw;
|
|
float4 smoothstepResult224 = smoothstep( temp_cast_0 , temp_cast_1 , tex2D( _FireTexture, uv_FireTexture ));
|
|
float3 texCoord76 = IN.ase_texcoord9.xyz;
|
|
texCoord76.xy = IN.ase_texcoord9.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_2 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord9.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord9;
|
|
texCoord119.xy = IN.ase_texcoord9.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord9.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_2 )) );
|
|
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
|
|
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
|
|
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
|
|
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
|
|
float2 texCoord120 = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 Diffuse195 = ( IN.ase_color * tex2DNode73 * ( 1.0 + texCoord120.x ) );
|
|
float dotResult180 = dot( WorldNormal , _MainLightPosition.xyz );
|
|
float2 temp_cast_5 = (saturate( (dotResult180*0.5 + 0.5) )).xx;
|
|
float ase_lightIntensity = max( max( _MainLightColor.r, _MainLightColor.g ), _MainLightColor.b );
|
|
float4 ase_lightColor = float4( _MainLightColor.rgb / ase_lightIntensity, ase_lightIntensity );
|
|
float3 bakedGI184 = ASEIndirectDiffuse( IN.lightmapUVOrVertexSH.xy, WorldNormal);
|
|
Light ase_mainLight = GetMainLight( ShadowCoords );
|
|
MixRealtimeAndBakedGI(ase_mainLight, WorldNormal, bakedGI184, half4(0,0,0,0));
|
|
float ase_lightAtten = 0;
|
|
ase_lightAtten = ase_mainLight.distanceAttenuation * ase_mainLight.shadowAttenuation;
|
|
float4 Surface197 = ( ( Diffuse195 * tex2D( _ToonRamp, temp_cast_5 ) ) * ( ase_lightColor * float4( ( bakedGI184 + ase_lightAtten ) , 0.0 ) ) );
|
|
float4 texCoord137 = IN.ase_texcoord8;
|
|
texCoord137.xy = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord8;
|
|
texCoord157.xy = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord9.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord9.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
float4 appendResult145 = (float4(( ( _FireColor * smoothstepResult224 * Surface197 ) + Surface197 ).rgb , temp_output_126_0));
|
|
|
|
|
|
float3 BaseColor = float3(0.5, 0.5, 0.5);
|
|
float3 Normal = float3(0, 0, 1);
|
|
float3 Emission = appendResult145.xyz;
|
|
float3 Specular = 0.5;
|
|
float Metallic = 0;
|
|
float Smoothness = 0.5;
|
|
float Occlusion = 1;
|
|
float Alpha = temp_output_126_0;
|
|
float AlphaClipThreshold = 0.5;
|
|
float AlphaClipThresholdShadow = 0.5;
|
|
float3 BakedGI = 0;
|
|
float3 RefractionColor = 1;
|
|
float RefractionIndex = 1;
|
|
float3 Transmission = 1;
|
|
float3 Translucency = 1;
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
float DepthValue = IN.positionCS.z;
|
|
#endif
|
|
|
|
#ifdef _CLEARCOAT
|
|
float CoatMask = 0;
|
|
float CoatSmoothness = 0;
|
|
#endif
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
InputData inputData = (InputData)0;
|
|
inputData.positionWS = WorldPosition;
|
|
inputData.viewDirectionWS = WorldViewDirection;
|
|
|
|
#ifdef _NORMALMAP
|
|
#if _NORMAL_DROPOFF_TS
|
|
inputData.normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent, WorldBiTangent, WorldNormal));
|
|
#elif _NORMAL_DROPOFF_OS
|
|
inputData.normalWS = TransformObjectToWorldNormal(Normal);
|
|
#elif _NORMAL_DROPOFF_WS
|
|
inputData.normalWS = Normal;
|
|
#endif
|
|
inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
|
|
#else
|
|
inputData.normalWS = WorldNormal;
|
|
#endif
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
inputData.shadowCoord = ShadowCoords;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS);
|
|
#else
|
|
inputData.shadowCoord = float4(0, 0, 0, 0);
|
|
#endif
|
|
|
|
#ifdef ASE_FOG
|
|
inputData.fogCoord = IN.fogFactorAndVertexLight.x;
|
|
#endif
|
|
inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw;
|
|
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
float3 SH = SampleSH(inputData.normalWS.xyz);
|
|
#else
|
|
float3 SH = IN.lightmapUVOrVertexSH.xyz;
|
|
#endif
|
|
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS);
|
|
#else
|
|
inputData.bakedGI = SAMPLE_GI(IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS);
|
|
#endif
|
|
|
|
#ifdef ASE_BAKEDGI
|
|
inputData.bakedGI = BakedGI;
|
|
#endif
|
|
|
|
inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV;
|
|
inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy);
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy;
|
|
#endif
|
|
#if defined(LIGHTMAP_ON)
|
|
inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy;
|
|
#else
|
|
inputData.vertexSH = SH;
|
|
#endif
|
|
#endif
|
|
|
|
SurfaceData surfaceData;
|
|
surfaceData.albedo = BaseColor;
|
|
surfaceData.metallic = saturate(Metallic);
|
|
surfaceData.specular = Specular;
|
|
surfaceData.smoothness = saturate(Smoothness),
|
|
surfaceData.occlusion = Occlusion,
|
|
surfaceData.emission = Emission,
|
|
surfaceData.alpha = saturate(Alpha);
|
|
surfaceData.normalTS = Normal;
|
|
surfaceData.clearCoatMask = 0;
|
|
surfaceData.clearCoatSmoothness = 1;
|
|
|
|
#ifdef _CLEARCOAT
|
|
surfaceData.clearCoatMask = saturate(CoatMask);
|
|
surfaceData.clearCoatSmoothness = saturate(CoatSmoothness);
|
|
#endif
|
|
|
|
#ifdef _DBUFFER
|
|
ApplyDecalToSurfaceData(IN.positionCS, surfaceData, inputData);
|
|
#endif
|
|
|
|
half4 color = UniversalFragmentPBR( inputData, surfaceData);
|
|
|
|
#ifdef ASE_TRANSMISSION
|
|
{
|
|
float shadow = _TransmissionShadow;
|
|
|
|
#define SUM_LIGHT_TRANSMISSION(Light)\
|
|
float3 atten = Light.color * Light.distanceAttenuation;\
|
|
atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\
|
|
half3 transmission = max( 0, -dot( inputData.normalWS, Light.direction ) ) * atten * Transmission;\
|
|
color.rgb += BaseColor * transmission;
|
|
|
|
SUM_LIGHT_TRANSMISSION( GetMainLight( inputData.shadowCoord ) );
|
|
|
|
#if defined(_ADDITIONAL_LIGHTS)
|
|
uint meshRenderingLayers = GetMeshRenderingLayer();
|
|
uint pixelLightCount = GetAdditionalLightsCount();
|
|
#if USE_FORWARD_PLUS
|
|
for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
|
|
{
|
|
FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
|
|
|
|
Light light = GetAdditionalLight(lightIndex, inputData.positionWS);
|
|
#ifdef _LIGHT_LAYERS
|
|
if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
|
|
#endif
|
|
{
|
|
SUM_LIGHT_TRANSMISSION( light );
|
|
}
|
|
}
|
|
#endif
|
|
LIGHT_LOOP_BEGIN( pixelLightCount )
|
|
Light light = GetAdditionalLight(lightIndex, inputData.positionWS);
|
|
#ifdef _LIGHT_LAYERS
|
|
if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
|
|
#endif
|
|
{
|
|
SUM_LIGHT_TRANSMISSION( light );
|
|
}
|
|
LIGHT_LOOP_END
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#ifdef ASE_TRANSLUCENCY
|
|
{
|
|
float shadow = _TransShadow;
|
|
float normal = _TransNormal;
|
|
float scattering = _TransScattering;
|
|
float direct = _TransDirect;
|
|
float ambient = _TransAmbient;
|
|
float strength = _TransStrength;
|
|
|
|
#define SUM_LIGHT_TRANSLUCENCY(Light)\
|
|
float3 atten = Light.color * Light.distanceAttenuation;\
|
|
atten = lerp( atten, atten * Light.shadowAttenuation, shadow );\
|
|
half3 lightDir = Light.direction + inputData.normalWS * normal;\
|
|
half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering );\
|
|
half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency;\
|
|
color.rgb += BaseColor * translucency * strength;
|
|
|
|
SUM_LIGHT_TRANSLUCENCY( GetMainLight( inputData.shadowCoord ) );
|
|
|
|
#if defined(_ADDITIONAL_LIGHTS)
|
|
uint meshRenderingLayers = GetMeshRenderingLayer();
|
|
uint pixelLightCount = GetAdditionalLightsCount();
|
|
#if USE_FORWARD_PLUS
|
|
for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++)
|
|
{
|
|
FORWARD_PLUS_SUBTRACTIVE_LIGHT_CHECK
|
|
|
|
Light light = GetAdditionalLight(lightIndex, inputData.positionWS);
|
|
#ifdef _LIGHT_LAYERS
|
|
if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
|
|
#endif
|
|
{
|
|
SUM_LIGHT_TRANSLUCENCY( light );
|
|
}
|
|
}
|
|
#endif
|
|
LIGHT_LOOP_BEGIN( pixelLightCount )
|
|
Light light = GetAdditionalLight(lightIndex, inputData.positionWS);
|
|
#ifdef _LIGHT_LAYERS
|
|
if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers))
|
|
#endif
|
|
{
|
|
SUM_LIGHT_TRANSLUCENCY( light );
|
|
}
|
|
LIGHT_LOOP_END
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#ifdef ASE_REFRACTION
|
|
float4 projScreenPos = ScreenPos / ScreenPos.w;
|
|
float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, float4( WorldNormal,0 ) ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) );
|
|
projScreenPos.xy += refractionOffset.xy;
|
|
float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos.xy ) * RefractionColor;
|
|
color.rgb = lerp( refraction, color.rgb, color.a );
|
|
color.a = 1;
|
|
#endif
|
|
|
|
#ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
|
|
color.rgb *= color.a;
|
|
#endif
|
|
|
|
#ifdef ASE_FOG
|
|
#ifdef TERRAIN_SPLAT_ADDPASS
|
|
color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x );
|
|
#else
|
|
color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
outputDepth = DepthValue;
|
|
#endif
|
|
|
|
#ifdef _WRITE_RENDERING_LAYERS
|
|
uint renderingLayers = GetMeshRenderingLayer();
|
|
outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 );
|
|
#endif
|
|
|
|
return color;
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "ShadowCaster"
|
|
Tags { "LightMode"="ShadowCaster" }
|
|
|
|
ZWrite On
|
|
ZTest LEqual
|
|
AlphaToMask Off
|
|
ColorMask 0
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#define ASE_FOG 1
|
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
|
#define _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
|
|
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#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.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"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
|
|
#define ASE_SV_DEPTH SV_DepthLessEqual
|
|
#define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
|
|
#else
|
|
#define ASE_SV_DEPTH SV_Depth
|
|
#define ASE_SV_POSITION_QUALIFIERS
|
|
#endif
|
|
|
|
struct 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
|
|
{
|
|
ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 clipPosV : TEXCOORD0;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 positionWS : TEXCOORD1;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
float4 shadowCoord : TEXCOORD2;
|
|
#endif
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
float4 ase_texcoord4 : TEXCOORD4;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _Main;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
|
|
float3 _LightDirection;
|
|
float3 _LightPosition;
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord3 = v.ase_texcoord;
|
|
o.ase_texcoord4 = v.ase_texcoord1;
|
|
|
|
#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;
|
|
o.clipPosV = 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 ASE_DEPTH_WRITE_ON
|
|
,out float outputDepth : ASE_SV_DEPTH
|
|
#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 );
|
|
float4 ClipPos = IN.clipPosV;
|
|
float4 ScreenPos = ComputeScreenPos( IN.clipPosV );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
#endif
|
|
|
|
float3 texCoord76 = IN.ase_texcoord3.xyz;
|
|
texCoord76.xy = IN.ase_texcoord3.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 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_texcoord4;
|
|
texCoord137.xy = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord4;
|
|
texCoord157.xy = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord3.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 temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
|
|
|
|
float Alpha = temp_output_126_0;
|
|
float AlphaClipThreshold = 0.5;
|
|
float AlphaClipThresholdShadow = 0.5;
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
float DepthValue = IN.positionCS.z;
|
|
#endif
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
#ifdef _ALPHATEST_SHADOW_ON
|
|
clip(Alpha - AlphaClipThresholdShadow);
|
|
#else
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
#endif
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( IN.positionCS );
|
|
#endif
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
outputDepth = DepthValue;
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "DepthOnly"
|
|
Tags { "LightMode"="DepthOnly" }
|
|
|
|
ZWrite On
|
|
ColorMask R
|
|
AlphaToMask Off
|
|
|
|
HLSLPROGRAM
|
|
|
|
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#define ASE_FOG 1
|
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
|
#define _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#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.universal/ShaderLibrary/Input.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
|
|
#define ASE_SV_DEPTH SV_DepthLessEqual
|
|
#define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
|
|
#else
|
|
#define ASE_SV_DEPTH SV_Depth
|
|
#define ASE_SV_POSITION_QUALIFIERS
|
|
#endif
|
|
|
|
struct 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
|
|
{
|
|
ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 clipPosV : TEXCOORD0;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 positionWS : TEXCOORD1;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
float4 shadowCoord : TEXCOORD2;
|
|
#endif
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
float4 ase_texcoord4 : TEXCOORD4;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _Main;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord3 = v.ase_texcoord;
|
|
o.ase_texcoord4 = v.ase_texcoord1;
|
|
|
|
#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;
|
|
|
|
VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
o.positionWS = vertexInput.positionWS;
|
|
#endif
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
|
|
o.positionCS = vertexInput.positionCS;
|
|
o.clipPosV = vertexInput.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 ASE_DEPTH_WRITE_ON
|
|
,out float outputDepth : ASE_SV_DEPTH
|
|
#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 );
|
|
float4 ClipPos = IN.clipPosV;
|
|
float4 ScreenPos = ComputeScreenPos( IN.clipPosV );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
#endif
|
|
|
|
float3 texCoord76 = IN.ase_texcoord3.xyz;
|
|
texCoord76.xy = IN.ase_texcoord3.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 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_texcoord4;
|
|
texCoord137.xy = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord4;
|
|
texCoord157.xy = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord3.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 temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
|
|
|
|
float Alpha = temp_output_126_0;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
float DepthValue = IN.positionCS.z;
|
|
#endif
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( IN.positionCS );
|
|
#endif
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
outputDepth = DepthValue;
|
|
#endif
|
|
|
|
return 0;
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "Meta"
|
|
Tags { "LightMode"="Meta" }
|
|
|
|
Cull Off
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ASE_FOG 1
|
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
|
#define _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#pragma shader_feature EDITOR_VISUALIZATION
|
|
|
|
#define SHADERPASS SHADERPASS_META
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
#define ASE_NEEDS_VERT_NORMAL
|
|
#define ASE_NEEDS_VERT_TEXTURE_COORDINATES1
|
|
#define ASE_NEEDS_FRAG_WORLD_POSITION
|
|
#define ASE_NEEDS_FRAG_SHADOWCOORDS
|
|
#define ASE_NEEDS_FRAG_COLOR
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
|
|
#pragma multi_compile _ _SHADOWS_SOFT
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
|
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
|
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
|
#pragma multi_compile _ _FORWARD_PLUS
|
|
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 texcoord0 : TEXCOORD0;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
float4 ase_color : COLOR;
|
|
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 EDITOR_VISUALIZATION
|
|
float4 VizUV : TEXCOORD2;
|
|
float4 LightCoord : TEXCOORD3;
|
|
#endif
|
|
float4 ase_texcoord4 : TEXCOORD4;
|
|
float4 ase_texcoord5 : TEXCOORD5;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord6 : TEXCOORD6;
|
|
float4 lightmapUVOrVertexSH : TEXCOORD7;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _FireTexture;
|
|
sampler2D _Main;
|
|
sampler2D _ToonRamp;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
float3 ASEIndirectDiffuse( float2 uvStaticLightmap, float3 normalWS )
|
|
{
|
|
#ifdef LIGHTMAP_ON
|
|
return SampleLightmap( uvStaticLightmap, normalWS );
|
|
#else
|
|
return SampleSH(normalWS);
|
|
#endif
|
|
}
|
|
|
|
|
|
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_texcoord6.xyz = ase_worldNormal;
|
|
OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy );
|
|
OUTPUT_SH( ase_worldNormal, o.lightmapUVOrVertexSH.xyz );
|
|
|
|
o.ase_texcoord4 = v.texcoord1;
|
|
o.ase_texcoord5 = v.texcoord0;
|
|
o.ase_color = v.ase_color;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
o.ase_texcoord6.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 = MetaVertexPosition( v.positionOS, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST );
|
|
|
|
#ifdef EDITOR_VISUALIZATION
|
|
float2 VizUV = 0;
|
|
float4 LightCoord = 0;
|
|
UnityEditorVizData(v.positionOS.xyz, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, VizUV, LightCoord);
|
|
o.VizUV = float4(VizUV, 0, 0);
|
|
o.LightCoord = LightCoord;
|
|
#endif
|
|
|
|
#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 texcoord0 : TEXCOORD0;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
float4 ase_color : COLOR;
|
|
|
|
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.texcoord0 = v.texcoord0;
|
|
o.texcoord1 = v.texcoord1;
|
|
o.texcoord2 = v.texcoord2;
|
|
o.ase_color = v.ase_color;
|
|
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.texcoord0 = patch[0].texcoord0 * bary.x + patch[1].texcoord0 * bary.y + patch[2].texcoord0 * bary.z;
|
|
o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
|
|
o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * 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 texCoord233 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult228 = lerp( ( 0.0 - _Feather1 ) , ( 1.0 + _Feather1 ) , texCoord233.y);
|
|
float4 temp_cast_0 = (( lerpResult228 - _Feather1 )).xxxx;
|
|
float4 temp_cast_1 = (( lerpResult228 + _Feather1 )).xxxx;
|
|
float2 uv_FireTexture = IN.ase_texcoord5.xy * _FireTexture_ST.xy + _FireTexture_ST.zw;
|
|
float4 smoothstepResult224 = smoothstep( temp_cast_0 , temp_cast_1 , tex2D( _FireTexture, uv_FireTexture ));
|
|
float3 texCoord76 = IN.ase_texcoord5.xyz;
|
|
texCoord76.xy = IN.ase_texcoord5.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_2 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord5;
|
|
texCoord119.xy = IN.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord5.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_2 )) );
|
|
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
|
|
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
|
|
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
|
|
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
|
|
float2 texCoord120 = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 Diffuse195 = ( IN.ase_color * tex2DNode73 * ( 1.0 + texCoord120.x ) );
|
|
float3 ase_worldNormal = IN.ase_texcoord6.xyz;
|
|
float dotResult180 = dot( ase_worldNormal , _MainLightPosition.xyz );
|
|
float2 temp_cast_5 = (saturate( (dotResult180*0.5 + 0.5) )).xx;
|
|
float ase_lightIntensity = max( max( _MainLightColor.r, _MainLightColor.g ), _MainLightColor.b );
|
|
float4 ase_lightColor = float4( _MainLightColor.rgb / ase_lightIntensity, ase_lightIntensity );
|
|
float3 bakedGI184 = ASEIndirectDiffuse( IN.lightmapUVOrVertexSH.xy, ase_worldNormal);
|
|
Light ase_mainLight = GetMainLight( ShadowCoords );
|
|
MixRealtimeAndBakedGI(ase_mainLight, ase_worldNormal, bakedGI184, half4(0,0,0,0));
|
|
float ase_lightAtten = 0;
|
|
ase_lightAtten = ase_mainLight.distanceAttenuation * ase_mainLight.shadowAttenuation;
|
|
float4 Surface197 = ( ( Diffuse195 * tex2D( _ToonRamp, temp_cast_5 ) ) * ( ase_lightColor * float4( ( bakedGI184 + ase_lightAtten ) , 0.0 ) ) );
|
|
float4 texCoord137 = IN.ase_texcoord4;
|
|
texCoord137.xy = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord4;
|
|
texCoord157.xy = IN.ase_texcoord4.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord5.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord5.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
float4 appendResult145 = (float4(( ( _FireColor * smoothstepResult224 * Surface197 ) + Surface197 ).rgb , temp_output_126_0));
|
|
|
|
|
|
float3 BaseColor = float3(0.5, 0.5, 0.5);
|
|
float3 Emission = appendResult145.xyz;
|
|
float Alpha = temp_output_126_0;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
MetaInput metaInput = (MetaInput)0;
|
|
metaInput.Albedo = BaseColor;
|
|
metaInput.Emission = Emission;
|
|
#ifdef EDITOR_VISUALIZATION
|
|
metaInput.VizUV = IN.VizUV.xy;
|
|
metaInput.LightCoord = IN.LightCoord;
|
|
#endif
|
|
|
|
return UnityMetaFragment(metaInput);
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "Universal2D"
|
|
Tags { "LightMode"="Universal2D" }
|
|
|
|
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
|
ZWrite On
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
ColorMask RGBA
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ASE_FOG 1
|
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
|
#define _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS SHADERPASS_2D
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 positionWS : TEXCOORD0;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
float4 shadowCoord : TEXCOORD1;
|
|
#endif
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _Main;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID( v );
|
|
UNITY_TRANSFER_INSTANCE_ID( v, o );
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord2 = v.ase_texcoord;
|
|
o.ase_texcoord3 = v.ase_texcoord1;
|
|
|
|
#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;
|
|
|
|
VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
o.positionWS = vertexInput.positionWS;
|
|
#endif
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
|
|
o.positionCS = vertexInput.positionCS;
|
|
|
|
return o;
|
|
}
|
|
|
|
#if defined(ASE_TESSELLATION)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 normalOS : NORMAL;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct TessellationFactors
|
|
{
|
|
float edge[3] : SV_TessFactor;
|
|
float inside : SV_InsideTessFactor;
|
|
};
|
|
|
|
VertexControl vert ( VertexInput v )
|
|
{
|
|
VertexControl o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.vertex = v.positionOS;
|
|
o.normalOS = v.normalOS;
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_texcoord1 = v.ase_texcoord1;
|
|
return o;
|
|
}
|
|
|
|
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
|
|
{
|
|
TessellationFactors o;
|
|
float4 tf = 1;
|
|
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
|
|
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
|
|
#if defined(ASE_FIXED_TESSELLATION)
|
|
tf = FixedTess( tessValue );
|
|
#elif defined(ASE_DISTANCE_TESSELLATION)
|
|
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
|
|
#elif defined(ASE_LENGTH_TESSELLATION)
|
|
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
|
|
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
|
|
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
|
|
#endif
|
|
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
|
|
return o;
|
|
}
|
|
|
|
[domain("tri")]
|
|
[partitioning("fractional_odd")]
|
|
[outputtopology("triangle_cw")]
|
|
[patchconstantfunc("TessellationFunction")]
|
|
[outputcontrolpoints(3)]
|
|
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
|
|
{
|
|
return patch[id];
|
|
}
|
|
|
|
[domain("tri")]
|
|
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
|
|
{
|
|
VertexInput o = (VertexInput) 0;
|
|
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
|
|
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
|
|
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
|
|
#if defined(ASE_PHONG_TESSELLATION)
|
|
float3 pp[3];
|
|
for (int i = 0; i < 3; ++i)
|
|
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
|
|
float phongStrength = _TessPhongStrength;
|
|
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
|
|
#endif
|
|
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
|
|
return VertexFunction(o);
|
|
}
|
|
#else
|
|
VertexOutput vert ( VertexInput v )
|
|
{
|
|
return VertexFunction( v );
|
|
}
|
|
#endif
|
|
|
|
half4 frag(VertexOutput IN ) : SV_TARGET
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID( IN );
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 WorldPosition = IN.positionWS;
|
|
#endif
|
|
|
|
float4 ShadowCoords = float4( 0, 0, 0, 0 );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
#endif
|
|
|
|
float3 texCoord76 = IN.ase_texcoord2.xyz;
|
|
texCoord76.xy = IN.ase_texcoord2.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 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_texcoord3;
|
|
texCoord137.xy = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord3;
|
|
texCoord157.xy = IN.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord2.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 temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
|
|
|
|
float3 BaseColor = float3(0.5, 0.5, 0.5);
|
|
float Alpha = temp_output_126_0;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
half4 color = half4(BaseColor, Alpha );
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
return color;
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "DepthNormals"
|
|
Tags { "LightMode"="DepthNormals" }
|
|
|
|
ZWrite On
|
|
Blend One Zero
|
|
ZTest LEqual
|
|
ZWrite On
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#define ASE_FOG 1
|
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
|
#define _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
|
|
|
|
|
|
|
|
#define SHADERPASS SHADERPASS_DEPTHNORMALSONLY
|
|
//#define SHADERPASS SHADERPASS_DEPTHNORMALS
|
|
|
|
|
|
#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"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
|
|
#define ASE_SV_DEPTH SV_DepthLessEqual
|
|
#define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
|
|
#else
|
|
#define ASE_SV_DEPTH SV_Depth
|
|
#define ASE_SV_POSITION_QUALIFIERS
|
|
#endif
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 clipPosV : TEXCOORD0;
|
|
float3 worldNormal : TEXCOORD1;
|
|
float4 worldTangent : TEXCOORD2;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 positionWS : TEXCOORD3;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
float4 shadowCoord : TEXCOORD4;
|
|
#endif
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord5 : TEXCOORD5;
|
|
float4 ase_texcoord6 : TEXCOORD6;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _Main;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord5 = v.ase_texcoord;
|
|
o.ase_texcoord6 = v.ase_texcoord1;
|
|
#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;
|
|
v.tangentOS = v.tangentOS;
|
|
|
|
VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
|
|
|
|
float3 normalWS = TransformObjectToWorldNormal( v.normalOS );
|
|
float4 tangentWS = float4( TransformObjectToWorldDir( v.tangentOS.xyz ), v.tangentOS.w );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
o.positionWS = vertexInput.positionWS;
|
|
#endif
|
|
|
|
o.worldNormal = normalWS;
|
|
o.worldTangent = tangentWS;
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
|
|
o.positionCS = vertexInput.positionCS;
|
|
o.clipPosV = vertexInput.positionCS;
|
|
return o;
|
|
}
|
|
|
|
#if defined(ASE_TESSELLATION)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
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.tangentOS = v.tangentOS;
|
|
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.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * 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 ASE_DEPTH_WRITE_ON
|
|
,out float outputDepth : ASE_SV_DEPTH
|
|
#endif
|
|
#ifdef _WRITE_RENDERING_LAYERS
|
|
, out float4 outRenderingLayers : SV_Target1
|
|
#endif
|
|
)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(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 );
|
|
float3 WorldNormal = IN.worldNormal;
|
|
float4 WorldTangent = IN.worldTangent;
|
|
|
|
float4 ClipPos = IN.clipPosV;
|
|
float4 ScreenPos = ComputeScreenPos( IN.clipPosV );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
#endif
|
|
|
|
float3 texCoord76 = IN.ase_texcoord5.xyz;
|
|
texCoord76.xy = IN.ase_texcoord5.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_0 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord5;
|
|
texCoord119.xy = IN.ase_texcoord5.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord5.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_texcoord6;
|
|
texCoord137.xy = IN.ase_texcoord6.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord6;
|
|
texCoord157.xy = IN.ase_texcoord6.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord5.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord5.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
|
|
|
|
float3 Normal = float3(0, 0, 1);
|
|
float Alpha = temp_output_126_0;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
float DepthValue = IN.positionCS.z;
|
|
#endif
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( IN.positionCS );
|
|
#endif
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
outputDepth = DepthValue;
|
|
#endif
|
|
|
|
#if defined(_GBUFFER_NORMALS_OCT)
|
|
float2 octNormalWS = PackNormalOctQuadEncode(WorldNormal);
|
|
float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5);
|
|
half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS);
|
|
outNormalWS = half4(packedNormalWS, 0.0);
|
|
#else
|
|
#if defined(_NORMALMAP)
|
|
#if _NORMAL_DROPOFF_TS
|
|
float crossSign = (WorldTangent.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale();
|
|
float3 bitangent = crossSign * cross(WorldNormal.xyz, WorldTangent.xyz);
|
|
float3 normalWS = TransformTangentToWorld(Normal, half3x3(WorldTangent.xyz, bitangent, WorldNormal.xyz));
|
|
#elif _NORMAL_DROPOFF_OS
|
|
float3 normalWS = TransformObjectToWorldNormal(Normal);
|
|
#elif _NORMAL_DROPOFF_WS
|
|
float3 normalWS = Normal;
|
|
#endif
|
|
#else
|
|
float3 normalWS = WorldNormal;
|
|
#endif
|
|
outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0);
|
|
#endif
|
|
|
|
#ifdef _WRITE_RENDERING_LAYERS
|
|
uint renderingLayers = GetMeshRenderingLayer();
|
|
outRenderingLayers = float4( EncodeMeshRenderingLayer( renderingLayers ), 0, 0, 0 );
|
|
#endif
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "GBuffer"
|
|
Tags { "LightMode"="UniversalGBuffer" }
|
|
|
|
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
|
|
ZWrite On
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
ColorMask RGBA
|
|
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#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 _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
#pragma shader_feature_local _RECEIVE_SHADOWS_OFF
|
|
#pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
|
|
#pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
|
|
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
|
|
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
|
|
|
|
|
|
|
|
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
|
|
|
|
|
|
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
|
|
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
|
|
#pragma multi_compile_fragment _ _RENDER_PASS_ENABLED
|
|
|
|
|
|
|
|
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
|
|
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
|
|
#pragma multi_compile _ SHADOWS_SHADOWMASK
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
|
|
#pragma multi_compile_fragment _ DEBUG_DISPLAY
|
|
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS SHADERPASS_GBUFFER
|
|
|
|
|
|
#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"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DBuffer.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
|
|
#endif
|
|
|
|
#if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
|
|
#define ENABLE_TERRAIN_PERPIXEL_NORMAL
|
|
#endif
|
|
|
|
#define ASE_NEEDS_FRAG_WORLD_NORMAL
|
|
#define ASE_NEEDS_VERT_TEXTURE_COORDINATES1
|
|
#define ASE_NEEDS_FRAG_WORLD_POSITION
|
|
#define ASE_NEEDS_FRAG_SHADOWCOORDS
|
|
#define ASE_NEEDS_FRAG_COLOR
|
|
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
|
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
|
|
#pragma multi_compile_fragment _ _SHADOWS_SOFT
|
|
#pragma multi_compile _ _FORWARD_PLUS
|
|
|
|
|
|
#if defined(ASE_EARLY_Z_DEPTH_OPTIMIZE) && (SHADER_TARGET >= 45)
|
|
#define ASE_SV_DEPTH SV_DepthLessEqual
|
|
#define ASE_SV_POSITION_QUALIFIERS linear noperspective centroid
|
|
#else
|
|
#define ASE_SV_DEPTH SV_Depth
|
|
#define ASE_SV_POSITION_QUALIFIERS
|
|
#endif
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 texcoord : TEXCOORD0;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
ASE_SV_POSITION_QUALIFIERS float4 positionCS : SV_POSITION;
|
|
float4 clipPosV : TEXCOORD0;
|
|
float4 lightmapUVOrVertexSH : TEXCOORD1;
|
|
half4 fogFactorAndVertexLight : TEXCOORD2;
|
|
float4 tSpace0 : TEXCOORD3;
|
|
float4 tSpace1 : TEXCOORD4;
|
|
float4 tSpace2 : TEXCOORD5;
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord : TEXCOORD6;
|
|
#endif
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
float2 dynamicLightmapUV : TEXCOORD7;
|
|
#endif
|
|
float4 ase_texcoord8 : TEXCOORD8;
|
|
float4 ase_texcoord9 : TEXCOORD9;
|
|
float4 ase_color : COLOR;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _FireTexture;
|
|
sampler2D _Main;
|
|
sampler2D _ToonRamp;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl"
|
|
|
|
float3 ASEIndirectDiffuse( float2 uvStaticLightmap, float3 normalWS )
|
|
{
|
|
#ifdef LIGHTMAP_ON
|
|
return SampleLightmap( uvStaticLightmap, normalWS );
|
|
#else
|
|
return SampleSH(normalWS);
|
|
#endif
|
|
}
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
o.ase_texcoord8 = v.texcoord1;
|
|
o.ase_texcoord9 = v.texcoord;
|
|
o.ase_color = v.ase_color;
|
|
#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;
|
|
v.tangentOS = v.tangentOS;
|
|
|
|
VertexPositionInputs vertexInput = GetVertexPositionInputs( v.positionOS.xyz );
|
|
VertexNormalInputs normalInput = GetVertexNormalInputs( v.normalOS, v.tangentOS );
|
|
|
|
o.tSpace0 = float4( normalInput.normalWS, vertexInput.positionWS.x);
|
|
o.tSpace1 = float4( normalInput.tangentWS, vertexInput.positionWS.y);
|
|
o.tSpace2 = float4( normalInput.bitangentWS, vertexInput.positionWS.z);
|
|
|
|
#if defined(LIGHTMAP_ON)
|
|
OUTPUT_LIGHTMAP_UV(v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy);
|
|
#endif
|
|
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw;
|
|
#endif
|
|
|
|
#if !defined(LIGHTMAP_ON)
|
|
OUTPUT_SH(normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz);
|
|
#endif
|
|
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
o.lightmapUVOrVertexSH.zw = v.texcoord.xy;
|
|
o.lightmapUVOrVertexSH.xy = v.texcoord.xy * unity_LightmapST.xy + unity_LightmapST.zw;
|
|
#endif
|
|
|
|
half3 vertexLight = VertexLighting( vertexInput.positionWS, normalInput.normalWS );
|
|
|
|
o.fogFactorAndVertexLight = half4(0, vertexLight);
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
|
|
o.positionCS = vertexInput.positionCS;
|
|
o.clipPosV = vertexInput.positionCS;
|
|
return o;
|
|
}
|
|
|
|
#if defined(ASE_TESSELLATION)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 normalOS : NORMAL;
|
|
float4 tangentOS : TANGENT;
|
|
float4 texcoord : TEXCOORD0;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
float4 ase_color : COLOR;
|
|
|
|
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.tangentOS = v.tangentOS;
|
|
o.texcoord = v.texcoord;
|
|
o.texcoord1 = v.texcoord1;
|
|
o.texcoord2 = v.texcoord2;
|
|
o.ase_color = v.ase_color;
|
|
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.tangentOS = patch[0].tangentOS * bary.x + patch[1].tangentOS * bary.y + patch[2].tangentOS * bary.z;
|
|
o.texcoord = patch[0].texcoord * bary.x + patch[1].texcoord * bary.y + patch[2].texcoord * bary.z;
|
|
o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
|
|
o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * 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
|
|
|
|
FragmentOutput frag ( VertexOutput IN
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
,out float outputDepth : ASE_SV_DEPTH
|
|
#endif
|
|
)
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(IN);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
|
|
|
|
#if defined(LOD_FADE_CROSSFADE)
|
|
LODFadeCrossFade( IN.positionCS );
|
|
#endif
|
|
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
|
|
float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
|
|
float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
|
|
float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
|
|
#else
|
|
float3 WorldNormal = normalize( IN.tSpace0.xyz );
|
|
float3 WorldTangent = IN.tSpace1.xyz;
|
|
float3 WorldBiTangent = IN.tSpace2.xyz;
|
|
#endif
|
|
|
|
float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w);
|
|
float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
|
|
float4 ShadowCoords = float4( 0, 0, 0, 0 );
|
|
|
|
float4 ClipPos = IN.clipPosV;
|
|
float4 ScreenPos = ComputeScreenPos( IN.clipPosV );
|
|
|
|
float2 NormalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.positionCS);
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#else
|
|
ShadowCoords = float4(0, 0, 0, 0);
|
|
#endif
|
|
|
|
WorldViewDirection = SafeNormalize( WorldViewDirection );
|
|
|
|
float2 texCoord233 = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult228 = lerp( ( 0.0 - _Feather1 ) , ( 1.0 + _Feather1 ) , texCoord233.y);
|
|
float4 temp_cast_0 = (( lerpResult228 - _Feather1 )).xxxx;
|
|
float4 temp_cast_1 = (( lerpResult228 + _Feather1 )).xxxx;
|
|
float2 uv_FireTexture = IN.ase_texcoord9.xy * _FireTexture_ST.xy + _FireTexture_ST.zw;
|
|
float4 smoothstepResult224 = smoothstep( temp_cast_0 , temp_cast_1 , tex2D( _FireTexture, uv_FireTexture ));
|
|
float3 texCoord76 = IN.ase_texcoord9.xyz;
|
|
texCoord76.xy = IN.ase_texcoord9.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 temp_cast_2 = (0.0).xx;
|
|
float2 texCoord102 = IN.ase_texcoord9.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 texCoord119 = IN.ase_texcoord9;
|
|
texCoord119.xy = IN.ase_texcoord9.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 appendResult106 = (float2(( _StretchMultiplier * ( _StretchUVDes - texCoord102 ) * texCoord119.w )));
|
|
float2 texCoord74 = IN.ase_texcoord9.xy * _Tiling + ( ( texCoord76.z * _Scroll ) + _Offset + (( _Stretch )?( appendResult106 ):( temp_cast_2 )) );
|
|
float4 appendResult84 = (float4(_LimitUVRange.x , _LimitUVRange.z , 0.0 , 0.0));
|
|
float4 appendResult85 = (float4(_LimitUVRange.y , _LimitUVRange.w , 0.0 , 0.0));
|
|
float2 clampResult80 = clamp( texCoord74 , appendResult84.xy , appendResult85.xy );
|
|
float4 tex2DNode73 = tex2D( _Main, (( _LimitUV )?( clampResult80 ):( texCoord74 )) );
|
|
float2 texCoord120 = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float4 Diffuse195 = ( IN.ase_color * tex2DNode73 * ( 1.0 + texCoord120.x ) );
|
|
float dotResult180 = dot( WorldNormal , _MainLightPosition.xyz );
|
|
float2 temp_cast_5 = (saturate( (dotResult180*0.5 + 0.5) )).xx;
|
|
float ase_lightIntensity = max( max( _MainLightColor.r, _MainLightColor.g ), _MainLightColor.b );
|
|
float4 ase_lightColor = float4( _MainLightColor.rgb / ase_lightIntensity, ase_lightIntensity );
|
|
float3 bakedGI184 = ASEIndirectDiffuse( IN.lightmapUVOrVertexSH.xy, WorldNormal);
|
|
Light ase_mainLight = GetMainLight( ShadowCoords );
|
|
MixRealtimeAndBakedGI(ase_mainLight, WorldNormal, bakedGI184, half4(0,0,0,0));
|
|
float ase_lightAtten = 0;
|
|
ase_lightAtten = ase_mainLight.distanceAttenuation * ase_mainLight.shadowAttenuation;
|
|
float4 Surface197 = ( ( Diffuse195 * tex2D( _ToonRamp, temp_cast_5 ) ) * ( ase_lightColor * float4( ( bakedGI184 + ase_lightAtten ) , 0.0 ) ) );
|
|
float4 texCoord137 = IN.ase_texcoord8;
|
|
texCoord137.xy = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord8;
|
|
texCoord157.xy = IN.ase_texcoord8.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord9.xy * _MaskTiling + ( _MaskOffset + ( texCoord157.w * _MaskScroll ) );
|
|
float smoothstepResult155 = smoothstep( ( lerpResult172 - _Feather ) , ( lerpResult172 + _Feather ) , tex2D( _NoiseMask, texCoord156 ).r);
|
|
float2 uv_StaticMask = IN.ase_texcoord9.xy * _StaticMask_ST.xy + _StaticMask_ST.zw;
|
|
float smoothstepResult165 = smoothstep( _SmoothStep.x , _SmoothStep.y , tex2D( _StaticMask, uv_StaticMask ).r);
|
|
float temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
float4 appendResult145 = (float4(( ( _FireColor * smoothstepResult224 * Surface197 ) + Surface197 ).rgb , temp_output_126_0));
|
|
|
|
|
|
float3 BaseColor = float3(0.5, 0.5, 0.5);
|
|
float3 Normal = float3(0, 0, 1);
|
|
float3 Emission = appendResult145.xyz;
|
|
float3 Specular = 0.5;
|
|
float Metallic = 0;
|
|
float Smoothness = 0.5;
|
|
float Occlusion = 1;
|
|
float Alpha = temp_output_126_0;
|
|
float AlphaClipThreshold = 0.5;
|
|
float AlphaClipThresholdShadow = 0.5;
|
|
float3 BakedGI = 0;
|
|
float3 RefractionColor = 1;
|
|
float RefractionIndex = 1;
|
|
float3 Transmission = 1;
|
|
float3 Translucency = 1;
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
float DepthValue = IN.positionCS.z;
|
|
#endif
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
InputData inputData = (InputData)0;
|
|
inputData.positionWS = WorldPosition;
|
|
inputData.positionCS = IN.positionCS;
|
|
inputData.shadowCoord = ShadowCoords;
|
|
|
|
#ifdef _NORMALMAP
|
|
#if _NORMAL_DROPOFF_TS
|
|
inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal ));
|
|
#elif _NORMAL_DROPOFF_OS
|
|
inputData.normalWS = TransformObjectToWorldNormal(Normal);
|
|
#elif _NORMAL_DROPOFF_WS
|
|
inputData.normalWS = Normal;
|
|
#endif
|
|
#else
|
|
inputData.normalWS = WorldNormal;
|
|
#endif
|
|
|
|
inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
|
|
inputData.viewDirectionWS = SafeNormalize( WorldViewDirection );
|
|
|
|
inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw;
|
|
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
float3 SH = SampleSH(inputData.normalWS.xyz);
|
|
#else
|
|
float3 SH = IN.lightmapUVOrVertexSH.xyz;
|
|
#endif
|
|
|
|
#ifdef ASE_BAKEDGI
|
|
inputData.bakedGI = BakedGI;
|
|
#else
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, IN.dynamicLightmapUV.xy, SH, inputData.normalWS);
|
|
#else
|
|
inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS );
|
|
#endif
|
|
#endif
|
|
|
|
inputData.normalizedScreenSpaceUV = NormalizedScreenSpaceUV;
|
|
inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUVOrVertexSH.xy);
|
|
|
|
#if defined(DEBUG_DISPLAY)
|
|
#if defined(DYNAMICLIGHTMAP_ON)
|
|
inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy;
|
|
#endif
|
|
#if defined(LIGHTMAP_ON)
|
|
inputData.staticLightmapUV = IN.lightmapUVOrVertexSH.xy;
|
|
#else
|
|
inputData.vertexSH = SH;
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef _DBUFFER
|
|
ApplyDecal(IN.positionCS,
|
|
BaseColor,
|
|
Specular,
|
|
inputData.normalWS,
|
|
Metallic,
|
|
Occlusion,
|
|
Smoothness);
|
|
#endif
|
|
|
|
BRDFData brdfData;
|
|
InitializeBRDFData
|
|
(BaseColor, Metallic, Specular, Smoothness, Alpha, brdfData);
|
|
|
|
Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask);
|
|
half4 color;
|
|
MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask);
|
|
color.rgb = GlobalIllumination(brdfData, inputData.bakedGI, Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS);
|
|
color.a = Alpha;
|
|
|
|
#ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
|
|
color.rgb *= color.a;
|
|
#endif
|
|
|
|
#ifdef ASE_DEPTH_WRITE_ON
|
|
outputDepth = DepthValue;
|
|
#endif
|
|
|
|
return BRDFDataToGbuffer(brdfData, inputData, Smoothness, Emission + color.rgb, Occlusion);
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "SceneSelectionPass"
|
|
Tags { "LightMode"="SceneSelectionPass" }
|
|
|
|
Cull Off
|
|
AlphaToMask Off
|
|
|
|
HLSLPROGRAM
|
|
|
|
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ASE_FOG 1
|
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
|
#define _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SCENESELECTIONPASS 1
|
|
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140007
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
|
#endif
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _Main;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
VertexOutput VertexFunction(VertexInput v )
|
|
{
|
|
VertexOutput o;
|
|
ZERO_INITIALIZE(VertexOutput, o);
|
|
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_texcoord1 = v.ase_texcoord1;
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
float3 defaultVertexValue = v.positionOS.xyz;
|
|
#else
|
|
float3 defaultVertexValue = float3(0, 0, 0);
|
|
#endif
|
|
|
|
float3 vertexValue = defaultVertexValue;
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
v.positionOS.xyz = vertexValue;
|
|
#else
|
|
v.positionOS.xyz += vertexValue;
|
|
#endif
|
|
|
|
v.normalOS = v.normalOS;
|
|
|
|
float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
|
|
|
|
o.positionCS = TransformWorldToHClip(positionWS);
|
|
|
|
return o;
|
|
}
|
|
|
|
#if defined(ASE_TESSELLATION)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 normalOS : NORMAL;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct TessellationFactors
|
|
{
|
|
float edge[3] : SV_TessFactor;
|
|
float inside : SV_InsideTessFactor;
|
|
};
|
|
|
|
VertexControl vert ( VertexInput v )
|
|
{
|
|
VertexControl o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.vertex = v.positionOS;
|
|
o.normalOS = v.normalOS;
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_texcoord1 = v.ase_texcoord1;
|
|
return o;
|
|
}
|
|
|
|
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
|
|
{
|
|
TessellationFactors o;
|
|
float4 tf = 1;
|
|
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
|
|
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
|
|
#if defined(ASE_FIXED_TESSELLATION)
|
|
tf = FixedTess( tessValue );
|
|
#elif defined(ASE_DISTANCE_TESSELLATION)
|
|
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
|
|
#elif defined(ASE_LENGTH_TESSELLATION)
|
|
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
|
|
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
|
|
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
|
|
#endif
|
|
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
|
|
return o;
|
|
}
|
|
|
|
[domain("tri")]
|
|
[partitioning("fractional_odd")]
|
|
[outputtopology("triangle_cw")]
|
|
[patchconstantfunc("TessellationFunction")]
|
|
[outputcontrolpoints(3)]
|
|
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
|
|
{
|
|
return patch[id];
|
|
}
|
|
|
|
[domain("tri")]
|
|
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
|
|
{
|
|
VertexInput o = (VertexInput) 0;
|
|
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
|
|
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
|
|
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
|
|
#if defined(ASE_PHONG_TESSELLATION)
|
|
float3 pp[3];
|
|
for (int i = 0; i < 3; ++i)
|
|
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
|
|
float phongStrength = _TessPhongStrength;
|
|
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
|
|
#endif
|
|
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
|
|
return VertexFunction(o);
|
|
}
|
|
#else
|
|
VertexOutput vert ( VertexInput v )
|
|
{
|
|
return VertexFunction( v );
|
|
}
|
|
#endif
|
|
|
|
half4 frag(VertexOutput IN ) : SV_TARGET
|
|
{
|
|
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
|
|
|
|
float3 texCoord76 = IN.ase_texcoord.xyz;
|
|
texCoord76.xy = IN.ase_texcoord.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 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_texcoord1;
|
|
texCoord137.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord1;
|
|
texCoord157.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord.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 temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
|
|
|
|
surfaceDescription.Alpha = temp_output_126_0;
|
|
surfaceDescription.AlphaClipThreshold = 0.5;
|
|
|
|
#if _ALPHATEST_ON
|
|
float alphaClipThreshold = 0.01f;
|
|
#if ALPHA_CLIP_THRESHOLD
|
|
alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
|
|
#endif
|
|
clip(surfaceDescription.Alpha - alphaClipThreshold);
|
|
#endif
|
|
|
|
half4 outColor = 0;
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
|
|
#elif defined(SCENEPICKINGPASS)
|
|
outColor = _SelectionID;
|
|
#endif
|
|
|
|
return outColor;
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "ScenePickingPass"
|
|
Tags { "LightMode"="Picking" }
|
|
|
|
AlphaToMask Off
|
|
|
|
HLSLPROGRAM
|
|
|
|
|
|
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#define ASE_FOG 1
|
|
#define _SURFACE_TYPE_TRANSPARENT 1
|
|
#define _EMISSION
|
|
#define ASE_SRP_VERSION 140010
|
|
|
|
|
|
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SCENEPICKINGPASS 1
|
|
|
|
#define ATTRIBUTES_NEED_NORMAL
|
|
#define ATTRIBUTES_NEED_TANGENT
|
|
#define SHADERPASS SHADERPASS_DEPTHONLY
|
|
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140010
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
|
|
|
|
#if ASE_SRP_VERSION >=140007
|
|
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
|
|
#endif
|
|
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
|
|
|
|
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float3 normalOS : NORMAL;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 positionCS : SV_POSITION;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _FireColor;
|
|
float4 _LimitUVRange;
|
|
float4 _StaticMask_ST;
|
|
float4 _FireTexture_ST;
|
|
float2 _Tiling;
|
|
float2 _Scroll;
|
|
float2 _Offset;
|
|
float2 _SmoothStep;
|
|
float2 _StretchUVDes;
|
|
float2 _MaskTiling;
|
|
float2 _MaskOffset;
|
|
float2 _MaskScroll;
|
|
float2 _StretchMultiplier;
|
|
float _LimitUV;
|
|
float _Stretch;
|
|
float _Feather1;
|
|
float _Mask;
|
|
float _Feather;
|
|
#ifdef ASE_TRANSMISSION
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef ASE_TRANSLUCENCY
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef ASE_TESSELLATION
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
#ifdef SCENEPICKINGPASS
|
|
float4 _SelectionID;
|
|
#endif
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
int _ObjectId;
|
|
int _PassValue;
|
|
#endif
|
|
|
|
sampler2D _Main;
|
|
sampler2D _NoiseMask;
|
|
sampler2D _StaticMask;
|
|
|
|
|
|
|
|
struct SurfaceDescription
|
|
{
|
|
float Alpha;
|
|
float AlphaClipThreshold;
|
|
};
|
|
|
|
VertexOutput VertexFunction(VertexInput v )
|
|
{
|
|
VertexOutput o;
|
|
ZERO_INITIALIZE(VertexOutput, o);
|
|
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_texcoord1 = v.ase_texcoord1;
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
float3 defaultVertexValue = v.positionOS.xyz;
|
|
#else
|
|
float3 defaultVertexValue = float3(0, 0, 0);
|
|
#endif
|
|
|
|
float3 vertexValue = defaultVertexValue;
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
v.positionOS.xyz = vertexValue;
|
|
#else
|
|
v.positionOS.xyz += vertexValue;
|
|
#endif
|
|
|
|
v.normalOS = v.normalOS;
|
|
|
|
float3 positionWS = TransformObjectToWorld( v.positionOS.xyz );
|
|
o.positionCS = TransformWorldToHClip(positionWS);
|
|
|
|
return o;
|
|
}
|
|
|
|
#if defined(ASE_TESSELLATION)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 normalOS : NORMAL;
|
|
float4 ase_color : COLOR;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct TessellationFactors
|
|
{
|
|
float edge[3] : SV_TessFactor;
|
|
float inside : SV_InsideTessFactor;
|
|
};
|
|
|
|
VertexControl vert ( VertexInput v )
|
|
{
|
|
VertexControl o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.vertex = v.positionOS;
|
|
o.normalOS = v.normalOS;
|
|
o.ase_color = v.ase_color;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_texcoord1 = v.ase_texcoord1;
|
|
return o;
|
|
}
|
|
|
|
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
|
|
{
|
|
TessellationFactors o;
|
|
float4 tf = 1;
|
|
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
|
|
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
|
|
#if defined(ASE_FIXED_TESSELLATION)
|
|
tf = FixedTess( tessValue );
|
|
#elif defined(ASE_DISTANCE_TESSELLATION)
|
|
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
|
|
#elif defined(ASE_LENGTH_TESSELLATION)
|
|
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
|
|
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
|
|
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
|
|
#endif
|
|
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
|
|
return o;
|
|
}
|
|
|
|
[domain("tri")]
|
|
[partitioning("fractional_odd")]
|
|
[outputtopology("triangle_cw")]
|
|
[patchconstantfunc("TessellationFunction")]
|
|
[outputcontrolpoints(3)]
|
|
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
|
|
{
|
|
return patch[id];
|
|
}
|
|
|
|
[domain("tri")]
|
|
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
|
|
{
|
|
VertexInput o = (VertexInput) 0;
|
|
o.positionOS = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
|
|
o.normalOS = patch[0].normalOS * bary.x + patch[1].normalOS * bary.y + patch[2].normalOS * bary.z;
|
|
o.ase_color = patch[0].ase_color * bary.x + patch[1].ase_color * bary.y + patch[2].ase_color * bary.z;
|
|
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_texcoord1 = patch[0].ase_texcoord1 * bary.x + patch[1].ase_texcoord1 * bary.y + patch[2].ase_texcoord1 * bary.z;
|
|
#if defined(ASE_PHONG_TESSELLATION)
|
|
float3 pp[3];
|
|
for (int i = 0; i < 3; ++i)
|
|
pp[i] = o.positionOS.xyz - patch[i].normalOS * (dot(o.positionOS.xyz, patch[i].normalOS) - dot(patch[i].vertex.xyz, patch[i].normalOS));
|
|
float phongStrength = _TessPhongStrength;
|
|
o.positionOS.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.positionOS.xyz;
|
|
#endif
|
|
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
|
|
return VertexFunction(o);
|
|
}
|
|
#else
|
|
VertexOutput vert ( VertexInput v )
|
|
{
|
|
return VertexFunction( v );
|
|
}
|
|
#endif
|
|
|
|
half4 frag(VertexOutput IN ) : SV_TARGET
|
|
{
|
|
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
|
|
|
|
float3 texCoord76 = IN.ase_texcoord.xyz;
|
|
texCoord76.xy = IN.ase_texcoord.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 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_texcoord1;
|
|
texCoord137.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float lerpResult172 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , texCoord137.z);
|
|
float4 texCoord157 = IN.ase_texcoord1;
|
|
texCoord157.xy = IN.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float2 texCoord156 = IN.ase_texcoord.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 temp_output_126_0 = ( ( IN.ase_color.a * tex2DNode73.a ) * (( _Mask )?( smoothstepResult155 ):( 1.0 )) * smoothstepResult165 );
|
|
|
|
|
|
surfaceDescription.Alpha = temp_output_126_0;
|
|
surfaceDescription.AlphaClipThreshold = 0.5;
|
|
|
|
#if _ALPHATEST_ON
|
|
float alphaClipThreshold = 0.01f;
|
|
#if ALPHA_CLIP_THRESHOLD
|
|
alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
|
|
#endif
|
|
clip(surfaceDescription.Alpha - alphaClipThreshold);
|
|
#endif
|
|
|
|
half4 outColor = 0;
|
|
|
|
#ifdef SCENESELECTIONPASS
|
|
outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
|
|
#elif defined(SCENEPICKINGPASS)
|
|
outColor = _SelectionID;
|
|
#endif
|
|
|
|
return outColor;
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
}
|
|
|
|
// CustomEditor "UnityEditor.ShaderGraphLitGUI"
|
|
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;7;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;8;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;119;115.9227,1689.141;Inherit;False;0;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.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.Vector2Node;75;221.351,191.4847;Inherit;False;Property;_Scroll;Scroll;4;0;Create;True;0;0;0;False;0;False;1,0;1,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;76;223.2823,-11.87827;Inherit;False;0;-1;3;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.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;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.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.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;3;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;9;0;Create;True;0;0;0;False;0;False;0;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;146;2160.628,535.6385;Inherit;False;1444.062;1209.11;Mask;13;170;169;137;125;147;155;148;171;172;173;174;175;176;;1,1,1,1;0;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;12;0;Create;True;0;0;0;False;0;False;0,0;1,0;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;2;0;Create;True;0;0;0;False;0;False;1,1;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.Vector4Node;83;1367.36,-657.3679;Inherit;False;Property;_LimitUVRange;LimitUVRange;5;1;[Header];Create;True;1;LimitUV;0;0;False;0;False;0,1,0,1;0,1,0,1;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.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;14;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
|
|
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;2210.485,1244.625;Inherit;False;Property;_Feather;Feather;15;0;Create;True;0;0;0;False;0;False;0;0.155;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;173;2278.105,1079.171;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.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;13;0;Create;True;0;0;0;False;0;False;0,0;1,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;2552.765,1124.49;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;169;2607.963,1285.665;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;2764.444,1233.436;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;98;2929.765,-423.1228;Inherit;False;712.2244;719.6301;VertexColor;7;195;95;97;121;96;122;120;;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.ToggleSwitchNode;109;2179.447,-325.5556;Inherit;False;Property;_LimitUV;LimitUV;6;0;Create;True;0;0;0;False;0;False;0;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.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.SamplerNode;125;2604.117,826.5101;Inherit;True;Property;_NoiseMask;NoiseMask;10;2;[Header];[NoScaleOffset];Create;True;1;Mask;0;0;False;0;False;-1;None;cfd22da0c4bc7af4bb5f6497b36ed0c2;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.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;73;2583.71,-121.8407;Inherit;True;Property;_Main;Main;1;2;[Header];[NoScaleOffset];Create;True;1;Main;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.VertexColorNode;96;2956.925,-172.8337;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;148;2824.794,646.5159;Inherit;False;Constant;_Float2;Float 2;12;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;164;2815.758,1900.221;Inherit;True;Property;_StaticMask;StaticMask;16;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;17;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;177;1279.031,-1362.072;Inherit;False;559.9969;396.921;Comment;3;194;193;180;N . L;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;178;2151.931,-1509.771;Inherit;False;723.599;290;Also know as Lambert Wrap or Half Lambert;3;185;183;181;Diffuse Wrap;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;179;2643.409,-1129.198;Inherit;False;812;304;Comment;5;190;187;186;184;182;Attenuation and Ambient;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;231;4186.667,-1349.797;Inherit;False;1505.066;977.1329;SurfaceFireErosion;14;220;225;226;227;229;228;223;222;219;224;206;207;232;233;;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;97;3214.735,62.38358;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SmoothstepOpNode;165;3214.41,1984.56;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ToggleSwitchNode;147;3171.941,733.5972;Inherit;False;Property;_Mask;Mask;11;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.CommentaryNode;210;4213.159,-1917.09;Inherit;False;618.6001;377.4633;FresnelMask;5;204;205;203;209;208;;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;120;2967.5,-290.9236;Inherit;False;1;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;122;2976.133,-363.7119;Inherit;False;Constant;_Float0;Float 0;8;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.WorldSpaceLightDirHlpNode;193;1365.721,-1125.193;Inherit;False;False;1;0;FLOAT;0;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
|
|
Node;AmplifyShaderEditor.WorldNormalVector;194;1352.87,-1303.758;Inherit;False;False;1;0;FLOAT3;0,0,0;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;121;3237.433,-342.9119;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.DotProductOpNode;180;1679.031,-1250.072;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;181;2201.931,-1334.771;Float;False;Constant;_WrapperValue;Wrapper Value;0;0;Create;True;0;0;0;False;0;False;0.5;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;95;3218.178,-102.1768;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ScaleAndOffsetNode;183;2467.333,-1459.771;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;1;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.IndirectDiffuseLighting;184;2899.41,-1001.197;Inherit;False;Tangent;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.SaturateNode;185;2700.531,-1452.972;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RegisterLocalVarNode;195;3401.36,-134.8984;Inherit;False;Diffuse;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.LightAttenuation;182;2670.809,-941.1971;Inherit;False;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;220;4431.377,-617.4821;Inherit;False;Constant;_Float6;Float 5;19;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;226;4304.287,-897.7349;Inherit;False;Constant;_Float7;Float 3;19;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;186;3139.41,-969.1971;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
|
|
Node;AmplifyShaderEditor.LightColorNode;187;2755.41,-1081.198;Inherit;False;0;3;COLOR;0;FLOAT3;1;FLOAT;2
|
|
Node;AmplifyShaderEditor.SamplerNode;188;3071.031,-1474.072;Inherit;True;Property;_ToonRamp;Toon Ramp;0;0;Create;True;0;0;0;False;0;False;-1;None;c755faa3a4b9cd34694d54c650952df5;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;1;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.GetLocalVarNode;196;3212.541,-1664.712;Inherit;False;195;Diffuse;1;0;OBJECT;;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;225;4236.667,-732.281;Inherit;False;Property;_Feather1;Feather;22;0;Create;True;0;0;0;False;0;False;0;0.062;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode;227;4578.947,-852.4158;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;229;4634.145,-691.241;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;190;3299.41,-1081.198;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;191;3445.03,-1514.072;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;233;4241.063,-522.6058;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.LerpOp;228;4790.626,-743.47;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;192;3780.631,-1240.872;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;223;4997.175,-556.4821;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleSubtractOpNode;222;5002.697,-798.1351;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RegisterLocalVarNode;197;3968.692,-1228.28;Inherit;False;Surface;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SamplerNode;219;4690.869,-1099.623;Inherit;True;Property;_FireTexture;FireTexture;21;0;Create;True;0;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.SmoothstepOpNode;224;5172.944,-944.6721;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;1,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;232;5256.142,-689.6547;Inherit;True;197;Surface;1;0;OBJECT;;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ColorNode;206;5145.22,-1299.797;Inherit;False;Property;_FireColor;FireColor;20;1;[HDR];Create;True;0;0;0;False;0;False;0,0,0,0;2.996079,1.076056,0,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;207;5513.733,-816.4454;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;198;5412.94,-236.3937;Inherit;False;197;Surface;1;0;OBJECT;;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;201;5669.538,-314.5926;Inherit;True;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;204;4263.159,-1748.953;Inherit;False;Property;_FresnelScale;FresnelScale;19;0;Create;True;0;0;0;False;0;False;0;4.65;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;205;4264.253,-1657.068;Inherit;False;Property;_FresnelPower;FresnelPower;18;0;Create;True;0;0;0;False;0;False;0;2.77;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.FresnelNode;203;4458.961,-1867.09;Inherit;False;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.RangedFloatNode;209;4546.975,-1652.626;Inherit;False;Constant;_Float4;Float 4;22;0;Create;True;0;0;0;False;0;False;0.5;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.StepOpNode;208;4685.759,-1781.378;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;145;5917.56,-83.80117;Inherit;False;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.SimpleMultiplyOpNode;126;5829.134,97.76434;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;234;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;0;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;236;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;False;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=ShadowCaster;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;237;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;True;True;False;False;False;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;False;False;True;1;LightMode=DepthOnly;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;238;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;239;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=Universal2D;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;240;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthNormals;0;6;DepthNormals;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;1;False;;0;False;;0;1;False;;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;False;;True;3;False;;False;True;1;LightMode=DepthNormals;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;241;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;GBuffer;0;7;GBuffer;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalGBuffer;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;242;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;SceneSelectionPass;0;8;SceneSelectionPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;2;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=SceneSelectionPass;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;243;6152.74,-87.66552;Float;False;False;-1;2;UnityEditor.ShaderGraphLitGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ScenePickingPass;0;9;ScenePickingPass;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=Picking;False;False;0;;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;235;6152.74,-87.66552;Float;False;True;-1;2;UnityEditor.ShaderGraphLitGUI;0;12;Smoke;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;21;False;False;False;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;False;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;4;RenderPipeline=UniversalPipeline;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;UniversalMaterialType=Lit;True;5;True;12;all;0;False;True;1;5;False;;10;False;;1;1;False;;10;False;;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;1;LightMode=UniversalForward;False;False;0;;0;0;Standard;39;Workflow;1;0;Surface;1;638476429331634111; Refraction Model;0;0; Blend;0;0;Two Sided;1;0;Fragment Normal Space,InvertActionOnDeselection;0;0;Forward Only;0;0;Transmission;0;0; Transmission Shadow;0.5,False,;0;Translucency;0;0; Translucency Strength;1,False,;0; Normal Distortion;0.5,False,;0; Scattering;2,False,;0; Direct;0.9,False,;0; Ambient;0.1,False,;0; Shadow;0.5,False,;0;Cast Shadows;1;0; Use Shadow Threshold;0;0;GPU Instancing;1;0;LOD CrossFade;1;0;Built-in Fog;1;0;_FinalColorxAlpha;0;0;Meta Pass;1;0;Override Baked GI;0;0;Extra Pre Pass;0;0;Tessellation;0;0; Phong;0;0; Strength;0.5,False,;0; Type;0;0; Tess;16,False,;0; Min;10,False,;0; Max;25,False,;0; Edge Length;16,False,;0; Max Displacement;25,False,;0;Write Depth;0;0; Early Z;0;0;Vertex Position,InvertActionOnDeselection;1;0;Debug Display;0;0;Clear Coat;0;0;0;10;False;True;True;True;True;True;True;True;True;True;False;;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;125;1;156;0
|
|
WireConnection;175;0;172;0
|
|
WireConnection;175;1;170;0
|
|
WireConnection;176;0;172;0
|
|
WireConnection;176;1;170;0
|
|
WireConnection;73;1;109;0
|
|
WireConnection;155;0;125;1
|
|
WireConnection;155;1;175;0
|
|
WireConnection;155;2;176;0
|
|
WireConnection;97;0;96;4
|
|
WireConnection;97;1;73;4
|
|
WireConnection;165;0;164;1
|
|
WireConnection;165;1;166;1
|
|
WireConnection;165;2;166;2
|
|
WireConnection;147;0;148;0
|
|
WireConnection;147;1;155;0
|
|
WireConnection;121;0;122;0
|
|
WireConnection;121;1;120;1
|
|
WireConnection;180;0;194;0
|
|
WireConnection;180;1;193;0
|
|
WireConnection;95;0;96;0
|
|
WireConnection;95;1;73;0
|
|
WireConnection;95;2;121;0
|
|
WireConnection;183;0;180;0
|
|
WireConnection;183;1;181;0
|
|
WireConnection;183;2;181;0
|
|
WireConnection;185;0;183;0
|
|
WireConnection;195;0;95;0
|
|
WireConnection;186;0;184;0
|
|
WireConnection;186;1;182;0
|
|
WireConnection;188;1;185;0
|
|
WireConnection;227;0;226;0
|
|
WireConnection;227;1;225;0
|
|
WireConnection;229;0;220;0
|
|
WireConnection;229;1;225;0
|
|
WireConnection;190;0;187;0
|
|
WireConnection;190;1;186;0
|
|
WireConnection;191;0;196;0
|
|
WireConnection;191;1;188;0
|
|
WireConnection;228;0;227;0
|
|
WireConnection;228;1;229;0
|
|
WireConnection;228;2;233;2
|
|
WireConnection;192;0;191;0
|
|
WireConnection;192;1;190;0
|
|
WireConnection;223;0;228;0
|
|
WireConnection;223;1;225;0
|
|
WireConnection;222;0;228;0
|
|
WireConnection;222;1;225;0
|
|
WireConnection;197;0;192;0
|
|
WireConnection;224;0;219;0
|
|
WireConnection;224;1;222;0
|
|
WireConnection;224;2;223;0
|
|
WireConnection;207;0;206;0
|
|
WireConnection;207;1;224;0
|
|
WireConnection;207;2;232;0
|
|
WireConnection;201;0;207;0
|
|
WireConnection;201;1;198;0
|
|
WireConnection;203;2;204;0
|
|
WireConnection;203;3;205;0
|
|
WireConnection;208;0;209;0
|
|
WireConnection;208;1;203;0
|
|
WireConnection;145;0;201;0
|
|
WireConnection;145;3;126;0
|
|
WireConnection;126;0;97;0
|
|
WireConnection;126;1;147;0
|
|
WireConnection;126;2;165;0
|
|
WireConnection;235;2;145;0
|
|
WireConnection;235;6;126;0
|
|
ASEEND*/
|
|
//CHKSM=097E46214CB67986A2735827B72D828EFB7657F0 |