[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25830] trunk/blender/source/blender: FSAA : properly disable it for first window draw, remove obsolete backbuffer

Brecht Van Lommel brecht at blender.org
Fri Jan 8 10:30:36 CET 2010


Revision: 25830
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25830
Author:   blendix
Date:     2010-01-08 10:30:36 +0100 (Fri, 08 Jan 2010)

Log Message:
-----------
FSAA: properly disable it for first window draw, remove obsolete backbuffer
disable code, and only enable it for 3d drawing in the 3d view.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
    trunk/blender/source/blender/gpu/intern/gpu_draw.c

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2010-01-08 08:54:41 UTC (rev 25829)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_draw.c	2010-01-08 09:30:36 UTC (rev 25830)
@@ -1096,16 +1096,6 @@
 	struct Base *base = scene->basact;
 	rcti winrct;
 
-/*for 2.43 release, don't use glext and just define the constant.
-  this to avoid possibly breaking platforms before release.*/
-#ifndef GL_MULTISAMPLE_ARB
-	#define GL_MULTISAMPLE_ARB	0x809D
-#endif
-
-#ifdef GL_MULTISAMPLE_ARB
-	int m;
-#endif
-
 	if(base && (base->object->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT) ||
 		     paint_facesel_test(base->object)));
 	else if((base && (base->object->mode & OB_MODE_TEXTURE_PAINT)) &&
@@ -1126,16 +1116,6 @@
 //		}
 //	}
 
-	/* Disable FSAA for backbuffer selection.  
-	
-	Only works if GL_MULTISAMPLE_ARB is defined by the header
-	file, which is should be for every OS that supports FSAA.*/
-
-#ifdef GL_MULTISAMPLE_ARB
-	m = glIsEnabled(GL_MULTISAMPLE_ARB);
-	if (m) glDisable(GL_MULTISAMPLE_ARB);
-#endif
-
 	if(v3d->drawtype > OB_WIRE) v3d->zbuf= TRUE;
 	
 	glDisable(GL_DITHER);
@@ -1172,10 +1152,6 @@
 	if(rv3d->rflag & RV3D_CLIPPING)
 		view3d_clr_clipping();
 
-#ifdef GL_MULTISAMPLE_ARB
-	if (m) glEnable(GL_MULTISAMPLE_ARB);
-#endif
-
 	/* it is important to end a view in a transform compatible with buttons */
 //	persp(PERSP_WIN);  // set ortho
 
@@ -2040,10 +2016,6 @@
 	Object *obact = OBACT;
 	char *grid_unit= NULL;
 	
-	/* enables anti-aliasing for 3D view drawing */
-	if (!(U.gameflags & USER_DISABLE_AA))
-		glEnable(GL_MULTISAMPLE_ARB);
-	
 	/* from now on all object derived meshes check this */
 	v3d->customdata_mask= get_viewedit_datamask(CTX_wm_screen(C), scene, obact);
 	
@@ -2069,6 +2041,10 @@
 	}
 	else
 		v3d->zbuf= FALSE;
+
+	/* enables anti-aliasing for 3D view drawing */
+	if (!(U.gameflags & USER_DISABLE_AA))
+		glEnable(GL_MULTISAMPLE_ARB);
 	
 	// needs to be done always, gridview is adjusted in drawgrid() now
 	rv3d->gridview= v3d->grid;
@@ -2176,6 +2152,10 @@
 	
 	BIF_draw_manipulator(C);
 	
+	/* Disable back anti-aliasing */
+	if (!(U.gameflags & USER_DISABLE_AA))
+		glDisable(GL_MULTISAMPLE_ARB);
+
 	if(v3d->zbuf) {
 		v3d->zbuf= FALSE;
 		glDisable(GL_DEPTH_TEST);
@@ -2226,10 +2206,6 @@
 	/* XXX here was the blockhandlers for floating panels */
 
 	v3d->flag |= V3D_INVALID_BACKBUF;
-	
-	/* Disable back anti-aliasing */
-	if (!(U.gameflags & USER_DISABLE_AA))
-		glDisable(GL_MULTISAMPLE_ARB);
 }
 
 

Modified: trunk/blender/source/blender/gpu/intern/gpu_draw.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_draw.c	2010-01-08 08:54:41 UTC (rev 25829)
+++ trunk/blender/source/blender/gpu/intern/gpu_draw.c	2010-01-08 09:30:36 UTC (rev 25830)
@@ -1313,6 +1313,8 @@
 	glFrontFace(GL_CCW);
 	glCullFace(GL_BACK);
 	glDisable(GL_CULL_FACE);
+
+	glDisable(GL_MULTISAMPLE_ARB);
 }
 
 /* debugging aid */





More information about the Bf-blender-cvs mailing list