Files
Cielonos/Assets/External VFXs/MasterStylizedFX/Shaders/CommonParticles.shader
SoulliesOfficial d15957c719 更新
2025-12-17 04:19:38 -05:00

196 lines
11 KiB
Plaintext

// Made with Amplify Shader Editor v1.9.3.2
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "CommonParticles"
{
Properties
{
[Header(Mask)][NoScaleOffset]_NoiseMask("NoiseMask", 2D) = "white" {}
[Toggle]_Mask("Mask", Float) = 0
_MaskScroll("MaskScroll", Vector) = (0,0,0,0)
_MaskTiling("MaskTiling", Vector) = (0,0,0,0)
_MaskOffset("MaskOffset", Vector) = (0,0,0,0)
_Feather("Feather", Float) = 0
_Texture("Texture", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] _texcoord2( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "IsEmissive" = "true" }
Cull Back
CGINCLUDE
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
#undef TRANSFORM_TEX
#define TRANSFORM_TEX(tex,name) float4(tex.xy * name##_ST.xy + name##_ST.zw, tex.z, tex.w)
struct Input
{
float4 uv_texcoord;
float4 uv2_texcoord2;
};
uniform sampler2D _Texture;
uniform float4 _Texture_ST;
uniform float _Mask;
uniform float _Feather;
uniform sampler2D _NoiseMask;
uniform float2 _MaskTiling;
uniform float2 _MaskOffset;
uniform float2 _MaskScroll;
void surf( Input i , inout SurfaceOutputStandard o )
{
float2 uv_Texture = i.uv_texcoord * _Texture_ST.xy + _Texture_ST.zw;
float4 tex2DNode24 = tex2D( _Texture, uv_Texture );
o.Emission = ( i.uv_texcoord.z * tex2DNode24 ).rgb;
float lerpResult22 = lerp( ( 0.0 - _Feather ) , ( 1.0 + _Feather ) , i.uv2_texcoord2.z);
float2 uvs_TexCoord9 = i.uv_texcoord;
uvs_TexCoord9.xy = i.uv_texcoord.xy * _MaskTiling + ( _MaskOffset + ( i.uv2_texcoord2.w * _MaskScroll ) );
float smoothstepResult15 = smoothstep( ( lerpResult22 - _Feather ) , ( lerpResult22 + _Feather ) , tex2D( _NoiseMask, uvs_TexCoord9.xy ).r);
o.Alpha = ( tex2DNode24.a * (( _Mask )?( smoothstepResult15 ):( 1.0 )) );
}
ENDCG
CGPROGRAM
#pragma surface surf Standard alpha:fade keepalpha fullforwardshadows
ENDCG
Pass
{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile_shadowcaster
#pragma multi_compile UNITY_PASS_SHADOWCASTER
#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
#include "HLSLSupport.cginc"
#if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )
#define CAN_SKIP_VPOS
#endif
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityPBSLighting.cginc"
sampler3D _DitherMaskLOD;
struct v2f
{
V2F_SHADOW_CASTER;
float4 customPack1 : TEXCOORD1;
float4 customPack2 : TEXCOORD2;
float3 worldPos : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert( appdata_full v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID( v );
UNITY_INITIALIZE_OUTPUT( v2f, o );
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
UNITY_TRANSFER_INSTANCE_ID( v, o );
Input customInputData;
float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
half3 worldNormal = UnityObjectToWorldNormal( v.normal );
o.customPack1.xyzw = customInputData.uv_texcoord;
o.customPack1.xyzw = v.texcoord;
o.customPack2.xyzw = customInputData.uv2_texcoord2;
o.customPack2.xyzw = v.texcoord1;
o.worldPos = worldPos;
TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
return o;
}
half4 frag( v2f IN
#if !defined( CAN_SKIP_VPOS )
, UNITY_VPOS_TYPE vpos : VPOS
#endif
) : SV_Target
{
UNITY_SETUP_INSTANCE_ID( IN );
Input surfIN;
UNITY_INITIALIZE_OUTPUT( Input, surfIN );
surfIN.uv_texcoord = IN.customPack1.xyzw;
surfIN.uv2_texcoord2 = IN.customPack2.xyzw;
float3 worldPos = IN.worldPos;
half3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
SurfaceOutputStandard o;
UNITY_INITIALIZE_OUTPUT( SurfaceOutputStandard, o )
surf( surfIN, o );
#if defined( CAN_SKIP_VPOS )
float2 vpos = IN.pos;
#endif
half alphaRef = tex3D( _DitherMaskLOD, float3( vpos.xy * 0.25, o.Alpha * 0.9375 ) ).a;
clip( alphaRef - 0.01 );
SHADOW_CASTER_FRAGMENT( IN )
}
ENDCG
}
}
Fallback "Diffuse"
// CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=19302
Node;AmplifyShaderEditor.CommentaryNode;1;-1464.653,-168.4019;Inherit;False;781.2883;525.4138;NoiseScroll;7;9;8;7;6;5;3;2;;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;4;-606.8665,-333.3983;Inherit;False;1444.062;1209.11;Mask;13;22;21;20;19;18;17;16;15;14;13;12;11;10;;1,1,1,1;0;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;2;-1383.909,-118.4019;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.Vector2Node;3;-1395.015,141.3403;Inherit;False;Property;_MaskScroll;MaskScroll;2;0;Create;True;0;0;0;False;0;False;0,0;0,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-1117.399,68.45407;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.Vector2Node;6;-1122.573,224.5393;Inherit;False;Property;_MaskOffset;MaskOffset;4;0;Create;True;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.RangedFloatNode;10;-559.8284,447.4663;Inherit;False;Property;_Feather;Feather;5;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;11;-402.0055,305.9733;Inherit;False;Constant;_Float3;Float 3;19;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;19;-392.3676,509.7163;Inherit;False;Constant;_Float5;Float 5;19;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;7;-1159.304,-120.5052;Inherit;False;Property;_MaskTiling;MaskTiling;3;0;Create;True;0;0;0;False;0;False;0,0;1,1;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.SimpleAddOpNode;8;-862.9904,153.2873;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;12;-237.2804,293.5072;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;17;-506.1495,638.1283;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.SimpleAddOpNode;18;-203.8276,450.2543;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;9;-925.3634,-58.53154;Inherit;False;0;-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.LerpOp;22;-57.63451,413.2653;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;13;-163.3776,-42.52665;Inherit;True;Property;_NoiseMask;NoiseMask;0;2;[Header];[NoScaleOffset];Create;True;1;Mask;0;0;False;0;False;-1;None;3584f2bf4afb5284d91edb6a29126e62;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.SimpleAddOpNode;20;207.7939,575.0122;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleSubtractOpNode;21;283.3987,209.4743;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;14;57.29952,-222.5208;Inherit;False;Constant;_Float2;Float 2;12;0;Create;True;0;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SmoothstepOpNode;15;502.9647,118.0304;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.ToggleSwitchNode;16;582.4955,-79.98154;Inherit;False;Property;_Mask;Mask;1;0;Create;True;0;0;0;False;0;False;0;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;25;568.7701,-984.5917;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.SamplerNode;24;490.4344,-662.8572;Inherit;True;Property;_Texture;Texture;6;0;Create;True;0;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.SimpleMultiplyOpNode;26;900.1118,-728.3978;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;27;979.9935,-308.2624;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;1307.748,-619.867;Float;False;True;-1;2;ASEMaterialInspector;0;0;Standard;CommonParticles;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;False;False;False;Back;0;False;;0;False;;False;0;False;;0;False;;False;0;Transparent;0.5;True;True;0;False;Transparent;;Transparent;All;12;all;True;True;True;True;0;False;;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;2;15;10;25;False;0.5;True;2;5;False;;10;False;;0;0;False;;0;False;;0;False;;0;False;;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;True;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;;-1;0;False;;0;0;0;False;0.1;False;;0;False;;False;17;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;16;FLOAT4;0,0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;5;0;2;4
WireConnection;5;1;3;0
WireConnection;8;0;6;0
WireConnection;8;1;5;0
WireConnection;12;0;11;0
WireConnection;12;1;10;0
WireConnection;18;0;19;0
WireConnection;18;1;10;0
WireConnection;9;0;7;0
WireConnection;9;1;8;0
WireConnection;22;0;12;0
WireConnection;22;1;18;0
WireConnection;22;2;17;3
WireConnection;13;1;9;0
WireConnection;20;0;22;0
WireConnection;20;1;10;0
WireConnection;21;0;22;0
WireConnection;21;1;10;0
WireConnection;15;0;13;1
WireConnection;15;1;21;0
WireConnection;15;2;20;0
WireConnection;16;0;14;0
WireConnection;16;1;15;0
WireConnection;26;0;25;3
WireConnection;26;1;24;0
WireConnection;27;0;24;4
WireConnection;27;1;16;0
WireConnection;0;2;26;0
WireConnection;0;9;27;0
ASEEND*/
//CHKSM=36C45C01D7DC9F8AEC7178E81F250BA8438A0795