210 lines
9.9 KiB
Plaintext
210 lines
9.9 KiB
Plaintext
|
// Made with Amplify Shader Editor
|
||
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
||
|
Shader "QFX/ProjectilesFX/Particles Cutout"
|
||
|
{
|
||
|
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
|
||
|
[Enum(UnityEngine.Rendering.BlendMode)]_SrcBlend("SrcBlend", Int) = 5
|
||
|
[Enum(UnityEngine.Rendering.BlendMode)]_DstBlend("DstBlend", Int) = 10
|
||
|
_EmissiveMultiply("Emissive Multiply", Float) = 1
|
||
|
_NoiseTexture("Noise Texture", 2D) = "white" {}
|
||
|
_Cutout("Cutout", Float) = 0
|
||
|
[HideInInspector] _texcoord( "", 2D ) = "white" {}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
Category
|
||
|
{
|
||
|
SubShader
|
||
|
{
|
||
|
LOD 0
|
||
|
|
||
|
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
||
|
Blend [_SrcBlend] [_DstBlend]
|
||
|
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
|
||
|
#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
|
||
|
|
||
|
};
|
||
|
|
||
|
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
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
#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 int _DstBlend;
|
||
|
uniform int _SrcBlend;
|
||
|
uniform float _EmissiveMultiply;
|
||
|
uniform sampler2D _NoiseTexture;
|
||
|
SamplerState sampler_NoiseTexture;
|
||
|
uniform float4 _NoiseTexture_ST;
|
||
|
uniform float _Cutout;
|
||
|
|
||
|
|
||
|
v2f vert ( appdata_t v )
|
||
|
{
|
||
|
v2f o;
|
||
|
UNITY_SETUP_INSTANCE_ID(v);
|
||
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
||
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
||
|
|
||
|
|
||
|
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_MainTex = i.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
|
||
|
float4 tex2DNode1 = tex2D( _MainTex, uv_MainTex );
|
||
|
float4 temp_output_6_0 = ( _TintColor * tex2DNode1 * i.color * unity_ColorSpaceDouble );
|
||
|
float temp_output_9_0 = (temp_output_6_0).a;
|
||
|
float4 appendResult11 = (float4(( _EmissiveMultiply * (temp_output_6_0).rgb ) , temp_output_9_0));
|
||
|
float4 texCoord42 = i.texcoord;
|
||
|
texCoord42.xy = i.texcoord.xy * float2( 1,1 ) + float2( 0,0 );
|
||
|
float2 uv_NoiseTexture = i.texcoord.xy * _NoiseTexture_ST.xy + _NoiseTexture_ST.zw;
|
||
|
float3 texCoord28 = i.texcoord.xyz;
|
||
|
texCoord28.xy = i.texcoord.xyz.xy * float2( 1,1 ) + float2( 0,0 );
|
||
|
clip( ( tex2DNode1.a * tex2D( _NoiseTexture, ( texCoord42.w + uv_NoiseTexture ) ).r ) - ( texCoord28.z + _Cutout ));
|
||
|
|
||
|
|
||
|
fixed4 col = appendResult11;
|
||
|
UNITY_APPLY_FOG(i.fogCoord, col);
|
||
|
return col;
|
||
|
}
|
||
|
ENDCG
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
CustomEditor "ASEMaterialInspector"
|
||
|
|
||
|
|
||
|
}
|
||
|
/*ASEBEGIN
|
||
|
Version=18500
|
||
|
25.6;263.2;952;548;831.5482;252.2748;1.213416;True;False
|
||
|
Node;AmplifyShaderEditor.TemplateShaderPropertyNode;2;-795.2956,-94.87796;Inherit;False;0;0;_MainTex;Shader;0;5;SAMPLER2D;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
||
|
Node;AmplifyShaderEditor.VertexColorNode;5;-468.5959,96.65337;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
||
|
Node;AmplifyShaderEditor.CommentaryNode;43;-963.6647,218.8434;Inherit;False;458.6438;388.6699;Random UV;3;40;41;42;;0.7886953,1,0,1;0;0
|
||
|
Node;AmplifyShaderEditor.ColorSpaceDouble;44;-297.3224,189.5573;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
||
|
Node;AmplifyShaderEditor.SamplerNode;1;-589.9226,-96.67332;Inherit;True;Property;_TextureSample0;Texture Sample 0;0;0;Create;True;0;0;False;0;False;-1;None;None;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.TemplateShaderPropertyNode;4;-461.2593,-272.6733;Inherit;False;0;0;_TintColor;Shader;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
||
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;6;-238.5061,-115.3267;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;COLOR;0,0,0,0;False;1;COLOR;0
|
||
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;40;-911.2475,445.3133;Inherit;False;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.TextureCoordinatesNode;42;-913.6647,268.8434;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.SimpleAddOpNode;41;-657.4208,396.9654;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
|
||
|
Node;AmplifyShaderEditor.ComponentMaskNode;8;-39.62205,-150.9127;Inherit;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
|
||
|
Node;AmplifyShaderEditor.CommentaryNode;39;-178.7477,631.3087;Inherit;False;292.4;230.6;;1;28;;0.7981051,1,0,1;0;0
|
||
|
Node;AmplifyShaderEditor.RangedFloatNode;12;-48.36968,-281.2912;Inherit;False;Property;_EmissiveMultiply;Emissive Multiply;2;0;Create;True;0;0;False;0;False;1;8;0;0;0;1;FLOAT;0
|
||
|
Node;AmplifyShaderEditor.SamplerNode;22;-352.8778,368.2792;Inherit;True;Property;_NoiseTexture;Noise Texture;3;0;Create;True;0;0;False;0;False;-1;None;afa3368a38ac97d4a869582b151eb95d;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;37;-22.85884,903.8126;Inherit;False;Property;_Cutout;Cutout;4;0;Create;True;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
|
||
|
Node;AmplifyShaderEditor.ComponentMaskNode;9;-44.94417,-61.35075;Inherit;False;False;False;False;True;1;0;COLOR;0,0,0,0;False;1;FLOAT;0
|
||
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;7;185.4125,-201.0506;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0
|
||
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;28;-128.7477,686.0378;Inherit;False;0;-1;3;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
||
|
Node;AmplifyShaderEditor.DynamicAppendNode;11;358.016,-155.2244;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.CommentaryNode;32;-802.1362,-421.0815;Inherit;False;222.385;257.1656;Custom Blending;2;34;33;;1,0,0,1;0;0
|
||
|
Node;AmplifyShaderEditor.SimpleAddOpNode;36;194.6615,797.1216;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
||
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;30;211.0832,16.46783;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
||
|
Node;AmplifyShaderEditor.IntNode;33;-752.1362,-279.3159;Inherit;False;Property;_DstBlend;DstBlend;1;1;[Enum];Create;True;0;1;UnityEngine.Rendering.BlendMode;True;0;False;10;1;0;1;INT;0
|
||
|
Node;AmplifyShaderEditor.IntNode;34;-750.5512,-369.0815;Inherit;False;Property;_SrcBlend;SrcBlend;0;1;[Enum];Create;True;0;1;UnityEngine.Rendering.BlendMode;True;0;False;5;5;0;1;INT;0
|
||
|
Node;AmplifyShaderEditor.ClipNode;25;693.6459,10.03131;Inherit;False;3;0;FLOAT4;0,0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT4;0
|
||
|
Node;AmplifyShaderEditor.SaturateNode;29;190.9022,-57.78777;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
|
||
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;35;909.4606,8.845862;Float;False;True;-1;2;ASEMaterialInspector;0;7;QFX/ProjectilesFX/Particles Cutout;0b6a9f8b4f707c74ca64c0be8e590de0;True;SubShader 0 Pass 0;0;0;SubShader 0 Pass 0;2;True;2;0;True;34;0;True;33;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;True;2;False;-1;True;True;True;True;False;0;False;-1;False;False;False;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;False;False;False;False;False;False;False;False;False;True;0;0;;0;0;Standard;0;0;1;True;False;;False;0
|
||
|
WireConnection;1;0;2;0
|
||
|
WireConnection;6;0;4;0
|
||
|
WireConnection;6;1;1;0
|
||
|
WireConnection;6;2;5;0
|
||
|
WireConnection;6;3;44;0
|
||
|
WireConnection;41;0;42;4
|
||
|
WireConnection;41;1;40;0
|
||
|
WireConnection;8;0;6;0
|
||
|
WireConnection;22;1;41;0
|
||
|
WireConnection;9;0;6;0
|
||
|
WireConnection;7;0;12;0
|
||
|
WireConnection;7;1;8;0
|
||
|
WireConnection;11;0;7;0
|
||
|
WireConnection;11;3;9;0
|
||
|
WireConnection;36;0;28;3
|
||
|
WireConnection;36;1;37;0
|
||
|
WireConnection;30;0;1;4
|
||
|
WireConnection;30;1;22;1
|
||
|
WireConnection;25;0;11;0
|
||
|
WireConnection;25;1;30;0
|
||
|
WireConnection;25;2;36;0
|
||
|
WireConnection;29;0;9;0
|
||
|
WireConnection;35;0;25;0
|
||
|
ASEEND*/
|
||
|
//CHKSM=FDBF2499647DAAE4B9A07AD7EBFAF4630A157E34
|