diff options
Diffstat (limited to 'source/blender/draw/modes/shaders/edit_mesh_overlay_common_lib.glsl')
-rw-r--r-- | source/blender/draw/modes/shaders/edit_mesh_overlay_common_lib.glsl | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/source/blender/draw/modes/shaders/edit_mesh_overlay_common_lib.glsl b/source/blender/draw/modes/shaders/edit_mesh_overlay_common_lib.glsl index ffabfd3fcee..50e9c3677f9 100644 --- a/source/blender/draw/modes/shaders/edit_mesh_overlay_common_lib.glsl +++ b/source/blender/draw/modes/shaders/edit_mesh_overlay_common_lib.glsl @@ -1,5 +1,7 @@ uniform bool doEdges = true; +uniform bool selectFaces = true; +uniform bool selectEdges = true; vec4 EDIT_MESH_edge_color_outer(int edge_flag, int face_flag, float crease, float bweight) { @@ -15,8 +17,8 @@ vec4 EDIT_MESH_edge_color_outer(int edge_flag, int face_flag, float crease, floa vec4 EDIT_MESH_edge_color_inner(int edge_flag) { vec4 color = colorWireEdit; - color = ((edge_flag & EDGE_SELECTED) != 0) ? colorEdgeSelect : color; - color = ((edge_flag & EDGE_ACTIVE) != 0) ? colorEditMeshActive : color; + color = (doEdges && ((edge_flag & EDGE_SELECTED) != 0)) ? colorEdgeSelect : color; + color = (doEdges && ((edge_flag & EDGE_ACTIVE) != 0)) ? colorEditMeshActive : color; return color; } @@ -43,18 +45,15 @@ vec4 EDIT_MESH_vertex_color(int vertex_flag) vec4 EDIT_MESH_face_color(int face_flag) { - if ((face_flag & FACE_ACTIVE) != 0) { - return mix(colorFaceSelect, colorEditMeshActive, 0.5); - } - else if ((face_flag & FACE_SELECTED) != 0) { - return colorFaceSelect; - } - else if ((face_flag & FACE_FREESTYLE) != 0) { - return colorFaceFreestyle; - } - else { - return colorFace; - } + vec4 color = colorFace; + color = ((face_flag & FACE_FREESTYLE) != 0) ? colorFaceFreestyle : color; + color = ((face_flag & FACE_SELECTED) != 0) ? colorFaceSelect : color; + color = ((face_flag & FACE_ACTIVE) != 0) ? mix(colorFaceSelect, colorEditMeshActive, 0.5) : + color; + color.a *= ((face_flag & (FACE_FREESTYLE | FACE_SELECTED | FACE_ACTIVE)) == 0 || selectFaces) ? + 1.0 : + 0.5; + return color; } vec4 EDIT_MESH_facedot_color(float facedot_flag) |