// Made with Amplify Shader Editor // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Cheng/Dissolve" { Properties { [HDR]_MianColor("MianColor", Color) = (2,2,2,1) _MainTex("MainTex", 2D) = "white" {} _NoiseTex("NoiseTex", 2D) = "white" {} [Enum(lizi,1,moxing,0)]_Moshi1("Moshi", Float) = 1 _Disslove("Disslove", Range( 0 , 1)) = 1 _Hardness1("Hardness", Range( 0 , 0.99)) = 0.99 _Noise_U("Noise_U", Float) = 0 _Noise_V("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; }; uniform sampler2D _MainTex; uniform half4 _MainTex_ST; uniform half4 _MianColor; uniform half _Disslove; uniform half _Hardness1; uniform half _Moshi1; uniform sampler2D _NoiseTex; uniform half4 _NoiseTex_ST; uniform half _Noise_U; uniform half _Noise_V; v2f vert ( appdata v ) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); UNITY_TRANSFER_INSTANCE_ID(v, o); o.ase_texcoord1.xy = v.ase_texcoord.xy; o.ase_color = v.color; o.ase_texcoord1.zw = v.ase_texcoord1.xy; 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 appendResult89 = (half2(_Disslove , _Hardness1)); half2 uv154 = i.ase_texcoord1.zw * float2( 1,1 ) + float2( 0,0 ); half2 lerpResult92 = lerp( appendResult89 , uv154 , _Moshi1); half2 break94 = lerpResult92; half2 uv0_NoiseTex = i.ase_texcoord1.xy * _NoiseTex_ST.xy + _NoiseTex_ST.zw; half2 appendResult75 = (half2(_Noise_U , _Noise_V)); half smoothstepResult85 = smoothstep( break94.y , 1.0 , ( ( tex2D( _NoiseTex, ( uv0_NoiseTex + ( appendResult75 * _Time.y ) ) ).r + 1.0 ) - ( break94.x * ( ( 1.0 - break94.y ) + 1.0 ) ) )); half Dissolve70 = smoothstepResult85; 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 264;143;2206;1096;2617.648;71.67982;1.483252;True;False Node;AmplifyShaderEditor.CommentaryNode;66;-1723.712,1421.144;Inherit;False;1161.834;638.0318;UV2;7;94;92;95;91;89;54;18;;1,1,1,1;0;0 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.RangedFloatNode;91;-1641.072,1626.271;Half;False;Property;_Hardness1;Hardness;5;0;Create;True;0;0;False;0;False;0.99;0.99;0;0.99;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;18;-1649.139,1544.144;Half;False;Property;_Disslove;Disslove;4;0;Create;True;0;0;False;0;False;1;0.589;0;1;0;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;89;-1322.529,1568.639;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.TextureCoordinatesNode;54;-1595.968,1710.476;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;95;-1454.641,1856.7;Inherit;False;Property;_Moshi1;Moshi;3;1;[Enum];Create;True;2;lizi;1;moxing;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;72;-1684.896,1066.712;Inherit;False;Property;_Noise_V;Noise_V;7;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_U;Noise_U;6;0;Create;True;0;0;False;0;False;0;0.69;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.LerpOp;92;-1146.463,1662.236;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;1;FLOAT2;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.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.SimpleMultiplyOpNode;76;-1186.642,1087.771;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.TextureCoordinatesNode;77;-1402.691,879.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.BreakToComponentsNode;94;-952.6406,1664.7;Inherit;False;FLOAT2;1;0;FLOAT2;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.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.OneMinusNode;99;-602.089,1726.233;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SamplerNode;5;-709.7722,972.509;Inherit;True;Property;_NoiseTex;NoiseTex;2;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.SimpleAddOpNode;100;-419.089,1724.233;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;98;-280.089,1430.233;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;96;-275.089,1082.233;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleSubtractOpNode;97;-83.08899,1165.233;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SmoothstepOpNode;85;126.5263,1475.074;Inherit;True;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.RegisterLocalVarNode;70;403.8671,1470.601;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;0;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.GetLocalVarNode;71;-1613.737,518.9337;Inherit;True;70;Dissolve;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.SamplerNode;1;-1858.205,-84.67444;Inherit;True;Property;_MainTex;MainTex;1;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.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.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.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;-751.6205,158.0567;Half;False;True;-1;2;ASEMaterialInspector;100;11;Cheng/Dissolve;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;89;0;18;0 WireConnection;89;1;91;0 WireConnection;92;0;89;0 WireConnection;92;1;54;0 WireConnection;92;2;95;0 WireConnection;75;0;73;0 WireConnection;75;1;72;0 WireConnection;76;0;75;0 WireConnection;76;1;74;2 WireConnection;94;0;92;0 WireConnection;78;0;77;0 WireConnection;78;1;76;0 WireConnection;99;0;94;1 WireConnection;5;1;78;0 WireConnection;100;0;99;0 WireConnection;98;0;94;0 WireConnection;98;1;100;0 WireConnection;96;0;5;1 WireConnection;97;0;96;0 WireConnection;97;1;98;0 WireConnection;85;0;97;0 WireConnection;85;1;94;1 WireConnection;70;0;85;0 WireConnection;55;0;1;4 WireConnection;55;1;2;4 WireConnection;55;2;3;4 WireConnection;55;3;71;0 WireConnection;4;0;1;0 WireConnection;4;1;2;0 WireConnection;4;2;3;0 WireConnection;9;0;4;0 WireConnection;9;3;55;0 WireConnection;0;0;9;0 ASEEND*/ //CHKSM=4E5D06D47AAC251B25FD6600E824793CFC1F0864