码迷,mamicode.com
首页 > 其他好文 > 详细

河流Shader

时间:2014-05-05 22:04:24      阅读:571      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   java   ext   

原地址:http://www.unity蛮牛.com/blog-2321-336.html

bubuko.com,布布扣
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 =_ScrollXSpeed * _Time;
            fixed YScrollValue =_ScrollYSpeed * _Time;

            scrolledUV += fixed2(XScrollValue,YScrollValue);

            half4 c = tex2D (_MainTex,scrolledUV);
            o.Albedo = c.rgb;
            o.Alpha = c.a;
        }
        ENDCG
    } 
    FallBack "Diffuse"
}
bubuko.com,布布扣

 

河流Shader,布布扣,bubuko.com

河流Shader

标签:style   blog   class   code   java   ext   

原文地址:http://www.cnblogs.com/123ing/p/3704904.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!