Cube的混淆

来源:互联网 发布:键盘记录软件 隐蔽手机 编辑:程序博客网 时间:2024/06/06 23:16


Shader "Custom/TwoImg" {
 Properties {
  _MainTex ("Base (RGB)", 2D) = "white" {} //2D表示图片
  _MainTex2 ("Tex2 (RGB)", 2D) = "white" {}
  _Color ("Main color", Color) = (0,1,0,1) //Color表示颜色

 }
 SubShader {
  Pass{
   Material{
    Diffuse[_Color]
   }
   Lighting on
  SeparateSpecular On  //激活不同颜色反射高光,无用
   SetTexture[_MainTex]
   {
    constantColor [_Color]
    //第一张材质 * 顶点颜色
    Combine texture * primary DOUBLE //Double表灯光双倍加亮,加上primary整体变黑
   }
   SetTexture[_MainTex2]{
    constantColor [_Color]
    //第二张材质 * 之前累积(这里即第一张材质)
    Combine texture * previous DOUBLE //previous表示上一张材质,Double表灯光双倍加亮
   }
  }
 }
 FallBack "Diffuse"
}

0 0