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

169 lines
6.8 KiB
Plaintext

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Cheng/Noise_Maskalpha"
{
Properties
{
_Texture2("Texture2", 2D) = "white" {}
_Texture_U("Texture_U", Float) = 0
_Texture_V("Texture_V", Float) = 0
_Texture_Color("Texture_Color ", Color) = (1,1,1,0)
_Mask("Mask", 2D) = "white" {}
_Float0("Float 0", Float) = 0
[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 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"
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;
};
uniform sampler2D _Texture2;
uniform half4 _Texture2_ST;
uniform float _Texture_U;
uniform float _Texture_V;
uniform float4 _Texture_Color;
uniform half _Float0;
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;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.zw = 0;
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
half2 uv0_Texture2 = i.ase_texcoord1.xy * _Texture2_ST.xy + _Texture2_ST.zw;
half2 appendResult94 = (half2(( _Texture_U * _Time.y ) , ( _Time.y * _Texture_V )));
float2 uv_Mask = i.ase_texcoord1.xy * _Mask_ST.xy + _Mask_ST.zw;
finalColor = ( tex2D( _Texture2, ( uv0_Texture2 + appendResult94 ) ) * _Texture_Color * _Float0 * tex2D( _Mask, uv_Mask ).a );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18100
364;33;1838;1298;1579.917;-899.8751;1;True;False
Node;AmplifyShaderEditor.RangedFloatNode;87;-1927.401,1464.877;Float;False;Property;_Texture_V;Texture_V;2;0;Create;True;0;0;False;0;False;0;0.4;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;98;-1910.379,1095.855;Float;False;Property;_Texture_U;Texture_U;1;0;Create;True;0;0;False;0;False;0;0.02;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TimeNode;99;-1943.401,1272.877;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;96;-1575.401,1336.877;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;97;-1575.401,1144.877;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.DynamicAppendNode;94;-1303.401,1288.877;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.TextureCoordinatesNode;95;-1352.458,1069.003;Inherit;False;0;39;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.SimpleAddOpNode;93;-1047.401,1208.877;Inherit;True;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.RangedFloatNode;91;-566.4587,1621.847;Inherit;False;Property;_Float0;Float 0;5;0;Create;True;0;0;False;0;False;0;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;39;-708.51,1169.117;Inherit;True;Property;_Texture2;Texture2;0;0;Create;True;0;0;False;0;False;-1;None;a1ed829951b739849ab353dc696355b7;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.ColorNode;92;-623.187,1408.944;Float;False;Property;_Texture_Color;Texture_Color ;3;0;Create;True;0;0;False;0;False;1,1,1,0;0.06225456,0.4,0,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;101;-642.9165,1768.875;Inherit;True;Property;_Mask;Mask;4;0;Create;True;0;0;False;0;False;-1;None;5e443555f21819043a6b6586128de6e5;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;89;-283.5381,1473.724;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;80;-22.1301,1480.766;Half;False;True;-1;2;ASEMaterialInspector;100;1;Cheng/Noise_Maskalpha;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;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;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;True;1;LightMode=ForwardBase;False;0;;1;=;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;0
WireConnection;96;0;99;2
WireConnection;96;1;87;0
WireConnection;97;0;98;0
WireConnection;97;1;99;2
WireConnection;94;0;97;0
WireConnection;94;1;96;0
WireConnection;93;0;95;0
WireConnection;93;1;94;0
WireConnection;39;1;93;0
WireConnection;89;0;39;0
WireConnection;89;1;92;0
WireConnection;89;2;91;0
WireConnection;89;3;101;4
WireConnection;80;0;89;0
ASEEND*/
//CHKSM=AB95DB10AC0B3CD541D52F8EF8045D939815EFB4