// Made with Amplify Shader Editor // Available at the Unity Asset Store - http://u3d.as/y3X Shader "Cheng/Slash" { Properties { [HDR]_Emission_Color("Emission_Color", Color) = (1,1,1,0) _EmissionTex("EmissionTex", 2D) = "white" {} _Emission("Emission", Float) = 2 _MainTex("MainTex", 2D) = "white" {} _Opacity("Opacity", Float) = 20 _Dissolve("Dissolve", 2D) = "white" {} _Desaturate("Desaturate", Float) = 0 _MainTex_uvDissolveSpeed("MainTex_uv/DissolveSpeed", Vector) = (0,0,0,0) [HideInInspector] _texcoord( "", 2D ) = "white" {} } SubShader { Tags { "RenderType"="Opaque" "Queue"="Transparent" } LOD 100 CGINCLUDE #pragma target 3.0 ENDCG Blend SrcAlpha OneMinusSrcAlpha AlphaToMask Off 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 #pragma multi_compile_instancing #include "UnityCG.cginc" #include "UnityShaderVariables.cginc" #define ASE_NEEDS_FRAG_COLOR struct appdata { float4 vertex : POSITION; float4 color : COLOR; float4 ase_texcoord1 : TEXCOORD1; float4 ase_texcoord : TEXCOORD0; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; #ifdef ASE_NEEDS_FRAG_WORLD_POSITION float3 worldPos : TEXCOORD0; #endif float4 ase_color : COLOR; float4 ase_texcoord1 : TEXCOORD1; float4 ase_texcoord2 : TEXCOORD2; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; uniform half4 _Emission_Color; uniform half _Emission; uniform sampler2D _EmissionTex; uniform half4 _EmissionTex_ST; uniform half _Desaturate; uniform sampler2D _MainTex; uniform half4 _MainTex_ST; uniform half _Opacity; uniform sampler2D _Dissolve; uniform half4 _MainTex_uvDissolveSpeed; uniform half4 _Dissolve_ST; half3 HSVToRGB( half3 c ) { half4 K = half4( 1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0 ); half3 p = abs( frac( c.xxx + K.xyz ) * 6.0 - K.www ); return c.z * lerp( K.xxx, saturate( p - K.xxx ), c.y ); } half3 RGBToHSV(half3 c) { half4 K = half4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); half4 p = lerp( half4( c.bg, K.wz ), half4( c.gb, K.xy ), step( c.b, c.g ) ); half4 q = lerp( half4( p.xyw, c.r ), half4( c.r, p.yzx ), step( p.x, c.r ) ); half d = q.x - min( q.w, q.y ); half e = 1.0e-10; return half3( abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); } 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_color = v.color; o.ase_texcoord1 = v.ase_texcoord1; o.ase_texcoord2 = v.ase_texcoord; float3 vertexValue = float3(0, 0, 0); #if ASE_ABSOLUTE_VERTEX_POS vertexValue = v.vertex.xyz; #endif vertexValue = vertexValue; #if ASE_ABSOLUTE_VERTEX_POS v.vertex.xyz = vertexValue; #else v.vertex.xyz += vertexValue; #endif 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 half4 texCoord24 = i.ase_texcoord1; texCoord24.xy = i.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 ); half Hue50 = texCoord24.z; float2 uv_EmissionTex = i.ase_texcoord2.xy * _EmissionTex_ST.xy + _EmissionTex_ST.zw; half3 hsvTorgb46 = RGBToHSV( tex2D( _EmissionTex, uv_EmissionTex ).rgb ); half3 hsvTorgb45 = HSVToRGB( half3(( Hue50 + hsvTorgb46.x ),hsvTorgb46.y,hsvTorgb46.z) ); half3 desaturateInitialColor48 = hsvTorgb45; half desaturateDot48 = dot( desaturateInitialColor48, float3( 0.299, 0.587, 0.114 )); half3 desaturateVar48 = lerp( desaturateInitialColor48, desaturateDot48.xxx, _Desaturate ); half4 _Vector1 = half4(-0.3,1,-2,1); half3 temp_cast_1 = (_Vector1.x).xxx; half3 temp_cast_2 = (_Vector1.y).xxx; half3 temp_cast_3 = (_Vector1.z).xxx; half3 temp_cast_4 = (_Vector1.w).xxx; half3 clampResult36 = clamp( (temp_cast_3 + (desaturateVar48 - temp_cast_1) * (temp_cast_4 - temp_cast_3) / (temp_cast_2 - temp_cast_1)) , float3( 0,0,0 ) , float3( 1,1,1 ) ); float2 uv_MainTex = i.ase_texcoord2.xy * _MainTex_ST.xy + _MainTex_ST.zw; half clampResult7 = clamp( ( tex2D( _MainTex, uv_MainTex ).a * _Opacity ) , 0.0 , 1.0 ); half2 appendResult25 = (half2(_MainTex_uvDissolveSpeed.z , _MainTex_uvDissolveSpeed.w)); half4 uvs4_Dissolve = i.ase_texcoord2; uvs4_Dissolve.xy = i.ase_texcoord2.xy * _Dissolve_ST.xy + _Dissolve_ST.zw; half2 panner26 = ( 1.0 * _Time.y * appendResult25 + uvs4_Dissolve.xy); half2 break30 = panner26; half2 appendResult33 = (half2(break30.x , ( break30.y + texCoord24.w ))); half T19 = uvs4_Dissolve.w; half W18 = uvs4_Dissolve.z; half3 _Vector0 = half3(0.5,0,1); half ifLocalVar15 = 0; if( ( tex2D( _Dissolve, appendResult33 ).r * T19 ) >= W18 ) ifLocalVar15 = _Vector0.y; else ifLocalVar15 = _Vector0.z; half4 appendResult2 = (half4(( ( _Emission_Color * i.ase_color ) + ( _Emission * half4( clampResult36 , 0.0 ) * i.ase_color ) ).rgb , ( i.ase_color.a * clampResult7 * ifLocalVar15 ))); finalColor = appendResult2; return finalColor; } ENDCG } } CustomEditor "ASEMaterialInspector" } /*ASEBEGIN Version=18800 818;244;1357;1096;1911.016;410.2205;1;True;False Node;AmplifyShaderEditor.TextureCoordinatesNode;24;-1306.593,589.397;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.Vector4Node;22;-1771.793,36.29691;Inherit;False;Property;_MainTex_uvDissolveSpeed;MainTex_uv/DissolveSpeed;7;0;Create;True;0;0;0;False;0;False;0,0,0,0;0,0,1.2,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.RegisterLocalVarNode;50;-1041.764,628.6923;Inherit;False;Hue;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;25;-1319.193,325.8968;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.SamplerNode;35;-1500.84,-524.1641;Inherit;True;Property;_EmissionTex;EmissionTex;1;0;Create;True;0;0;0;False;0;False;-1;None;e5a2c1e3642ca7d44b2431d3ca90ffaf;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.TextureCoordinatesNode;17;-1354.593,134.4971;Inherit;False;0;10;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.PannerNode;26;-1013.493,361.4971;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0 Node;AmplifyShaderEditor.RGBToHSVNode;46;-1163.84,-504.1642;Inherit;False;1;0;FLOAT3;0,0,0;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 Node;AmplifyShaderEditor.GetLocalVarNode;51;-1140.668,-595.6877;Inherit;False;50;Hue;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.BreakToComponentsNode;30;-802.7396,510.8361;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;47;-925.3396,-517.3647;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.HSVToRGBNode;45;-771.0396,-509.5639;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 Node;AmplifyShaderEditor.RangedFloatNode;49;-762.3945,-339.4625;Inherit;False;Property;_Desaturate;Desaturate;6;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;34;-611.6396,614.236;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;33;-505.3397,494.4361;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.RegisterLocalVarNode;19;-1030.792,259.1971;Inherit;False;T;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.DesaturateOpNode;48;-467.2945,-514.9625;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.Vector4Node;39;-479.6395,-402.6642;Inherit;False;Constant;_Vector1;Vector 1;5;0;Create;True;0;0;0;False;0;False;-0.3,1,-2,1;0,0,0,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SamplerNode;4;-548.4999,-58.7;Inherit;True;Property;_MainTex;MainTex;3;0;Create;True;0;0;0;False;0;False;-1;None;935ddd5c7d5944747bfc567c825c3c93;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.RangedFloatNode;9;-477.5,195.3;Inherit;False;Property;_Opacity;Opacity;4;0;Create;True;0;0;0;False;0;False;20;20;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SamplerNode;10;-270.1389,339.1459;Inherit;True;Property;_Dissolve;Dissolve;5;0;Create;True;0;0;0;False;0;False;-1;None;ae9ab36d05cebde459f8dcc59764e871;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.RegisterLocalVarNode;18;-1038.792,183.1971;Inherit;False;W;-1;True;1;0;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.GetLocalVarNode;21;24.30774,490.3969;Inherit;False;19;T;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.TFHCRemapNode;38;-197.1396,-396.064;Inherit;False;5;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;1,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT3;1,0,0;False;1;FLOAT3;0 Node;AmplifyShaderEditor.RangedFloatNode;41;41.86035,-454.064;Inherit;False;Property;_Emission;Emission;2;0;Create;True;0;0;0;False;0;False;2;3;0;0;0;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;156.561,382.2459;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.GetLocalVarNode;20;12.30774,564.3969;Inherit;False;18;W;1;0;OBJECT;;False;1;FLOAT;0 Node;AmplifyShaderEditor.VertexColorNode;3;-412.5,-223.7;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.ClampOpNode;36;29.86035,-357.064;Inherit;False;3;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;1,1,1;False;1;FLOAT3;0 Node;AmplifyShaderEditor.Vector3Node;14;25.56104,677.2459;Inherit;False;Constant;_Vector0;Vector 0;3;0;Create;True;0;0;0;False;0;False;0.5,0,1;0.3,0,1;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;8;-192.5,111.3;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.ColorNode;44;42.56035,-632.064;Inherit;False;Property;_Emission_Color;Emission_Color;0;1;[HDR];Create;True;0;0;0;False;0;False;1,1,1,0;0,0.03899378,0.2075472,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;40;297.8604,-238.064;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;43;298.8604,-425.064;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.ClampOpNode;7;13.5,112.3;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0 Node;AmplifyShaderEditor.ConditionalIfNode;15;326.561,388.2459;Inherit;False;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.SimpleAddOpNode;42;538.8604,-360.064;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;273.5,52.3;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0 Node;AmplifyShaderEditor.DynamicAppendNode;2;784.5,-242.7;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.DynamicAppendNode;23;-1363.893,9.696869;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.TemplateMultiPassMasterNode;1;1041.813,-239.4747;Half;False;True;-1;2;ASEMaterialInspector;100;1;Cheng/Slash;0770190933193b94aaa3065e307002fa;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;False;False;False;False;False;False;True;0;False;-1;True;2;False;-1;True;True;True;True;True;0;False;-1;False;False;False;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;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;False;0 WireConnection;50;0;24;3 WireConnection;25;0;22;3 WireConnection;25;1;22;4 WireConnection;26;0;17;0 WireConnection;26;2;25;0 WireConnection;46;0;35;0 WireConnection;30;0;26;0 WireConnection;47;0;51;0 WireConnection;47;1;46;1 WireConnection;45;0;47;0 WireConnection;45;1;46;2 WireConnection;45;2;46;3 WireConnection;34;0;30;1 WireConnection;34;1;24;4 WireConnection;33;0;30;0 WireConnection;33;1;34;0 WireConnection;19;0;17;4 WireConnection;48;0;45;0 WireConnection;48;1;49;0 WireConnection;10;1;33;0 WireConnection;18;0;17;3 WireConnection;38;0;48;0 WireConnection;38;1;39;1 WireConnection;38;2;39;2 WireConnection;38;3;39;3 WireConnection;38;4;39;4 WireConnection;11;0;10;1 WireConnection;11;1;21;0 WireConnection;36;0;38;0 WireConnection;8;0;4;4 WireConnection;8;1;9;0 WireConnection;40;0;41;0 WireConnection;40;1;36;0 WireConnection;40;2;3;0 WireConnection;43;0;44;0 WireConnection;43;1;3;0 WireConnection;7;0;8;0 WireConnection;15;0;11;0 WireConnection;15;1;20;0 WireConnection;15;2;14;2 WireConnection;15;3;14;2 WireConnection;15;4;14;3 WireConnection;42;0;43;0 WireConnection;42;1;40;0 WireConnection;5;0;3;4 WireConnection;5;1;7;0 WireConnection;5;2;15;0 WireConnection;2;0;42;0 WireConnection;2;3;5;0 WireConnection;23;0;22;1 WireConnection;23;1;22;2 WireConnection;1;0;2;0 ASEEND*/ //CHKSM=918BA9DB91C3214A914F562973E995CD1D3F20E5