diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index 46ebe3070ef..11e3a8e4fd9 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -411,6 +411,7 @@ class USERPREF_PT_system(bpy.types.Panel): col.prop(system, "clip_alpha", slider=True) col.prop(system, "use_mipmaps") col.prop(system, "use_vbos") + col.prop(system, "use_antialiasing") col.label(text="Window Draw Method:") col.row().prop(system, "window_draw_method", expand=True) col.label(text="Textures:") diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index bd196718c50..93eaace3cef 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2040,6 +2040,10 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) 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); @@ -2222,6 +2226,10 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) /* 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); } diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index a6be7256170..cc33d556726 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -468,6 +468,7 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_DISABLE_SOUND 2 #define USER_DISABLE_MIPMAP 4 #define USER_DISABLE_VBO 8 +#define USER_DISABLE_AA 16 /* wm draw method */ #define USER_DRAW_TRIPLE 0 diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 9b314afeb08..c2871298dbd 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2212,6 +2212,10 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO); RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or Vertex Arrays, if unsupported) for viewport rendering."); + prop= RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_AA); + RNA_def_property_ui_text(prop, "Anti-aliasing", "Use anti-aliasing for the 3D view (may impact redraw performance)"); + prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "glreslimit"); RNA_def_property_enum_items(prop, gl_texture_clamp_items); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 0e1d7969daf..61e6063329a 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -313,7 +313,7 @@ static void wm_window_add_ghostwindow(wmWindowManager *wm, char *title, wmWindow inital_state, GHOST_kDrawingContextTypeOpenGL, 0 /* no stereo */, - 0 /* no AA */); + 4 /* 4x AA */); if (ghostwin) {