浏览代码

* Require alpha discard define to be set in order to enable the alpha discard feature (for multi pass lighting shader)

shadowislord 11 年之前
父节点
当前提交
4050b7cbbf
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      jme3-core/src/main/resources/Common/MatDefs/Light/Lighting.frag

+ 5 - 3
jme3-core/src/main/resources/Common/MatDefs/Light/Lighting.frag

@@ -106,9 +106,11 @@ void main(){
     #ifdef ALPHAMAP
     #ifdef ALPHAMAP
        alpha = alpha * texture2D(m_AlphaMap, newTexCoord).r;
        alpha = alpha * texture2D(m_AlphaMap, newTexCoord).r;
     #endif
     #endif
-    if(alpha < m_AlphaDiscardThreshold){
-        discard;
-    }
+    #ifdef DISCARD_ALPHA
+        if(alpha < m_AlphaDiscardThreshold){
+            discard;
+        }
+    #endif
 
 
 
 
     // ***********************
     // ***********************