"材料没有...属性"使用3个以上的2D纹理时

时间:2015-09-14 19:53:35

标签: unity3d shader

我写了多个fixed function Shaders。我注意到,只要Shader包含3个以上的2D纹理,Shader就会断开并统一报告每个属性的Material doesn't have a ... property ......材料有。例如:

Shader "Custom/JustAnotherShader" {
    Properties{
        _MainTex("Base (RGB)", 2D) = "white" { }
        _TexA("Another Texture", 2D) = "black" { }
        _TexB("Yet Another Texture", 2D) = "" { }
        _TexC("One More Another Texture", 2D) = "" { }
    }

    SubShader {
        Pass {
            SetTexture[_MainTex] { combine texture }
            SetTexture[_TexA] { combine texture * previous }
            SetTexture[_TexB] { combine texture + previous }
            SetTexture[_TexC] { combine texture - previous }
        }
    }

    Fallback Off
}

此代码会报告_MainTex_TexA_TexB_TexC的此错误。这似乎是一个错误。如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

做了一些研究之后,我现在可以得出结论,我正在使用的着色器编译目标不支持三种以上的纹理。 (不幸的是,我丢失了描述此限制的文档的链接。)