From d9805196747ead83dbfff723c489d4582bd06f3e Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Mon, 24 Sep 2012 16:40:03 +0000 Subject: [PATCH] Re-introduced alphaDiscardThreshold in lighting frag git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9768 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core-data/Common/MatDefs/Light/Lighting.frag | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/src/core-data/Common/MatDefs/Light/Lighting.frag b/engine/src/core-data/Common/MatDefs/Light/Lighting.frag index 8664facfb..eac42df22 100644 --- a/engine/src/core-data/Common/MatDefs/Light/Lighting.frag +++ b/engine/src/core-data/Common/MatDefs/Light/Lighting.frag @@ -55,6 +55,8 @@ varying vec3 SpecularSum; uniform sampler2D m_ColorRamp; #endif +uniform float m_AlphaDiscardThreshold; + #ifndef VERTEX_LIGHTING uniform float m_Shininess; @@ -169,7 +171,10 @@ void main(){ float alpha = DiffuseSum.a * diffuseColor.a; #ifdef ALPHAMAP alpha = alpha * texture2D(m_AlphaMap, newTexCoord).r; - #endif + #endif + if(alpha < m_AlphaDiscardThreshold){ + discard; + } #ifndef VERTEX_LIGHTING float spotFallOff = 1.0;