纳金网

标题: 材质溶合转换shader [打印本页]

作者: 会飞的鱼    时间: 2012-2-23 15:15
标题: 材质溶合转换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 su**ce surf Lambert
float4 _Color;
sampler2D _Texture0;
sampler2D _Texture1;
float _MixValue;

s***ct Input {
float2 uv_Texture0;
float2 uv_Texture1;
};
void surf (Input IN, inout Su**ceOutput 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"
}




欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5