shaoxiadiablo/Assets/Arts/VFX/Shader/NoiseUV_alpha.shader
2025-05-18 01:04:31 +08:00

202 lines
9.4 KiB
Plaintext

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "WFX/Noise_alpha"
{
Properties
{
_Texture("Texture", 2D) = "white" {}
_Texture_U("Texture_U", Float) = 0
_Texture_V("Texture_V", Float) = 0
[HDR]_Texture_Color("Texture_Color ", Color) = (1,1,1,0)
_Noise("Noise", 2D) = "white" {}
_Noise_U("Noise_U", Float) = 0
_Noise_V("Noise_V", Float) = 0
_Mask("Mask", 2D) = "white" {}
_Float0("Float 0", Range( 0 , 10)) = 0.9411765
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" "Queue"="Transparent" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend SrcAlpha OneMinusSrcAlpha
Cull Back
ColorMask RGBA
ZWrite On
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"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 ase_texcoord : TEXCOORD0;
};
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 sampler2D _Texture;
uniform sampler2D _Noise;
uniform half4 _Noise_ST;
uniform float _Noise_U;
uniform float _Noise_V;
uniform half _Float0;
uniform half4 _Texture_ST;
uniform float _Texture_U;
uniform float _Texture_V;
uniform float4 _Texture_Color;
uniform sampler2D _Mask;
uniform half4 _Mask_ST;
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;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.zw = 0;
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
half2 uv0_Noise = i.ase_texcoord1.xy * _Noise_ST.xy + _Noise_ST.zw;
half2 appendResult13 = (half2(( _Noise_U * _Time.y ) , ( _Time.y * _Noise_V )));
half2 uv0_Texture = i.ase_texcoord1.xy * _Texture_ST.xy + _Texture_ST.zw;
half2 appendResult34 = (half2(( _Texture_U * _Time.y ) , ( _Time.y * _Texture_V )));
float2 uv_Mask = i.ase_texcoord1.xy * _Mask_ST.xy + _Mask_ST.zw;
finalColor = ( ( tex2D( _Texture, ( ( tex2D( _Noise, ( uv0_Noise + appendResult13 ) ).r * _Float0 ) + ( uv0_Texture + appendResult34 ) ) ) * _Texture_Color * i.ase_color * i.ase_color.a ) * tex2D( _Mask, uv_Mask ) );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=17400
2560;0;2560;1379;1022.926;402.2185;1.016058;True;True
Node;AmplifyShaderEditor.TimeNode;2;-1871.746,-283.8145;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;3;-1839.746,-459.8145;Float;False;Property;_Noise_U;Noise_U;5;0;Create;True;0;0;False;0;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;4;-1855.746,-91.81445;Float;False;Property;_Noise_V;Noise_V;6;0;Create;True;0;0;False;0;0;0.1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;6;-1503.746,-411.8145;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-1503.746,-219.8145;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TimeNode;30;-1252.309,107.9777;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.DynamicAppendNode;13;-1250.746,-340.8145;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.RangedFloatNode;29;-1236.309,299.9777;Float;False;Property;_Texture_V;Texture_V;2;0;Create;True;0;0;False;0;0;0.2;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;31;-1219.287,-69.04478;Float;False;Property;_Texture_U;Texture_U;1;0;Create;True;0;0;False;0;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;14;-1263.803,-493.6884;Inherit;False;0;8;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.SimpleMultiplyOpNode;33;-884.3092,171.9777;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;32;-884.3092,-20.02232;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;15;-972.7461,-425.8145;Inherit;True;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;36;-660.3662,-95.89625;Inherit;False;0;28;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.RangedFloatNode;23;-659.5132,-225.442;Inherit;False;Property;_Float0;Float 0;8;0;Create;True;0;0;False;0;0.9411765;0.15;0;10;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;8;-689.2726,-458.7408;Inherit;True;Property;_Noise;Noise;4;0;Create;True;0;0;False;0;-1;None;7ddf5f24ba5128c408e9cd12d6325f48;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.DynamicAppendNode;34;-612.3092,123.9777;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.SimpleMultiplyOpNode;22;-268.593,-369.5502;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;35;-356.3092,43.97769;Inherit;True;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleAddOpNode;24;-39.79933,-127.0603;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SamplerNode;28;147.8968,-161.4271;Inherit;True;Property;_Texture;Texture;0;0;Create;True;0;0;False;0;-1;None;096a9e421d10ed641800f2e52a444417;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;7;120.2499,395.0443;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.ColorNode;9;93.24988,161.0443;Float;False;Property;_Texture_Color;Texture_Color ;3;1;[HDR];Create;True;0;0;False;0;1,1,1,0;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;10;568.65,62.84438;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.SamplerNode;11;423.5903,376.7275;Inherit;True;Property;_Mask;Mask;7;0;Create;True;0;0;False;0;-1;None;4c8941f6762c89849b69803bae871f1b;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;12;798.5904,192.7275;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;1081.595,173.5573;Half;False;True;-1;2;ASEMaterialInspector;100;12;WFX/Noise_alpha;7dd85faf9393a6b4981c828023c99d39;True;Unlit;0;0;Unlit;2;True;2;5;False;-1;10;False;-1;0;5;False;-1;10;False;-1;True;0;False;-1;0;False;-1;True;False;True;0;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;1;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;6;0;3;0
WireConnection;6;1;2;2
WireConnection;5;0;2;2
WireConnection;5;1;4;0
WireConnection;13;0;6;0
WireConnection;13;1;5;0
WireConnection;33;0;30;2
WireConnection;33;1;29;0
WireConnection;32;0;31;0
WireConnection;32;1;30;2
WireConnection;15;0;14;0
WireConnection;15;1;13;0
WireConnection;8;1;15;0
WireConnection;34;0;32;0
WireConnection;34;1;33;0
WireConnection;22;0;8;1
WireConnection;22;1;23;0
WireConnection;35;0;36;0
WireConnection;35;1;34;0
WireConnection;24;0;22;0
WireConnection;24;1;35;0
WireConnection;28;1;24;0
WireConnection;10;0;28;0
WireConnection;10;1;9;0
WireConnection;10;2;7;0
WireConnection;10;3;7;4
WireConnection;12;0;10;0
WireConnection;12;1;11;0
WireConnection;1;0;12;0
ASEEND*/
//CHKSM=6A94A37F48693669682053B25476B9E8A02D9F39