diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-06-09 19:45:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-06-09 19:45:46 +0400 |
commit | f39758cddca1d6eeec299e8cd3eef9a2a1852e32 (patch) | |
tree | f0fea31777404174be524ab6feca2f30ec05bf99 /source/blender/src/drawmesh.c | |
parent | 610b877f60083ef064058efc7011a5b35c5e96b7 (diff) |
adding clip alpha (binary alpha) to the 3D view and game engine.
Diffstat (limited to 'source/blender/src/drawmesh.c')
-rw-r--r-- | source/blender/src/drawmesh.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c index b72cd3f56f8..dd512595ebc 100644 --- a/source/blender/src/drawmesh.c +++ b/source/blender/src/drawmesh.c @@ -228,13 +228,14 @@ int set_tpage(MTFace *tface) alphamode= tface->transp; if(alphamode) { - glEnable(GL_BLEND); - if(alphamode==TF_ADD) { + glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE); + glDisable ( GL_ALPHA_TEST ); /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ } else if(alphamode==TF_ALPHA) { + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); /* added after 2.45 to clip alpha */ @@ -245,9 +246,12 @@ int set_tpage(MTFace *tface) glEnable ( GL_ALPHA_TEST ); glAlphaFunc ( GL_GREATER, U.glalphaclip ); } - - /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ + } else if (alphamode==TF_CLIP){ + glDisable(GL_BLEND); + glEnable ( GL_ALPHA_TEST ); + glAlphaFunc(GL_GREATER, 0.5f); } + /* glBlendEquationEXT(GL_FUNC_ADD_EXT); */ /* else { */ /* glBlendFunc(GL_ONE, GL_ONE); */ /* glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); */ |