[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12309] trunk/blender/source/blender: added an option to adjust the alpha clipping value in the oprnGL preferenes .

Campbell Barton cbarton at metavr.com
Sat Oct 20 20:01:57 CEST 2007


Revision: 12309
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12309
Author:   campbellbarton
Date:     2007-10-20 20:01:57 +0200 (Sat, 20 Oct 2007)

Log Message:
-----------
added an option to adjust the alpha clipping value in the oprnGL preferenes. in some cases you might 
want to use 0.5 to see through more of the texture. (less halo's with clipmaps), defailt is 0.0 so it 
will only clip 0 alpha.

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/src/drawmesh.c
    trunk/blender/source/blender/src/space.c

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2007-10-20 16:58:48 UTC (rev 12308)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2007-10-20 18:01:57 UTC (rev 12309)
@@ -182,6 +182,7 @@
 	short recent_files;		/* maximum number of recently used files to remember  */
 	short smooth_viewtx;	/* miliseconds to spend spinning the view */
 	short glreslimit;
+	float glalphaclip;
 } UserDef;
 
 extern UserDef U; /* from usiblender.c !!!! */

Modified: trunk/blender/source/blender/src/drawmesh.c
===================================================================
--- trunk/blender/source/blender/src/drawmesh.c	2007-10-20 16:58:48 UTC (rev 12308)
+++ trunk/blender/source/blender/src/drawmesh.c	2007-10-20 18:01:57 UTC (rev 12309)
@@ -242,7 +242,7 @@
 				
 				/* added after 2.45 to clip alpha */
 				glEnable ( GL_ALPHA_TEST );
-				glAlphaFunc ( GL_GREATER, 0.001 );
+				glAlphaFunc ( GL_GREATER, U.glalphaclip );
 				
 				
 			/* 	glBlendEquationEXT(GL_FUNC_ADD_EXT); */
@@ -960,7 +960,7 @@
 	Gtexdraw.istex = istex;
 	memcpy(Gtexdraw.obcol, obcol, sizeof(obcol));
 	set_draw_settings_cached(1, 0, 0, Gtexdraw.islit, 0, 0, 0);
-
+	glDisable ( GL_ALPHA_TEST );
 	glShadeModel(GL_SMOOTH);
 }
 

Modified: trunk/blender/source/blender/src/space.c
===================================================================
--- trunk/blender/source/blender/src/space.c	2007-10-20 16:58:48 UTC (rev 12308)
+++ trunk/blender/source/blender/src/space.c	2007-10-20 18:01:57 UTC (rev 12309)
@@ -3865,8 +3865,13 @@
 			&(U.uiflag), 0, 0, 0, 0, "Hide files/datablocks that start with a dot(.*)");
 
 		uiDefBut(block, LABEL,0,"OpenGL:",
-			(xpos+edgsp+(5*midsp)+(5*mpref)),y6label,mpref,buth,
+			(xpos+edgsp+(5*midsp)+(5*mpref)),y7label,mpref,buth,
 			0, 0, 0, 0, 0, "");
+		
+		uiDefButF(block, NUMSLI, B_DRAWINFO, "Clip Alpha: ",
+				  (xpos+edgsp+(5*mpref)+(5*midsp)),y6,mpref,buth,
+				   &(U.glalphaclip), 0.0, 1.0, 0, 0, "Clip alpha below this threshold in the 3d textured view");
+		
 		uiDefButBitI(block, TOGN, USER_DISABLE_MIPMAP, B_MIPMAPCHANGED, "Mipmaps",
 			(xpos+edgsp+(5*mpref)+(5*midsp)),y5,mpref,buth,
 			&(U.gameflags), 0, 0, 0, 0, "Toggles between mipmap textures on (beautiful) and off (fast)");





More information about the Bf-blender-cvs mailing list