[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12282] trunk/blender/source/blender/src/ drawmesh.c: Use GL_ALPHA_TEST when drawing alpha faces in the 3d view, as suggested by Eskil, some scenes are unusable without this.

Campbell Barton cbarton at metavr.com
Thu Oct 18 15:51:10 CEST 2007


Revision: 12282
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12282
Author:   campbellbarton
Date:     2007-10-18 15:51:10 +0200 (Thu, 18 Oct 2007)

Log Message:
-----------
Use GL_ALPHA_TEST when drawing alpha faces in the 3d view, as suggested by Eskil, some scenes are unusable without this.
at the moment it wont draw totally transperent pixels, this may need to be adjusted or made into a preference.

Modified Paths:
--------------
    trunk/blender/source/blender/src/drawmesh.c

Modified: trunk/blender/source/blender/src/drawmesh.c
===================================================================
--- trunk/blender/source/blender/src/drawmesh.c	2007-10-18 13:07:21 UTC (rev 12281)
+++ trunk/blender/source/blender/src/drawmesh.c	2007-10-18 13:51:10 UTC (rev 12282)
@@ -239,14 +239,22 @@
 			}
 			else if(alphamode==TF_ALPHA) {
 				glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+				
+				/* added after 2.45 to clip alpha */
+				glEnable ( GL_ALPHA_TEST );
+				glAlphaFunc ( GL_GREATER, 0.001 );
+				
+				
 			/* 	glBlendEquationEXT(GL_FUNC_ADD_EXT); */
 			}
 			/* else { */
 			/* 	glBlendFunc(GL_ONE, GL_ONE); */
 			/* 	glBlendEquationEXT(GL_FUNC_REVERSE_SUBTRACT_EXT); */
 			/* } */
+		} else {
+			glDisable(GL_BLEND);
+			glDisable ( GL_ALPHA_TEST );
 		}
-		else glDisable(GL_BLEND);
 	}
 
 	ima= tface->tpage;





More information about the Bf-blender-cvs mailing list