您的位置:首页 > 其它

Shader 透明效果+纹理融合Code

2017-05-22 11:26 411 查看
Shader "ShaderCustom/ShaderStructs" {

Properties{
_MainColor("MainColor",color) = (1,1,1,1)
_AmbientColor("AmbientColor",color)=(0.3,0.3,0.3,0.3)
_Specular("Specular",color) = (1,1,1,1)
_Shininess("Shininess",range(0,1)) = 1
_Emission("Emission",color) = (1,1,1,1)
_SetTexture("texture2d",2d) = ""
_SetSecondTexture("setSecondTexture",2d) = ""
//        _TextureRet("texture rect",rect) = "whitle"{}
}

//fixed shader
SubShader{
pass{
color[_MainColor]

blend SrcAlpha OneMinusSrcAlpha  //Shader lab  blend
Tags { "Queue" = "Transparent" }

//设置环境光等。。。。
material
{
diffuse[_MainColor]  //漫反射光
ambient[_AmbientColor] //环境光
specular[_Specular]        //高光  镜面反射
shininess[_Shininess]    //高光的范围
emission[_Emission]        //自发光的颜色
}

lighting on            //使用 diffuse ambient  必须要开始lighting
separatespecular on //  使用specular  必须开始

settexture[_SetTexture] //设置材质
{
//设置纹理合并  combine
combine texture * primary  double
}
settexture[_SetSecondTexture]
{
//设置纹理合并
combine texture * primary  double
}

}
}
FallBack "diffuse"
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Shader 入门 3d U3D