Fixed Function Shader

Shader "zff/1"
{
    Properties
    {
        _Color("Main Color", Color)=(1,.5,.5,1)
    }
    SubShader
    {
        Pass
        {
            Material
            {
                Diffuse [_Color] // 显示该颜色
            }
            Lighting On //打开光照开关,既接受光照
        }
    }
}
```shader
Shader "zff/1_2show1texture"
{
    Properties
    {
        _MainTex(Base )RGB)",2D)="white"{}
        _Color("Main color",Color)=(1,1,1,1)
    }
    SubShader
    {
        Pass
        {
            Material
            {
                Diffuse[_Color]
            }
            Lighting On
            SetTexture[_MainTex]
            {
                Combine texture * primary,texture * constant
            }
        }
    }
}




"se-preview-section-delimiter">
Shader "zff/1_3merge2texture"
{
    Properties
    {
        _MainTex("Base(RGB)",2D)="white"{}
        _MainTex2("Tex2(RGB)",2D)="white"{}
        _Color("main color",Color)=(1,1,1,1)
    }

}
```shader
Shader "zff/1_3merge2texture"
{
    Properties
    {
        _MainTex("Base(RGB)",2D)="white"{}
        _MainTex2("Tex2(RGB)",2D)="white"{}
        _Color("main color",Color)=(1,1,1,1)
    }
    SubShader
    {
        Pass
        {
            Material
            {
                Diffuse[_Color]
            }
            Lighting On
            SetTexture[_MainTex]
            {
                //第一张材质*顶点颜色
                Combine texture * primary
            }
            SetTexture[_MainTex2]
            {
                //第二张材质*之前累积
                Combine texture * previous
            }
        }
    }
}

你可能感兴趣的:(Fixed Function Shader)