shaoxiadiablo/Assets/Arts/VFX/Shader/Dissolve_soft.shader

246 lines
12 KiB
Plaintext
Raw Normal View History

2025-05-18 01:04:31 +08:00
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Cheng/Dissolve_Soft"
{
Properties
{
[Enum(lizi,1,moxing,0)]_Moshi("Moshi", Float) = 0
[HDR]_MianColor("MianColor", Color) = (2,2,2,1)
_MainTex("MainTex", 2D) = "white" {}
_NoiseTex("NoiseTex", 2D) = "white" {}
_Disslove("Disslove", Range( 0 , 1)) = 0.546809
_EageWidth("EageWidth", Range( 0 , 1)) = 0
_Hardness("Hardness", Range( 0 , 0.99)) = 0
_Noise_U1("Noise_U", Float) = 0
_Noise_V1("Noise_V", Float) = 0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" "Queue"="Transparent" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
ColorMask RGBA
ZWrite Off
ZTest LEqual
Offset 0 , 0
Pass
{
Name "Unlit"
Tags { "LightMode"="ForwardBase" }
CGPROGRAM
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
//only defining to not throw compilation error over Unity 5.5
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#endif
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityShaderVariables.cginc"
#define ASE_NEEDS_FRAG_COLOR
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord1 : TEXCOORD1;
};
struct v2f
{
float4 vertex : SV_POSITION;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 worldPos : TEXCOORD0;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
float4 ase_texcoord1 : TEXCOORD1;
float4 ase_color : COLOR;
float4 ase_texcoord2 : TEXCOORD2;
};
uniform sampler2D _MainTex;
uniform half4 _MainTex_ST;
uniform half4 _MianColor;
uniform sampler2D _NoiseTex;
uniform half4 _NoiseTex_ST;
uniform half _Noise_U1;
uniform half _Noise_V1;
uniform half _Disslove;
uniform half _EageWidth;
uniform half _Hardness;
uniform half _Moshi;
v2f vert ( appdata v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
half4 appendResult58 = (half4(_Disslove , _EageWidth , _Hardness , 0.0));
half4 uv154 = v.ase_texcoord1;
uv154.xy = v.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
half4 lerpResult56 = lerp( appendResult58 , uv154 , _Moshi);
half4 break60 = lerpResult56;
half vertexToFrag52 = ( ( ( break60.x * ( 1.0 + break60.y ) ) - break60.y ) * ( 1.0 + ( 1.0 - break60.z ) ) );
o.ase_texcoord1.z = vertexToFrag52;
o.ase_texcoord1.xy = v.ase_texcoord.xy;
o.ase_color = v.color;
o.ase_texcoord2 = v.ase_texcoord1;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.w = 0;
float3 vertexValue = float3(0, 0, 0);
vertexValue = vertexValue;
v.vertex.xyz += vertexValue;
o.vertex = UnityObjectToClipPos(v.vertex);
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
#endif
return o;
}
fixed4 frag (v2f i ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
fixed4 finalColor;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 WorldPosition = i.worldPos;
#endif
float2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
half4 tex2DNode1 = tex2D( _MainTex, uv_MainTex );
half2 uv0_NoiseTex = i.ase_texcoord1.xy * _NoiseTex_ST.xy + _NoiseTex_ST.zw;
half2 appendResult75 = (half2(_Noise_U1 , _Noise_V1));
half vertexToFrag52 = i.ase_texcoord1.z;
half4 appendResult58 = (half4(_Disslove , _EageWidth , _Hardness , 0.0));
half4 uv154 = i.ase_texcoord2;
uv154.xy = i.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
half4 lerpResult56 = lerp( appendResult58 , uv154 , _Moshi);
half4 break60 = lerpResult56;
half Hardness48 = break60.z;
half temp_output_8_0_g3 = Hardness48;
half Dissolve70 = saturate( ( ( ( ( tex2D( _NoiseTex, ( uv0_NoiseTex + ( appendResult75 * _Time.y ) ) ).r + 1.0 ) - vertexToFrag52 ) - temp_output_8_0_g3 ) / ( 1.0 - temp_output_8_0_g3 ) ) );
half4 appendResult9 = (half4(( tex2DNode1 * _MianColor * i.ase_color ).rgb , ( tex2DNode1.a * _MianColor.a * i.ase_color.a * Dissolve70 )));
finalColor = appendResult9;
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18100
339;317;2100;1280;2982.025;-917.3942;1.437309;True;False
Node;AmplifyShaderEditor.CommentaryNode;66;-2292.094,1451.665;Inherit;False;1121.534;542.332;UV2;8;32;18;39;54;58;60;56;69;;1,1,1,1;0;0
Node;AmplifyShaderEditor.RangedFloatNode;18;-2198.52,1501.665;Half;False;Property;_Disslove;Disslove;4;0;Create;True;0;0;False;0;False;0.546809;0.589;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;32;-2231.094,1696.172;Half;False;Property;_Hardness;Hardness;6;0;Create;True;0;0;False;0;False;0;0.99;0;0.99;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;39;-2191.498,1605.682;Half;False;Property;_EageWidth;EageWidth;5;0;Create;True;0;0;False;0;False;0;0.086;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;69;-1821.167,1799.49;Inherit;False;Property;_Moshi;Moshi;0;1;[Enum];Create;True;2;lizi;1;moxing;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.DynamicAppendNode;58;-1810.551,1580.54;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;54;-2192.349,1791.997;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.CommentaryNode;79;-1734.896,820.0403;Inherit;False;979.8544;551.9313;NoiseUV;7;73;72;75;74;76;77;78;;1,1,1,1;0;0
Node;AmplifyShaderEditor.LerpOp;56;-1596.485,1604.137;Inherit;False;3;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0,0,0,0;False;2;FLOAT;0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.RangedFloatNode;72;-1684.896,1066.712;Inherit;False;Property;_Noise_V1;Noise_V;8;0;Create;True;0;0;False;0;False;0;0.19;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;73;-1671.895,981.7123;Inherit;False;Property;_Noise_U1;Noise_U;7;0;Create;True;0;0;False;0;False;0;0.69;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.BreakToComponentsNode;60;-1423.56,1603.135;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
Node;AmplifyShaderEditor.DynamicAppendNode;75;-1452.142,1031.272;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleAddOpNode;34;-951.5751,1582.991;Inherit;False;2;2;0;FLOAT;1;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TimeNode;74;-1545.442,1192.972;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;76;-1186.642,1087.771;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;21;-795.6507,1459.956;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;2;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;33;-960.7084,1716.685;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;77;-1370.691,870.0403;Inherit;False;0;5;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;44;-551.8225,1593.026;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;40;-703.8338,1715.653;Inherit;False;2;2;0;FLOAT;1;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;78;-909.0416,999.4713;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;36;-386.2742,1736.838;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;2;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;5;-477.9722,1021.509;Inherit;True;Property;_NoiseTex;NoiseTex;3;0;Create;True;0;0;False;0;False;-1;e28dc97a9541e3642a48c0e3886688c5;cd460ee4ac5c1e746b7a734cc7cc64dd;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.VertexToFragmentNode;52;-199.6438,1533.022;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;48;-993.2989,1855.717;Half;False;Hardness;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;17;-102.742,1212.88;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;42;83.62375,1279.268;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;57;-81.66447,1764.165;Inherit;False;48;Hardness;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;37;272.4304,1371.513;Inherit;True;SmoothStep_Smple;-1;;3;8594d1506a87e5b4fb80cb099b5fcde4;0;3;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;70;550.4435,1365.293;Inherit;True;Dissolve;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;2;-1845.741,119.847;Half;False;Property;_MianColor;MianColor;1;1;[HDR];Create;True;0;0;False;0;False;2,2,2,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;1;-1858.205,-84.67444;Inherit;True;Property;_MainTex;MainTex;2;0;Create;True;0;0;False;0;False;-1;80ab37a9e4f49c842903bb43bdd7bcd2;2c6536772776dd84f872779990273bfc;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.VertexColorNode;3;-1794.429,357.4462;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;71;-1613.737,518.9337;Inherit;True;70;Dissolve;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;4;-1398.04,-20.04112;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.SimpleMultiplyOpNode;55;-1332.271,301.2447;Inherit;False;4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.DynamicAppendNode;9;-1070.667,149.3698;Inherit;True;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;-757.8702,151.7203;Half;False;True;-1;2;ASEMaterialInspector;100;11;Cheng/Dissolve_Soft;23941dbacc39cbf4996969912d2446a4;True;Unlit;0;0;Unlit;2;True;2;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;True;False;True;2;False;-1;True;True;True;True;True;0;False;-1;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;2;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;2;RenderType=Opaque=RenderType;Queue=Transparent=Queue=0;True;2;0;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;0;0;1;True;False;;0
WireConnection;58;0;18;0
WireConnection;58;1;39;0
WireConnection;58;2;32;0
WireConnection;56;0;58;0
WireConnection;56;1;54;0
WireConnection;56;2;69;0
WireConnection;60;0;56;0
WireConnection;75;0;73;0
WireConnection;75;1;72;0
WireConnection;34;1;60;1
WireConnection;76;0;75;0
WireConnection;76;1;74;2
WireConnection;21;0;60;0
WireConnection;21;1;34;0
WireConnection;33;0;60;2
WireConnection;44;0;21;0
WireConnection;44;1;60;1
WireConnection;40;1;33;0
WireConnection;78;0;77;0
WireConnection;78;1;76;0
WireConnection;36;0;44;0
WireConnection;36;1;40;0
WireConnection;5;1;78;0
WireConnection;52;0;36;0
WireConnection;48;0;60;2
WireConnection;17;0;5;1
WireConnection;42;0;17;0
WireConnection;42;1;52;0
WireConnection;37;7;42;0
WireConnection;37;8;57;0
WireConnection;70;0;37;0
WireConnection;4;0;1;0
WireConnection;4;1;2;0
WireConnection;4;2;3;0
WireConnection;55;0;1;4
WireConnection;55;1;2;4
WireConnection;55;2;3;4
WireConnection;55;3;71;0
WireConnection;9;0;4;0
WireConnection;9;3;55;0
WireConnection;0;0;9;0
ASEEND*/
//CHKSM=3F0458640C2062C6578C4D58F4119D4C0961C150