Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-06-09 19:45:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-06-09 19:45:46 +0400
commitf39758cddca1d6eeec299e8cd3eef9a2a1852e32 (patch)
treef0fea31777404174be524ab6feca2f30ec05bf99 /source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
parent610b877f60083ef064058efc7011a5b35c5e96b7 (diff)
adding clip alpha (binary alpha) to the 3D view and game engine.
Diffstat (limited to 'source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp')
-rw-r--r--source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
index 46fe24d8b87..09dd14172c8 100644
--- a/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
@@ -154,16 +154,23 @@ int set_tpage(MTFace *tface)
fAlphamode= tface->transp;
if(fAlphamode) {
- glEnable(GL_BLEND);
-
if(fAlphamode==TF_ADD) {
+ glEnable(GL_BLEND);
glBlendFunc(GL_ONE, GL_ONE);
+ glDisable ( GL_ALPHA_TEST );
/* glBlendEquationEXT(GL_FUNC_ADD_EXT); */
}
else if(fAlphamode==TF_ALPHA) {
+ glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glDisable ( GL_ALPHA_TEST );
/* glBlendEquationEXT(GL_FUNC_ADD_EXT); */
}
+ else if (alphamode==TF_CLIP){
+ glDisable(GL_BLEND);
+ glEnable ( GL_ALPHA_TEST );
+ glAlphaFunc(GL_GREATER, 0.5f);
+ }
/* else { */
/* glBlendFunc(GL_ONE, GL_ONE); */
/* glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); */