AlphaDiscardTreshold is now supported by the Unshaded material.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10588 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent 5b65b19bda
commit 706cd410b6
  1. 12
      engine/src/core-data/Common/MatDefs/Misc/Unshaded.frag
  2. 4
      engine/src/core-data/Common/MatDefs/Misc/Unshaded.j3md

@ -2,6 +2,10 @@
#define NEED_TEXCOORD1
#endif
#if defined(DISCARD_ALPHA)
uniform float m_AlphaDiscardThreshold;
#endif
uniform vec4 m_Color;
uniform sampler2D m_ColorMap;
uniform sampler2D m_LightMap;
@ -15,7 +19,7 @@ void main(){
vec4 color = vec4(1.0);
#ifdef HAS_COLORMAP
color *= texture2D(m_ColorMap, texCoord1);
color *= texture2D(m_ColorMap, texCoord1);
#endif
#ifdef HAS_VERTEXCOLOR
@ -34,5 +38,11 @@ void main(){
#endif
#endif
#if defined(DISCARD_ALPHA)
if(color.a < m_AlphaDiscardThreshold){
discard;
}
#endif
gl_FragColor = color;
}

@ -16,6 +16,9 @@ MaterialDef Unshaded {
Int NumberOfBones
Matrix4Array BoneMatrices
// Apha threshold for fragment discarding
Float AlphaDiscardThreshold (AlphaTestFallOff)
//Shadows
Int FilterMode
Boolean HardwareShadows
@ -61,6 +64,7 @@ MaterialDef Unshaded {
HAS_VERTEXCOLOR : VertexColor
HAS_COLOR : Color
NUM_BONES : NumberOfBones
DISCARD_ALPHA : AlphaDiscardThreshold
}
}

Loading…
Cancel
Save