AlphaDiscardTreshold is now supported by the Unshaded material.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10588 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
5b65b19bda
commit
706cd410b6
@ -2,6 +2,10 @@
|
|||||||
#define NEED_TEXCOORD1
|
#define NEED_TEXCOORD1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(DISCARD_ALPHA)
|
||||||
|
uniform float m_AlphaDiscardThreshold;
|
||||||
|
#endif
|
||||||
|
|
||||||
uniform vec4 m_Color;
|
uniform vec4 m_Color;
|
||||||
uniform sampler2D m_ColorMap;
|
uniform sampler2D m_ColorMap;
|
||||||
uniform sampler2D m_LightMap;
|
uniform sampler2D m_LightMap;
|
||||||
@ -34,5 +38,11 @@ void main(){
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(DISCARD_ALPHA)
|
||||||
|
if(color.a < m_AlphaDiscardThreshold){
|
||||||
|
discard;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gl_FragColor = color;
|
gl_FragColor = color;
|
||||||
}
|
}
|
@ -16,6 +16,9 @@ MaterialDef Unshaded {
|
|||||||
Int NumberOfBones
|
Int NumberOfBones
|
||||||
Matrix4Array BoneMatrices
|
Matrix4Array BoneMatrices
|
||||||
|
|
||||||
|
// Apha threshold for fragment discarding
|
||||||
|
Float AlphaDiscardThreshold (AlphaTestFallOff)
|
||||||
|
|
||||||
//Shadows
|
//Shadows
|
||||||
Int FilterMode
|
Int FilterMode
|
||||||
Boolean HardwareShadows
|
Boolean HardwareShadows
|
||||||
@ -61,6 +64,7 @@ MaterialDef Unshaded {
|
|||||||
HAS_VERTEXCOLOR : VertexColor
|
HAS_VERTEXCOLOR : VertexColor
|
||||||
HAS_COLOR : Color
|
HAS_COLOR : Color
|
||||||
NUM_BONES : NumberOfBones
|
NUM_BONES : NumberOfBones
|
||||||
|
DISCARD_ALPHA : AlphaDiscardThreshold
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user