在2张贴图之间褪色转换的shader

Shader "VrorangeShaders/MixTexture" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_Texture0 ("Texture0 (RGB)", 2D) = "white" {}
_Texture1 ("Texture1 (RGB)", 2D) = "white" {}
_MixValue ("MixValue (Range)",Range(0,1)) = 0.5
}
SubShader {
Cull Back
ZWrite On
ZTest LEqual
Tags {"Queue"="Geometry+0" "IgnoreProjector"="False" "RenderType"="Opaque" }
CGPROGRAM
#pragma surface surf Lambert

float4 _Color;
sampler2D _Texture0;
sampler2D _Texture1;
float _MixValue;

struct Input {
float2 uv_Texture0;
float2 uv_Texture1;
};

void surf (Input IN, inout SurfaceOutput o){
half4 c0=tex2D (_Texture0, IN.uv_Texture0);
half4 c1=tex2D (_Texture1, IN.uv_Texture1);
c0=c0*_MixValue;
c1=c1*(1-_MixValue);
o.Albedo=(c0+c1)*_Color;
}

ENDCG
}
FallBack "Diffuse"
}

效果图如下(就是改变我圈住的那个MinValue(Range)的这个值。用代码动态改变我不会,还望知道的指点下,谢谢了....)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值