首页 > 代码库 > 河流Shader
河流Shader
原地址:http://www.unity蛮牛.com/blog-2321-336.html
Shader "Custom/TextureEffect" { Properties { _MainTint("Diffuse Tint",Color) = (1,1,1,1) _MainTex ("Base (RGB)", 2D) = "white" {} _ScrollXSpeed("X Scroll Speed",Range(0,10)) = 2 _ScrollYSpeed("Y Scroll Speed",Range(0,10)) = 2 } SubShader { Tags { "RenderType"="Opaque" } LOD 200 CGPROGRAM #pragma surface surf Lambert sampler2D _MainTex; fixed4 _MainTint; fixed _ScrollXSpeed; fixed _ScrollYSpeed; struct Input { float2 uv_MainTex; }; void surf (Input IN, inout SurfaceOutput o) { fixed2 scrolledUV = IN.uv_MainTex; fixed XScrollValue =http://www.mamicode.com/_ScrollXSpeed * _Time; fixed YScrollValue =http://www.mamicode.com/_ScrollYSpeed * _Time; scrolledUV += fixed2(XScrollValue,YScrollValue); half4 c = tex2D (_MainTex,scrolledUV); o.Albedo = c.rgb; o.Alpha = c.a; } ENDCG } FallBack "Diffuse" }
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。