246 lines
12 KiB
Plaintext
246 lines
12 KiB
Plaintext
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "Cheng/Slash"
|
|
{
|
|
Properties
|
|
{
|
|
_TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
|
|
_MainTex ("Particle Texture", 2D) = "white" {}
|
|
_InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0
|
|
_Main("Main", 2D) = "white" {}
|
|
_Opacity("Opacity", Float) = 20
|
|
_Dissolve("Dissolve", 2D) = "white" {}
|
|
_SpeedMainTexUVNoise("SpeedMainTexUV+Noise", Vector) = (0,0,0,0)
|
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
|
|
|
}
|
|
|
|
|
|
Category
|
|
{
|
|
SubShader
|
|
{
|
|
LOD 0
|
|
|
|
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
|
Blend SrcAlpha OneMinusSrcAlpha
|
|
ColorMask RGB
|
|
Cull Off
|
|
Lighting Off
|
|
ZWrite Off
|
|
ZTest LEqual
|
|
|
|
Pass {
|
|
|
|
CGPROGRAM
|
|
|
|
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
|
|
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
|
|
#endif
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
#pragma target 2.0
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile_particles
|
|
#pragma multi_compile_fog
|
|
#include "UnityShaderVariables.cginc"
|
|
#define ASE_NEEDS_FRAG_COLOR
|
|
|
|
|
|
#include "UnityCG.cginc"
|
|
|
|
struct appdata_t
|
|
{
|
|
float4 vertex : POSITION;
|
|
fixed4 color : COLOR;
|
|
float4 texcoord : TEXCOORD0;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
float4 ase_texcoord1 : TEXCOORD1;
|
|
};
|
|
|
|
struct v2f
|
|
{
|
|
float4 vertex : SV_POSITION;
|
|
fixed4 color : COLOR;
|
|
float4 texcoord : TEXCOORD0;
|
|
UNITY_FOG_COORDS(1)
|
|
#ifdef SOFTPARTICLES_ON
|
|
float4 projPos : TEXCOORD2;
|
|
#endif
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
};
|
|
|
|
|
|
#if UNITY_VERSION >= 560
|
|
UNITY_DECLARE_DEPTH_TEXTURE( _CameraDepthTexture );
|
|
#else
|
|
uniform sampler2D_float _CameraDepthTexture;
|
|
#endif
|
|
|
|
//Don't delete this comment
|
|
// uniform sampler2D_float _CameraDepthTexture;
|
|
|
|
uniform sampler2D _MainTex;
|
|
uniform fixed4 _TintColor;
|
|
uniform float4 _MainTex_ST;
|
|
uniform float _InvFade;
|
|
uniform sampler2D _Main;
|
|
uniform half4 _Main_ST;
|
|
uniform half _Opacity;
|
|
uniform sampler2D _Dissolve;
|
|
uniform float4 _SpeedMainTexUVNoise;
|
|
|
|
|
|
v2f vert ( appdata_t v )
|
|
{
|
|
v2f o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.ase_texcoord3 = v.ase_texcoord1;
|
|
|
|
v.vertex.xyz += float3( 0, 0, 0 ) ;
|
|
o.vertex = UnityObjectToClipPos(v.vertex);
|
|
#ifdef SOFTPARTICLES_ON
|
|
o.projPos = ComputeScreenPos (o.vertex);
|
|
COMPUTE_EYEDEPTH(o.projPos.z);
|
|
#endif
|
|
o.color = v.color;
|
|
o.texcoord = v.texcoord;
|
|
UNITY_TRANSFER_FOG(o,o.vertex);
|
|
return o;
|
|
}
|
|
|
|
fixed4 frag ( v2f i ) : SV_Target
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID( i );
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( i );
|
|
|
|
#ifdef SOFTPARTICLES_ON
|
|
float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
|
|
float partZ = i.projPos.z;
|
|
float fade = saturate (_InvFade * (sceneZ-partZ));
|
|
i.color.a *= fade;
|
|
#endif
|
|
|
|
float2 uv_Main = i.texcoord.xy * _Main_ST.xy + _Main_ST.zw;
|
|
half clampResult7 = clamp( ( tex2D( _Main, uv_Main ).a * _Opacity ) , 0.0 , 1.0 );
|
|
half2 appendResult25 = (half2(_SpeedMainTexUVNoise.z , _SpeedMainTexUVNoise.w));
|
|
half4 uv017 = i.texcoord;
|
|
uv017.xy = i.texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
|
half2 panner26 = ( 1.0 * _Time.y * appendResult25 + uv017.xy);
|
|
half2 break28 = panner26;
|
|
half4 uv131 = i.ase_texcoord3;
|
|
uv131.xy = i.ase_texcoord3.xy * float2( 1,1 ) + float2( 0,0 );
|
|
half2 appendResult30 = (half2(break28.x , ( uv131.w + break28.y )));
|
|
half T19 = uv017.w;
|
|
half W18 = uv017.z;
|
|
half3 _Vector0 = half3(0.3,0,1);
|
|
half ifLocalVar13 = 0;
|
|
if( ( tex2D( _Dissolve, appendResult30 ).r * T19 ) >= W18 )
|
|
ifLocalVar13 = _Vector0.y;
|
|
else
|
|
ifLocalVar13 = _Vector0.z;
|
|
half4 appendResult1 = (half4(0.0 , 0.0 , 0.0 , ( i.color.a * clampResult7 * ifLocalVar13 )));
|
|
|
|
|
|
fixed4 col = appendResult1;
|
|
UNITY_APPLY_FOG(i.fogCoord, col);
|
|
return col;
|
|
}
|
|
ENDCG
|
|
}
|
|
}
|
|
}
|
|
CustomEditor "ASEMaterialInspector"
|
|
|
|
|
|
}
|
|
/*ASEBEGIN
|
|
Version=18100
|
|
797;27;1641;1175;1282.377;840.9699;1.157213;True;False
|
|
Node;AmplifyShaderEditor.Vector4Node;22;-3092.101,126.9561;Float;False;Property;_SpeedMainTexUVNoise;SpeedMainTexUV+Noise;4;0;Create;True;0;0;False;0;False;0,0,0,0;0,0,2,0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;17;-2744.968,184.9044;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.DynamicAppendNode;25;-2737.101,424.9561;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.PannerNode;26;-2408.501,420.2561;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;31;-2202.444,5.085205;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.BreakToComponentsNode;28;-2185.444,423.0852;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;29;-1861.444,472.0852;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.CommentaryNode;16;-1561.909,279.4519;Inherit;False;1113;482.0001;Dissolve;6;13;15;10;9;20;21;;1,1,1,1;0;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;30;-1693.444,422.0852;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;-2419.968,321.9044;Inherit;False;T;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;20;-1360.943,531.4825;Inherit;False;19;T;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;9;-1395.909,329.452;Inherit;True;Property;_Dissolve;Dissolve;3;0;Create;True;0;0;False;0;False;-1;None;a2147d520fd0a09449bbba92a2f34c6c;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.SamplerNode;4;-1262.416,-154.9703;Inherit;True;Property;_Main;Main;1;0;Create;True;0;0;False;0;False;-1;None;b498f458b51c8c34e814dca938be75a6;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;8;-1151.416,93.02969;Inherit;False;Property;_Opacity;Opacity;2;0;Create;True;0;0;False;0;False;20;4.21;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RegisterLocalVarNode;18;-2435.968,243.9044;Inherit;False;W;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.GetLocalVarNode;21;-1051.943,483.4826;Inherit;False;18;W;1;0;OBJECT;;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-926.4155,70.02969;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.Vector3Node;15;-1040.909,573.452;Inherit;False;Constant;_Vector0;Vector 0;3;0;Create;True;0;0;False;0;False;0.3,0,1;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;-1030.909,351.452;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ClampOpNode;7;-735.4155,51.02969;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.VertexColorNode;2;-648.4155,-178.9703;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ConditionalIfNode;13;-727.9095,414.4521;Inherit;True;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.SimpleMultiplyOpNode;3;-390.4155,-14.97034;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.TFHCRemapNode;33;-888.772,-467.6688;Inherit;False;5;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;1,0,0,0;False;3;COLOR;0,0,0,0;False;4;COLOR;1,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;1;153.5844,-298.9703;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.PannerNode;27;-2489.101,41.95608;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;38;-48.12964,-339.5244;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;36;-307.3087,-315.1594;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ClampOpNode;35;-619.7721,-461.6688;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,1;False;2;COLOR;1,1,1,1;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;37;-641.1626,-307.0253;Inherit;False;Property;_Emission;Emission;5;0;Create;True;0;0;False;0;False;2;4;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;39;-631.1296,-681.5244;Inherit;False;Property;_Color;Color;6;0;Create;True;0;0;False;0;False;0,0,0,0;0,0,0,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;24;-2726.101,50.95608;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.Vector4Node;34;-1177.772,-456.6688;Inherit;False;Constant;_Vector1;Vector 1;5;0;Create;True;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;32;-1244.772,-701.6689;Inherit;True;Property;_EmissMainTex;EmissMainTex;0;0;Create;True;0;0;False;0;False;-1;None;fecd62a41658f604584ed6bca93122a5;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.SimpleMultiplyOpNode;40;-299.1296,-496.5244;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;415,-298;Half;False;True;-1;2;ASEMaterialInspector;0;7;Cheng/Slash;0b6a9f8b4f707c74ca64c0be8e590de0;True;SubShader 0 Pass 0;0;0;SubShader 0 Pass 0;2;True;2;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;False;False;True;2;False;-1;True;True;True;True;False;0;False;-1;False;True;2;False;-1;True;3;False;-1;False;True;4;Queue=Transparent=Queue=0;IgnoreProjector=True;RenderType=Transparent=RenderType;PreviewType=Plane;False;0;False;False;False;False;False;False;False;False;False;False;True;0;0;;0;0;Standard;0;0;1;True;False;;0
|
|
WireConnection;25;0;22;3
|
|
WireConnection;25;1;22;4
|
|
WireConnection;26;0;17;0
|
|
WireConnection;26;2;25;0
|
|
WireConnection;28;0;26;0
|
|
WireConnection;29;0;31;4
|
|
WireConnection;29;1;28;1
|
|
WireConnection;30;0;28;0
|
|
WireConnection;30;1;29;0
|
|
WireConnection;19;0;17;4
|
|
WireConnection;9;1;30;0
|
|
WireConnection;18;0;17;3
|
|
WireConnection;5;0;4;4
|
|
WireConnection;5;1;8;0
|
|
WireConnection;10;0;9;1
|
|
WireConnection;10;1;20;0
|
|
WireConnection;7;0;5;0
|
|
WireConnection;13;0;10;0
|
|
WireConnection;13;1;21;0
|
|
WireConnection;13;2;15;2
|
|
WireConnection;13;3;15;2
|
|
WireConnection;13;4;15;3
|
|
WireConnection;3;0;2;4
|
|
WireConnection;3;1;7;0
|
|
WireConnection;3;2;13;0
|
|
WireConnection;33;0;32;0
|
|
WireConnection;33;1;34;1
|
|
WireConnection;33;2;34;2
|
|
WireConnection;33;3;34;3
|
|
WireConnection;33;4;34;4
|
|
WireConnection;1;3;3;0
|
|
WireConnection;27;0;24;0
|
|
WireConnection;38;0;40;0
|
|
WireConnection;38;1;36;0
|
|
WireConnection;36;0;35;0
|
|
WireConnection;36;1;37;0
|
|
WireConnection;36;2;2;0
|
|
WireConnection;35;0;33;0
|
|
WireConnection;24;0;22;1
|
|
WireConnection;24;1;22;2
|
|
WireConnection;40;0;39;0
|
|
WireConnection;40;1;39;4
|
|
WireConnection;40;2;2;0
|
|
WireConnection;0;0;1;0
|
|
ASEEND*/
|
|
//CHKSM=4377D0D6926FCF0E010E4214F793F33530233D09 |