Edit Mesh Mode: Put AntiAliasing #define into shader include header.
authorClément Foucault <foucault.clem@gmail.com>
Fri, 22 Sep 2017 00:44:15 +0000 (02:44 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 22 Sep 2017 00:44:40 +0000 (02:44 +0200)
source/blender/draw/modes/edit_mesh_mode.c
source/blender/draw/modes/shaders/edit_mesh_overlay_frag.glsl

index c723d6e2d2d9a84877f7c65023e568900532c449..82fc89be098bf9b5b07c08b94d2b6a9f4a3a9bc9 100644 (file)
@@ -154,6 +154,7 @@ static void EDIT_MESH_engine_init(void *vedata)
                        datatoc_edit_mesh_overlay_frag_glsl,
                        datatoc_common_globals_lib_glsl,
                        "#define EDGE_FIX\n"
+                       "#define ANTI_ALIASING\n"
                        "#define VERTEX_FACING");
        }
        if (!e_data.overlay_tri_fast_sh) {
@@ -162,6 +163,7 @@ static void EDIT_MESH_engine_init(void *vedata)
                        datatoc_edit_mesh_overlay_geom_tri_glsl,
                        datatoc_edit_mesh_overlay_frag_glsl,
                        datatoc_common_globals_lib_glsl,
+                       "#define ANTI_ALIASING"
                        "#define VERTEX_FACING");
        }
        if (!e_data.overlay_tri_vcol_sh) {
@@ -172,6 +174,7 @@ static void EDIT_MESH_engine_init(void *vedata)
                        datatoc_common_globals_lib_glsl,
                        "#define EDGE_FIX\n"
                        "#define VERTEX_SELECTION\n"
+                       "#define ANTI_ALIASING\n"
                        "#define VERTEX_FACING");
        }
        if (!e_data.overlay_tri_vcol_fast_sh) {
@@ -181,6 +184,7 @@ static void EDIT_MESH_engine_init(void *vedata)
                        datatoc_edit_mesh_overlay_frag_glsl,
                        datatoc_common_globals_lib_glsl,
                        "#define VERTEX_SELECTION\n"
+                       "#define ANTI_ALIASING\n"
                        "#define VERTEX_FACING");
        }
        if (!e_data.overlay_edge_sh) {
@@ -189,6 +193,7 @@ static void EDIT_MESH_engine_init(void *vedata)
                        datatoc_edit_mesh_overlay_geom_edge_glsl,
                        datatoc_edit_mesh_overlay_frag_glsl,
                        datatoc_common_globals_lib_glsl,
+                       "#define ANTI_ALIASING"
                        "#define VERTEX_FACING");
        }
        if (!e_data.overlay_edge_vcol_sh) {
index d7f96695d0e76ea8909de2ff3dcf113674fccf4d..9df20ff7544e721a4046dc02fab86ba2cdf9cf85 100644 (file)
@@ -91,8 +91,6 @@ float distToEdge(vec2 o, vec2 dir)
        return sqrt(abs(dot(af, af) - daf * daf));
 }
 
-#define ANTI_ALIASING
-
 #ifdef ANTI_ALIASING
 void colorDistEdge(vec4 color, float dist)
 {