diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-09-22 03:42:57 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-09-22 03:44:40 +0300 |
commit | 1a4a1447b728082939e7b0f033602f27c0269937 (patch) | |
tree | 9060d9ff3762a5bd9709dca267c458c8fd8222d9 /source/blender/draw/modes/edit_mesh_mode.c | |
parent | 406427bd4eac038491e69156a1b344d21a5289fd (diff) |
Edit Mesh Mode: Add a facing falloff effect
This let the user keep track of the shape by fading the center of the object.
An Opacity parameter is yet to be added.
Diffstat (limited to 'source/blender/draw/modes/edit_mesh_mode.c')
-rw-r--r-- | source/blender/draw/modes/edit_mesh_mode.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/draw/modes/edit_mesh_mode.c b/source/blender/draw/modes/edit_mesh_mode.c index c06a2976ac7..c723d6e2d2d 100644 --- a/source/blender/draw/modes/edit_mesh_mode.c +++ b/source/blender/draw/modes/edit_mesh_mode.c @@ -152,14 +152,17 @@ static void EDIT_MESH_engine_init(void *vedata) datatoc_edit_mesh_overlay_vert_glsl, datatoc_edit_mesh_overlay_geom_tri_glsl, datatoc_edit_mesh_overlay_frag_glsl, - datatoc_common_globals_lib_glsl, "#define EDGE_FIX\n"); + datatoc_common_globals_lib_glsl, + "#define EDGE_FIX\n" + "#define VERTEX_FACING"); } if (!e_data.overlay_tri_fast_sh) { e_data.overlay_tri_fast_sh = DRW_shader_create_with_lib( datatoc_edit_mesh_overlay_vert_glsl, datatoc_edit_mesh_overlay_geom_tri_glsl, datatoc_edit_mesh_overlay_frag_glsl, - datatoc_common_globals_lib_glsl, NULL); + datatoc_common_globals_lib_glsl, + "#define VERTEX_FACING"); } if (!e_data.overlay_tri_vcol_sh) { e_data.overlay_tri_vcol_sh = DRW_shader_create_with_lib( @@ -168,7 +171,8 @@ static void EDIT_MESH_engine_init(void *vedata) datatoc_edit_mesh_overlay_frag_glsl, datatoc_common_globals_lib_glsl, "#define EDGE_FIX\n" - "#define VERTEX_SELECTION\n"); + "#define VERTEX_SELECTION\n" + "#define VERTEX_FACING"); } if (!e_data.overlay_tri_vcol_fast_sh) { e_data.overlay_tri_vcol_fast_sh = DRW_shader_create_with_lib( @@ -176,14 +180,16 @@ 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 VERTEX_SELECTION\n"); + "#define VERTEX_SELECTION\n" + "#define VERTEX_FACING"); } if (!e_data.overlay_edge_sh) { e_data.overlay_edge_sh = DRW_shader_create_with_lib( datatoc_edit_mesh_overlay_vert_glsl, datatoc_edit_mesh_overlay_geom_edge_glsl, datatoc_edit_mesh_overlay_frag_glsl, - datatoc_common_globals_lib_glsl, NULL); + datatoc_common_globals_lib_glsl, + "#define VERTEX_FACING"); } if (!e_data.overlay_edge_vcol_sh) { e_data.overlay_edge_vcol_sh = DRW_shader_create_with_lib( @@ -191,20 +197,23 @@ 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 VERTEX_SELECTION\n"); + "#define VERTEX_SELECTION\n" + "#define VERTEX_FACING"); } if (!e_data.overlay_vert_sh) { e_data.overlay_vert_sh = DRW_shader_create_with_lib( datatoc_edit_mesh_overlay_loosevert_vert_glsl, NULL, datatoc_edit_mesh_overlay_frag_glsl, datatoc_common_globals_lib_glsl, - "#define VERTEX_SELECTION\n"); + "#define VERTEX_SELECTION\n" + "#define VERTEX_FACING"); } if (!e_data.overlay_facedot_sh) { e_data.overlay_facedot_sh = DRW_shader_create_with_lib( datatoc_edit_mesh_overlay_facedot_vert_glsl, NULL, datatoc_edit_mesh_overlay_facedot_frag_glsl, - datatoc_common_globals_lib_glsl, NULL); + datatoc_common_globals_lib_glsl, + "#define VERTEX_FACING"); } if (!e_data.overlay_mix_sh) { e_data.overlay_mix_sh = DRW_shader_create_fullscreen(datatoc_edit_mesh_overlay_mix_frag_glsl, NULL); |