2025-05-18 01:04:31 +08:00

188 lines
7.9 KiB
Plaintext

// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Cheng/UV_one"
{
Properties
{
_Color1("Color", Color) = (1,1,1,1)
_Texture1("Texture", 2D) = "white" {}
_Mask1("Mask", 2D) = "white" {}
_Glow1("Glow", Float) = 1
_U1("U", Float) = 0
_V1("V", Float) = 0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" "Queue"="Transparent" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
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
#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_texcoord1 : TEXCOORD1;
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_texcoord2 : TEXCOORD2;
float4 ase_color : COLOR;
};
uniform sampler2D _Texture1;
uniform half4 _Texture1_ST;
uniform half _U1;
uniform half _V1;
uniform sampler2D _Mask1;
uniform half4 _Mask1_ST;
uniform half _Glow1;
uniform half4 _Color1;
v2f vert ( appdata v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
half2 appendResult8 = (half2(( _U1 * _Time.y ) , ( _Time.y * _V1 )));
half2 vertexToFrag9 = appendResult8;
o.ase_texcoord2.xy = vertexToFrag9;
o.ase_texcoord1.xy = v.ase_texcoord1.xy;
o.ase_texcoord1.zw = v.ase_texcoord.xy;
o.ase_color = v.color;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord2.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 uv118 = i.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
half2 appendResult19 = (half2(uv118.x , uv118.y));
half2 uv0_Texture1 = i.ase_texcoord1.zw * _Texture1_ST.xy + _Texture1_ST.zw;
half2 vertexToFrag9 = i.ase_texcoord2.xy;
float2 uv_Mask1 = i.ase_texcoord1.zw * _Mask1_ST.xy + _Mask1_ST.zw;
finalColor = ( tex2D( _Texture1, ( ( appendResult19 + uv0_Texture1 ) + vertexToFrag9 ) ) * i.ase_color * i.ase_color.a * tex2D( _Mask1, uv_Mask1 ) * _Glow1 * _Color1 );
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18100
391;125;2366;1297;2663.142;882.1219;1.3;True;False
Node;AmplifyShaderEditor.CommentaryNode;2;-1824.332,-268.9344;Inherit;False;975.4393;477.0781;UV;7;9;8;7;6;5;4;3;;1,1,1,1;0;0
Node;AmplifyShaderEditor.TimeNode;3;-1774.332,-63.3963;Inherit;False;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;4;-1760.892,-165.8563;Inherit;False;Property;_U1;U;4;0;Create;True;0;0;False;0;False;0;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;5;-1746.892,93.14371;Inherit;False;Property;_V1;V;5;0;Create;True;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;7;-1518.332,32.6037;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;6;-1509.332,-142.3963;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;18;-1614.6,-571.9003;Inherit;False;1;-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.DynamicAppendNode;8;-1326.892,-72.85629;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;10;-1351.743,-409.9344;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;19;-1216.6,-535.8999;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.VertexToFragmentNode;9;-1089.588,-74.4236;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleAddOpNode;20;-1032.6,-426.9002;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.SimpleAddOpNode;11;-740.892,-207.8563;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.VertexColorNode;13;-514.2039,-7.607086;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;14;-610.9261,151.6068;Inherit;True;Property;_Mask1;Mask;2;0;Create;True;0;0;False;0;False;-1;None;eb3a71e2cbc64e545aefd90ec628adb8;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;12;-557.6033,-234.9452;Inherit;True;Property;_Texture1;Texture;1;0;Create;True;0;0;False;0;False;-1;None;26f5e8c6830ddad489750d0f3f65169e;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;16;-390.9263,430.17;Inherit;False;Property;_Color1;Color;0;0;Create;True;0;0;False;0;False;1,1,1,1;1,0,0,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RangedFloatNode;15;-414.0468,338.6234;Inherit;False;Property;_Glow1;Glow;3;0;Create;True;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;17;-126.0036,-5.745193;Inherit;False;6;6;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;COLOR;0,0,0,0;False;4;FLOAT;0;False;5;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;1;114,-6;Half;False;True;-1;2;ASEMaterialInspector;100;11;Cheng/UV_one;23941dbacc39cbf4996969912d2446a4;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;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;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;7;0;3;2
WireConnection;7;1;5;0
WireConnection;6;0;4;0
WireConnection;6;1;3;2
WireConnection;8;0;6;0
WireConnection;8;1;7;0
WireConnection;19;0;18;1
WireConnection;19;1;18;2
WireConnection;9;0;8;0
WireConnection;20;0;19;0
WireConnection;20;1;10;0
WireConnection;11;0;20;0
WireConnection;11;1;9;0
WireConnection;12;1;11;0
WireConnection;17;0;12;0
WireConnection;17;1;13;0
WireConnection;17;2;13;4
WireConnection;17;3;14;0
WireConnection;17;4;15;0
WireConnection;17;5;16;0
WireConnection;1;0;17;0
ASEEND*/
//CHKSM=1B8EDFE94E8523736EAE28FE78D8FC1F33A0B0EA