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
            }
        }
    }
}




<div class="se-preview-section-delimiter"></div>
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
            }
        }
    }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章