Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-10-31 18:08:14 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-10-31 18:08:14 +0400
commit56421d869dd080c0c3e715736dbc6de6e03526e5 (patch)
tree02d2eaabcb0ab60c4b06c5d9f5dbaa283f25d327 /source
parenta664e779ac8be0f926221d4c064394f9b3b6a801 (diff)
Fix: selecting with z-buffer hiding did not work when graphics card settings
enabled antialiasing, overriding application settings. The fix for this got lost when the FSAA option was added and later disabled again. Added it back now, and also disable AA for UI widgets since it makes them look too blurry, they already do their own AA.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c11
2 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 5b27fe88b4b..a6316dc0e9e 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -962,6 +962,7 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
ARegion *ar;
uiBut *but;
rcti rect;
+ int multisample_enabled;
/* get menu region or area region */
ar= CTX_wm_menu(C);
@@ -971,6 +972,11 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
if(!block->endblock)
uiEndBlock(C, block);
+ /* disable AA, makes widgets too blurry */
+ multisample_enabled= glIsEnabled(GL_MULTISAMPLE_ARB);
+ if(multisample_enabled)
+ glDisable(GL_MULTISAMPLE_ARB);
+
/* we set this only once */
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -1015,6 +1021,9 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
+
+ if(multisample_enabled)
+ glEnable(GL_MULTISAMPLE_ARB);
ui_draw_links(block);
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 32e553262e2..6b5e7792e85 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1226,6 +1226,7 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
{
RegionView3D *rv3d= ar->regiondata;
struct Base *base = scene->basact;
+ int multisample_enabled;
rcti winrct;
BLI_assert(ar->regiontype == RGN_TYPE_WINDOW);
@@ -1252,8 +1253,13 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
if(v3d->drawtype > OB_WIRE) v3d->zbuf= TRUE;
+ /* dithering and AA break color coding, so disable */
glDisable(GL_DITHER);
+ multisample_enabled= glIsEnabled(GL_MULTISAMPLE_ARB);
+ if(multisample_enabled)
+ glDisable(GL_MULTISAMPLE_ARB);
+
region_scissor_winrct(ar, &winrct);
glScissor(winrct.xmin, winrct.ymin, winrct.xmax - winrct.xmin, winrct.ymax - winrct.ymin);
@@ -1272,9 +1278,8 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
G.f |= G_BACKBUFSEL;
- if(base && (base->lay & v3d->lay)) {
+ if(base && (base->lay & v3d->lay))
draw_object_backbufsel(scene, v3d, rv3d, base->object);
- }
v3d->flag &= ~V3D_INVALID_BACKBUF;
ar->swap= 0; /* mark invalid backbuf for wm draw */
@@ -1283,6 +1288,8 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
v3d->zbuf= FALSE;
glDisable(GL_DEPTH_TEST);
glEnable(GL_DITHER);
+ if(multisample_enabled)
+ glEnable(GL_MULTISAMPLE_ARB);
if(rv3d->rflag & RV3D_CLIPPING)
view3d_clr_clipping();