[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15173] branches/apricot: svn merge -r15165:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/ blender/

Campbell Barton ideasman42 at gmail.com
Mon Jun 9 17:55:06 CEST 2008


Revision: 15173
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15173
Author:   campbellbarton
Date:     2008-06-09 17:55:04 +0200 (Mon, 09 Jun 2008)

Log Message:
-----------
svn  merge  -r15165:HEAD https://svn.blender.org/svnroot/bf-blender/trunk/blender/

Modified Paths:
--------------
    branches/apricot/extern/bFTGL/SConscript
    branches/apricot/source/blender/makesdna/DNA_meshdata_types.h
    branches/apricot/source/blender/src/buttons_editing.c
    branches/apricot/source/blender/src/drawmesh.c
    branches/apricot/source/blender/src/space.c
    branches/apricot/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
    branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp

Modified: branches/apricot/extern/bFTGL/SConscript
===================================================================
--- branches/apricot/extern/bFTGL/SConscript	2008-06-09 15:45:46 UTC (rev 15172)
+++ branches/apricot/extern/bFTGL/SConscript	2008-06-09 15:55:04 UTC (rev 15173)
@@ -22,7 +22,7 @@
 
 #ftgl_env.Append (CPPDEFINES = defines)
 
-incs = 'include src ' + env['BF_FREETYPE_INC']
+incs = 'include src ' + env['BF_FREETYPE_INC'] + ' ' + env['BF_OPENGL_INC']
 defs = ''
 
 sources = env.Glob('src/*.cpp')

Modified: branches/apricot/source/blender/makesdna/DNA_meshdata_types.h
===================================================================
--- branches/apricot/source/blender/makesdna/DNA_meshdata_types.h	2008-06-09 15:45:46 UTC (rev 15172)
+++ branches/apricot/source/blender/makesdna/DNA_meshdata_types.h	2008-06-09 15:55:04 UTC (rev 15173)
@@ -229,14 +229,16 @@
 #define TF_SHADOW		8192
 #define TF_BMFONT		16384
 
-/* mtface->transp */
+/* mtface->transp, values 1-4 are used as flags in the GL, WARNING, TF_SUB cant work with this */
 #define TF_SOLID	0
 #define TF_ADD		1
 #define TF_ALPHA	2
+#define TF_CLIP		4 /* clipmap alpha/binary alpha all or nothing! */
 
 /* sub is not available in the user interface anymore */
 #define TF_SUB		3
 
+
 /* mtface->unwrap */
 #define TF_DEPRECATED1	1
 #define TF_DEPRECATED2	2

Modified: branches/apricot/source/blender/src/buttons_editing.c
===================================================================
--- branches/apricot/source/blender/src/buttons_editing.c	2008-06-09 15:45:46 UTC (rev 15172)
+++ branches/apricot/source/blender/src/buttons_editing.c	2008-06-09 15:55:04 UTC (rev 15173)
@@ -6235,6 +6235,7 @@
 		uiDefButC(block, ROW, REDRAWVIEW3D, "Opaque",	600,80,60,19, &tf->transp, 2.0, (float)TF_SOLID,0, 0, "Render color of textured face as color");
 		uiDefButC(block, ROW, REDRAWVIEW3D, "Add",		660,80,60,19, &tf->transp, 2.0, (float)TF_ADD,	0, 0, "Render face transparent and add color of face");
 		uiDefButC(block, ROW, REDRAWVIEW3D, "Alpha",	720,80,60,19, &tf->transp, 2.0, (float)TF_ALPHA,0, 0, "Render polygon transparent, depending on alpha channel of the texture");
+		uiDefButC(block, ROW, REDRAWVIEW3D, "Clip Alpha",	780,80,80,19, &tf->transp, 2.0, (float)TF_CLIP,0, 0, "Use the images alpha values clipped with no blending (binary alpha)");
 	}
 	else
 		uiDefBut(block,LABEL,B_NOP, "(No Active Face)", 10,200,150,19,0,0,0,0,0,"");

Modified: branches/apricot/source/blender/src/drawmesh.c
===================================================================
--- branches/apricot/source/blender/src/drawmesh.c	2008-06-09 15:45:46 UTC (rev 15172)
+++ branches/apricot/source/blender/src/drawmesh.c	2008-06-09 15:55:04 UTC (rev 15173)
@@ -230,13 +230,14 @@
 		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 */
@@ -247,9 +248,12 @@
 					glEnable ( GL_ALPHA_TEST );
 					glAlphaFunc ( GL_GREATER, U.glalphaclip );
 				}
-				
+			} 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); */

Modified: branches/apricot/source/blender/src/space.c
===================================================================
--- branches/apricot/source/blender/src/space.c	2008-06-09 15:45:46 UTC (rev 15172)
+++ branches/apricot/source/blender/src/space.c	2008-06-09 15:55:04 UTC (rev 15173)
@@ -2981,8 +2981,11 @@
 				do_ipo_selectbuttons();
 				doredraw= 1;
 			}
+			else if(G.qual == LR_CTRLKEY) {
+				if (sipo->showkey==0)
+					add_vert_ipo();
+			}
 			else if(view2dmove(LEFTMOUSE));	/* only checks for sliders */
-			else if((G.qual & LR_CTRLKEY) && (sipo->showkey==0)) add_vert_ipo();
 			else {
 				do {
 					getmouseco_areawin(mval);

Modified: branches/apricot/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp
===================================================================
--- branches/apricot/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp	2008-06-09 15:45:46 UTC (rev 15172)
+++ branches/apricot/source/gameengine/GamePlayer/common/GPC_PolygonMaterial.cpp	2008-06-09 15:55:04 UTC (rev 15173)
@@ -154,16 +154,23 @@
 		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); */

Modified: branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
===================================================================
--- branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp	2008-06-09 15:45:46 UTC (rev 15172)
+++ branches/apricot/source/gameengine/Ketsji/KX_BlenderMaterial.cpp	2008-06-09 15:55:04 UTC (rev 15173)
@@ -478,16 +478,23 @@
 	if( mMaterial->transp &TF_ADD) {
 		glEnable(GL_BLEND);
 		glBlendFunc(GL_ONE, GL_ONE);
+		glDisable ( GL_ALPHA_TEST );
 		return true;
 	}
 	
 	if( mMaterial->transp & TF_ALPHA ) {
 		glEnable(GL_BLEND);
 		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+		glDisable ( GL_ALPHA_TEST );
 		return true;
 	}
 	
-	glDisable(GL_BLEND);
+	if( mMaterial->transp & TF_CLIP ) {
+		glDisable(GL_BLEND); 
+		glEnable ( GL_ALPHA_TEST );
+		glAlphaFunc(GL_GREATER, 0.5f);
+		return true;
+	}
 	return false;
 }
 





More information about the Bf-blender-cvs mailing list