untiy3d 混合贴图shader
2012-11-30 11:46
162 查看
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"
}
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"
}
相关文章推荐
- Unity3D ShaderLab 混合两张贴图(Blend)
- Unity3D ShaderLab压缩混合纹理贴图
- unity混合两种贴图shader
- Unity3D ShaderLab 混合两张贴图(Blend)
- Shader学习——10可调节像素漫反射 带贴图 加法线贴图 。。。。。常用
- Directx11教程十一之AlphaMap(混合贴图)
- Unity3D Shader编程】之三 光之城堡篇:子着色器、通道与标签的写法 & 纹理混合
- Shader中贴图知识汇总: 漫反射贴图、凹凸贴图、高光贴图、 AO贴图、环境贴图、 光照纹理及细节贴图
- Catlike渲染教程之贴图混合
- 关于NGUI中UITexture贴图自定义的shader文件在UISrollView中不报错的解决方案
- Shader学习——09可调节像素漫反射加高光(高光更亮)带贴图 加法线贴图 。。。。。常用
- shader进阶 多个着色器混合以及drawcall优化
- shader 光照贴图
- Unity3D Shader编程】之五 圣诞夜篇: Unity中Shader的三种形态对比&混合操作合辑
- 在Unity的后处理shader中通过屏幕像素坐标和深度贴图反推世界坐标
- Shader混合模式--正片叠底、滤色、叠加
- 【浅墨Unity3D Shader编程】之三 光之城堡篇:子着色器、通道与标签的写法 & 纹理混合
- Unity3D Shader官方教程翻译(十一)----Shader语法:Pass的Blending(混合)
- Unity Shader 学习笔记(十一) 混合纹理Shader实例
- Shader中贴图知识汇总: 漫反射贴图、凹凸贴图、高光贴图、 AO贴图、环境贴图、 光照纹理及细节贴图