// Made with Amplify Shader Editor // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Cheng/Dissolve_Alpha" { Properties { [HDR]_MianColor("MianColor", Color) = (1,1,1,1) _MainTex("MainTex", 2D) = "white" {} _NoiseTex1("NoiseTex", 2D) = "white" {} _MaskTex("MaskTex", 2D) = "white" {} [Enum(on,0,off,1)]_NoiseTex_On("Noise Tex_On", Float) = -1.5 _Dissolve1("Dissolve", Float) = 0 _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 half4 _MianColor; uniform sampler2D _MainTex; uniform half4 _MainTex_ST; uniform sampler2D _MaskTex; uniform half4 _MaskTex_ST; uniform sampler2D _NoiseTex1; uniform half4 _NoiseTex1_ST; uniform half _Noise_U; uniform half _Noise_V; uniform half _Dissolve1; uniform half _NoiseTex_On; 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 ); float2 uv_MaskTex = i.ase_texcoord1.xy * _MaskTex_ST.xy + _MaskTex_ST.zw; half2 uv0_NoiseTex1 = i.ase_texcoord1.xy * _NoiseTex1_ST.xy + _NoiseTex1_ST.zw; half2 appendResult40 = (half2(( _Noise_U * _Time.y ) , ( _Time.y * _Noise_V ))); half4 tex2DNode22 = tex2D( _NoiseTex1, ( uv0_NoiseTex1 + appendResult40 ) ); half2 uv125 = i.ase_texcoord1.zw * float2( 1,1 ) + float2( 0,0 ); half lerpResult26 = lerp( _Dissolve1 , _NoiseTex_On , uv125.x); half clampResult29 = clamp( ( ( tex2DNode22.r * _Dissolve1 * tex2DNode22.a ) - lerpResult26 ) , 0.0 , 1.0 ); half4 appendResult9 = (half4(( _MianColor * tex2DNode1 * i.ase_color * tex2D( _MaskTex, uv_MaskTex ).r ).rgb , ( _MianColor.a * tex2DNode1.a * i.ase_color.a * clampResult29 ))); finalColor = appendResult9; return finalColor; } ENDCG } } CustomEditor "ASEMaterialInspector" } /*ASEBEGIN Version=18100 3094;200;1641;1169;291.9829;371.2999;1;True;False Node;AmplifyShaderEditor.RangedFloatNode;36;-2185.784,800.1182;Half;False;Property;_Noise_V;Noise_V;7;0;Create;True;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;35;-2197.784,510.1183;Half;False;Property;_Noise_U;Noise_U;6;0;Create;True;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.TimeNode;34;-2238.784,626.1182;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;37;-1925.783,545.1183;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;38;-1916.783,739.1182;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;40;-1683.783,628.1182;Inherit;True;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.TextureCoordinatesNode;42;-1774.783,305.1183;Inherit;True;0;22;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleAddOpNode;41;-1460.783,532.1182;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0 Node;AmplifyShaderEditor.TextureCoordinatesNode;25;-986.5885,987.5393;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.SamplerNode;22;-1234.625,501.2514;Inherit;True;Property;_NoiseTex1;NoiseTex;2;0;Create;True;0;0;False;0;False;-1;None;None;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.RangedFloatNode;23;-1078.041,852.1762;Inherit;False;Property;_NoiseTex_On;Noise Tex_On;4;1;[Enum];Create;True;2;on;0;off;1;0;False;0;False;-1.5;1;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.RangedFloatNode;24;-1074.005,724.2023;Inherit;False;Property;_Dissolve1;Dissolve;5;0;Create;True;0;0;False;0;False;0;10;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;27;-654.6381,559.9293;Inherit;True;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.LerpOp;26;-508.6421,837.2106;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleSubtractOpNode;28;-247.91,658.1781;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.ClampOpNode;29;-25.9101,640.1781;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.SamplerNode;1;-573.7001,-3.3;Inherit;True;Property;_MainTex;MainTex;1;0;Create;True;0;0;False;0;False;-1;None;None;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.ColorNode;2;-494.5,-190.5;Inherit;False;Property;_MianColor;MianColor;0;1;[HDR];Create;True;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;33;-491.504,-419.8027;Inherit;True;Property;_MaskTex;MaskTex;3;0;Create;True;0;0;False;0;False;-1;None;None;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;-506.9,211.5;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;8;331,217.8;Inherit;True;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;62.1,-6.6;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;FLOAT;0;False;1;COLOR;0 Node;AmplifyShaderEditor.DynamicAppendNode;9;671.5,4.5;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.TemplateMultiPassMasterNode;44;883.6575,-2.984859;Half;False;True;-1;2;ASEMaterialInspector;100;9;Cheng/Dissolve_Alpha;a3a40e173651752418ed18c231bb298a;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;37;0;35;0 WireConnection;37;1;34;2 WireConnection;38;0;34;2 WireConnection;38;1;36;0 WireConnection;40;0;37;0 WireConnection;40;1;38;0 WireConnection;41;0;42;0 WireConnection;41;1;40;0 WireConnection;22;1;41;0 WireConnection;27;0;22;1 WireConnection;27;1;24;0 WireConnection;27;2;22;4 WireConnection;26;0;24;0 WireConnection;26;1;23;0 WireConnection;26;2;25;1 WireConnection;28;0;27;0 WireConnection;28;1;26;0 WireConnection;29;0;28;0 WireConnection;8;0;2;4 WireConnection;8;1;1;4 WireConnection;8;2;3;4 WireConnection;8;3;29;0 WireConnection;4;0;2;0 WireConnection;4;1;1;0 WireConnection;4;2;3;0 WireConnection;4;3;33;1 WireConnection;9;0;4;0 WireConnection;9;3;8;0 WireConnection;44;0;9;0 ASEEND*/ //CHKSM=2F52AB28CC463515069FA4B52000D19694134665