2015-09-14 31 views
0

我寫了多個fixed function Shaders。我注意到,只要着色器包含超過3個2D紋理,着色器就會中斷並統一報告Material doesn't have a ... property對於每個屬性...材質。例如:使用超過3個2D貼圖時,「材質沒有......屬性」

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報告此錯誤。這似乎是一個錯誤。如何解決這個問題呢?

回答

0

完成了一些研究後,我現在可以得出結論,我正在使用的着色器編譯目標不支持三個以上的紋理。 (不幸的是,我遺失了描述此限制的文檔的鏈接。)

相關問題