wait to explain

Shader "Custom/2lsy_earth" {
		Properties {
		    _Color ("Main Color", Color) = (1,1,1,0.5)
		    _MainTex ("Texture", 2D) = "white" { }
		    _Cloud ("_Cloud", 2D) = "white" { }
		//    _Fuck("Fuck",Range(0,1))= 0.4
		}
		SubShader {
		Tags{"Queue" = "Transparent" "RenderType"="Transparent"}
		    Pass {
		
		CGPROGRAM
		#pragma vertex vert
		#pragma fragment frag
		
		#include "UnityCG.cginc"
		
		float4 _Color;
		sampler2D _MainTex;
		sampler2D	_Cloud;
		
		struct v2f {
		    float4  pos : SV_POSITION;
		    float2  uv : TEXCOORD0;
		};
		
		float4 _MainTex_ST;

	//------------------------------------------------------------------------------------
		v2f vert (appdata_base v)  
		{
		    v2f o;
		    o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
		    o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
		    return o;
		}

	//------------------------------------------------------------------------------------
		
		half4 frag (v2f i) : COLOR      //The uv-map for earth,x stand for u.
		{
			float u = i.uv.x + -0.10*_Time;
			float2 x=float2( u , i.uv.y);
		    half4 texcol = tex2D (_MainTex, x);  //The uv-map for cloud layer is moving too,but it's faster than the earth
		    texcol = texcol;
		     
		    u = i.uv.x + -0.5*_Time;
			x=float2( u , i.uv.y);
			
			half4 texcol3 = tex2D (_Cloud, x);       // White x= the color in cloud 
			half4 texcol0 = float4(1,1,1,0) * (texcol3.x);   //mix the color of earth and cloud
		  //  return texcol0+ texcol;
		    return lerp(texcol,texcol0,0.5f);
		}
		ENDCG
		
		 }
		}


//		Properties {
//			_Color ("Main Color", Color) = (1,1,1,1)
//			_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
//		}
//		
//		SubShader {
//			Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
//			LOD 200
//		
//		CGPROGRAM
//		#pragma surface surf Lambert alpha
//		
//		sampler2D _MainTex;
//		fixed4 _Color;
//		
//		struct Input {
//			float2 uv_MainTex;
//		};
//		
//		void surf (Input IN, inout SurfaceOutput o) {
//		    float x = IN.uv_MainTex.x - 0.5 * _Time;
//		    float y = IN.uv_MainTex.y;
//		    float2 myUV = float2(x,y);
//			fixed4 c = tex2D(_MainTex, myUV) * _Color;
//			o.Albedo = c.rgb;
//			o.Alpha = c.a;
//		}
//		ENDCG
//		}
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值