shaoxiadiablo/Assets/Arts/VFX/Shader/VFX_Rongjie_Add.shader

211 lines
9.7 KiB
Plaintext
Raw Normal View History

2025-05-18 01:04:31 +08:00
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "VFX/VFX_Rongjie_Add"
{
Properties
{
_Texture("Texture", 2D) = "white" {}
_Mask("Mask", 2D) = "white" {}
[HDR]_Color0("_Color0", Color) = (1,1,1,0)
_Rongjie("Rongjie", 2D) = "white" {}
_R_V("R_V", Float) = 0
_Rongjie_U("Rongjie_U", Float) = 0
_Rongjie_V("Rongjie_V", Float) = 0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 0
CGINCLUDE
#pragma target 3.0
ENDCG
Blend One One
Cull Off
ColorMask RGBA
ZWrite Off
ZTest LEqual
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"
#define ASE_NEEDS_FRAG_COLOR
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 ase_texcoord : TEXCOORD0;
float4 ase_texcoord2 : TEXCOORD2;
};
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_texcoord2 : TEXCOORD2;
float4 ase_color : COLOR;
};
uniform sampler2D _Texture;
uniform half4 _Texture_ST;
uniform half4 _Color0;
uniform sampler2D _Mask;
uniform half4 _Mask_ST;
uniform sampler2D _Rongjie;
uniform half4 _Rongjie_ST;
uniform half _Rongjie_U;
uniform half _Rongjie_V;
uniform half _R_V;
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_texcoord2.xyz = v.ase_texcoord2.xyz;
o.ase_color = v.color;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.zw = 0;
o.ase_texcoord2.w = 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_Texture = i.ase_texcoord1.xy * _Texture_ST.xy + _Texture_ST.zw;
half3 uv2_Texture = i.ase_texcoord2.xyz;
uv2_Texture.xy = i.ase_texcoord2.xyz.xy * _Texture_ST.xy + _Texture_ST.zw;
half2 appendResult5 = (half2(uv2_Texture.x , uv2_Texture.y));
float2 uv_Mask = i.ase_texcoord1.xy * _Mask_ST.xy + _Mask_ST.zw;
half2 uv0_Rongjie = i.ase_texcoord1.xy * _Rongjie_ST.xy + _Rongjie_ST.zw;
half2 appendResult23 = (half2(( _Rongjie_U * _Time.y ) , ( _Time.y * _Rongjie_V )));
half lerpResult29 = lerp( _R_V , 1.5 , uv2_Texture.z);
half clampResult34 = clamp( ( ( tex2D( _Rongjie, ( uv0_Rongjie + appendResult23 ) ).r * _R_V ) - lerpResult29 ) , 0.0 , 1.0 );
finalColor = ( ( tex2D( _Texture, ( uv0_Texture + appendResult5 ) ) * _Color0 * i.ase_color * tex2D( _Mask, uv_Mask ) * i.ase_color.a ) * clampResult34 );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18100
2567;7;2547;1364;1850.401;-215.0775;1;True;True
Node;AmplifyShaderEditor.TimeNode;17;-1911.043,1108.016;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;27;-1873.547,1342.696;Inherit;False;Property;_Rongjie_V;Rongjie_V;6;0;Create;True;0;0;False;0;False;0;-1.79;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;26;-1897.547,917.6958;Inherit;False;Property;_Rongjie_U;Rongjie_U;5;0;Create;True;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;19;-1567.547,1223.696;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;18;-1575.547,1022.696;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;25;-1477.547,836.6958;Inherit;False;0;12;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.DynamicAppendNode;23;-1358.547,1112.696;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.SimpleAddOpNode;24;-1180.547,1001.696;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;8;-1331.3,88.5;Inherit;True;2;2;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.RangedFloatNode;30;-909.5469,1310.696;Inherit;False;Property;_R_V;R_V;4;0;Create;True;0;0;False;0;False;0;-1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;31;-905.5469,1451.696;Inherit;False;Constant;_Float1;Float 1;7;0;Create;True;0;0;False;0;False;1.5;-1.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;12;-952.4553,979.9886;Inherit;True;Property;_Rongjie;Rongjie;3;0;Create;True;0;0;False;0;False;-1;None;8c2c7f090e4de484ba24bbeef3463050;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;5;-1015,107.5;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;11;-1079.936,-195.3594;Inherit;True;0;2;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;29;-498.1468,1300.396;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;9;-735,-2.5;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;28;-491.5469,1092.696;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;2;-557,-34.5;Inherit;True;Property;_Texture;Texture;0;0;Create;True;0;0;False;0;False;-1;None;b7056cd030d47bb42878bd2106cada44;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;7;-508,641.5;Inherit;True;Property;_Mask;Mask;1;0;Create;True;0;0;False;0;False;-1;None;None;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;6;-487.0825,428.5827;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleSubtractOpNode;32;-235.2147,1174.107;Inherit;True;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;4;-507,226.5;Half;False;Property;_Color0;_Color0;2;1;[HDR];Create;True;0;0;False;0;False;1,1,1,0;1.498039,1.498039,1.498039,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-145,141.5;Inherit;False;5;5;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;4;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ClampOpNode;34;91.78528,1190.107;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;35;372.7577,411.2852;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;626.2,281.4;Half;False;True;-1;2;ASEMaterialInspector;0;1;VFX/VFX_Rongjie_Add;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;4;1;False;-1;1;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;True;False;True;2;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;False;0;False;-1;0;False;-1;True;1;RenderType=Opaque=RenderType;True;2;0;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;0
WireConnection;19;0;17;2
WireConnection;19;1;27;0
WireConnection;18;0;26;0
WireConnection;18;1;17;2
WireConnection;23;0;18;0
WireConnection;23;1;19;0
WireConnection;24;0;25;0
WireConnection;24;1;23;0
WireConnection;12;1;24;0
WireConnection;5;0;8;1
WireConnection;5;1;8;2
WireConnection;29;0;30;0
WireConnection;29;1;31;0
WireConnection;29;2;8;3
WireConnection;9;0;11;0
WireConnection;9;1;5;0
WireConnection;28;0;12;1
WireConnection;28;1;30;0
WireConnection;2;1;9;0
WireConnection;32;0;28;0
WireConnection;32;1;29;0
WireConnection;3;0;2;0
WireConnection;3;1;4;0
WireConnection;3;2;6;0
WireConnection;3;3;7;0
WireConnection;3;4;6;4
WireConnection;34;0;32;0
WireConnection;35;0;3;0
WireConnection;35;1;34;0
WireConnection;1;0;35;0
ASEEND*/
//CHKSM=4F236BA1DF78124892BB14E06EEC4305A4F991EB