Unity surface shader 2

来源:互联网 发布:温州网络问政 排名 编辑:程序博客网 时间:2024/05/17 23:33

UV滚动

Shader "Nafio/ScrollUV" {Properties{_Tex("T",2D) = "white" {}_SpeedV("SV",float) = 0_SpeedU("SU",float) = 1}SubShader{Tags{"RenderType"="Opaque"}LOD 200CGPROGRAM#pragma surface surf Lambertsampler2D _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"}


0 0
原创粉丝点击