Unity surface shader 2

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"

}


posted @ 2017-01-10 14:05  00000000O  阅读(180)  评论(0编辑  收藏  举报