popcorn/Shader/3D/UnlitUVScrollAdditive.shader

72 lines
2.0 KiB
Plaintext
Raw Normal View History

Shader "UsayaLib/3D/Unlit/UVScrollAdditive" {
Properties {
_TintColor ("Tint Color", Color) = (0.5, 0.5, 0.5, 0.5)
_MainTex ("Base (RGB)", 2D) = "white" { }
_ScrollX ("Scroll X", float) = 0
_ScrollY ("Scroll Y", float) = 0
}
SubShader {
Tags {
"Queue" = "Transparent"
"IgnoreProjector" = "True"
"RenderType" = "Transparent"
}
Blend SrcAlpha One
Cull Off
ZWrite Off
Fog {
Mode Off
}
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_particles
#pragma multi_compile_fog
#include "UnityCG.cginc"
fixed4 _TintColor;
sampler2D _MainTex;
float4 _MainTex_ST;
float _ScrollX;
float _ScrollY;
struct appdata_t {
float4 vertex: POSITION;
float4 texcoord: TEXCOORD0;
fixed4 color: COLOR;
};
struct v2f {
float4 vertex: SV_POSITION;
float2 texcoord: TEXCOORD0;
fixed4 color: COLOR;
UNITY_FOG_COORDS(1)
};
v2f vert(appdata_t v){
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
o.texcoord.x = o.texcoord.x + _ScrollX * _Time.y;
o.texcoord.y = o.texcoord.y + _ScrollY * _Time.y;
o.color = 2.0 * v.color * _TintColor;
UNITY_TRANSFER_FOG(o, o.vertex);
return o;
}
fixed4 frag(v2f i): SV_Target {
fixed4 col = i.color * tex2D(_MainTex, i.texcoord);
UNITY_APPLY_FOG_COLOR(i.fogCoord, col, (fixed4)0);
return col;
}
ENDCG
}
}
Fallback off
}