UV滚动
Shader "Nafio/ScrollUV"
{
Properties
{
_Tex("T",2D) = "white" {}
_SpeedV("SV",float) = 0
_SpeedU("SU",float) = 1
}
SubShader
{
Tags{"RenderType"="Opaque"}
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _Tex;
fixed _SpeedV;
fixed _SpeedU;
struct Input
{
float2 uv_Tex;
};
void surf(Input IN,inout SurfaceOutput s)
{
fixed2 scruv = IN.uv_Tex;
fixed offv = _SpeedV * _Time;
fixed offu = _SpeedU * _Time;
scruv +=fixed2(offu,offv);
fixed4 c = tex2D(_Tex,scruv);
s.Albedo = c.rgb;
s.Alpha = 1;
}
ENDCG
}
FallBack "Diffuse"
}