Shadows/SSAO and transparency : Removed the AlphaDiscardThreshold attribute from the lighting material. Transparency discarding is now handled by the AlphaFallOff render state (as it should be).
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9330 75d07b2b-3a1a-0410-a2c5-0572b91ccdca3.0
parent
8de8bf2d3e
commit
22edb7beb0
@ -1,27 +1,24 @@ |
|||||||
varying vec2 texCoord; |
varying vec2 texCoord; |
||||||
|
|
||||||
#ifdef DISCARD_ALPHA |
|
||||||
#ifdef COLOR_MAP |
#ifdef COLOR_MAP |
||||||
uniform sampler2D m_ColorMap; |
uniform sampler2D m_ColorMap; |
||||||
#else |
|
||||||
uniform sampler2D m_DiffuseMap; |
|
||||||
#endif |
#endif |
||||||
uniform float m_AlphaDiscardThreshold; |
#ifdef DIFFUSEMAP |
||||||
|
uniform sampler2D m_DiffuseMap; |
||||||
#endif |
#endif |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void main(){ |
void main(){ |
||||||
#ifdef DISCARD_ALPHA |
float a = 1.0; |
||||||
|
|
||||||
#ifdef COLOR_MAP |
#ifdef COLOR_MAP |
||||||
if (texture2D(m_ColorMap, texCoord).a <= m_AlphaDiscardThreshold){ |
a = texture2D(m_ColorMap, texCoord).a; |
||||||
discard; |
|
||||||
} |
|
||||||
#else |
|
||||||
if (texture2D(m_DiffuseMap, texCoord).a <= m_AlphaDiscardThreshold){ |
|
||||||
discard; |
|
||||||
} |
|
||||||
#endif |
#endif |
||||||
|
#ifdef DIFFUSEMAP |
||||||
|
a = texture2D(m_DiffuseMap, texCoord).a; |
||||||
#endif |
#endif |
||||||
|
|
||||||
gl_FragColor = vec4(1.0); |
gl_FragColor = vec4(a); |
||||||
} |
} |
Loading…
Reference in new issue