diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-17 11:09:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-17 11:09:40 +0300 |
commit | fabd55a5e9e9afc9975d44a1dc7c22531c2089eb (patch) | |
tree | 512b85dc5f70be96b73be783fa0ddb02497ffb37 /source/blender/draw/modes/shaders | |
parent | c18c3ff3d568937ff8f49844116e4babf4be2868 (diff) |
DWM: hide hidden verts in weight-paint mode
Diffstat (limited to 'source/blender/draw/modes/shaders')
-rw-r--r-- | source/blender/draw/modes/shaders/paint_vert_frag.glsl | 14 | ||||
-rw-r--r-- | source/blender/draw/modes/shaders/paint_wire_vert.glsl | 7 |
2 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/draw/modes/shaders/paint_vert_frag.glsl b/source/blender/draw/modes/shaders/paint_vert_frag.glsl index c6eb334711f..c22e1c04b96 100644 --- a/source/blender/draw/modes/shaders/paint_vert_frag.glsl +++ b/source/blender/draw/modes/shaders/paint_vert_frag.glsl @@ -1,9 +1,16 @@ -flat in int finalSelect; +flat in int finalFlag; out vec4 fragColor; +#define VERTEX_SELECTED (1 << 0) +#define VERTEX_HIDE (1 << 4) + void main() { + if (bool(finalFlag & VERTEX_HIDE)) { + discard; + } + vec2 centered = gl_PointCoord - vec2(0.5); float dist_squared = dot(centered, centered); const float rad_squared = 0.25; @@ -11,8 +18,9 @@ void main() const vec4 colUnsel = vec4(0.5, 0.5, 0.5, 1.0); // round point with jaggy edges - if (dist_squared > rad_squared) + if (dist_squared > rad_squared) { discard; + } - fragColor = bool(finalSelect) ? colSel : colUnsel; + fragColor = bool(finalFlag & VERTEX_SELECTED) ? colSel : colUnsel; } diff --git a/source/blender/draw/modes/shaders/paint_wire_vert.glsl b/source/blender/draw/modes/shaders/paint_wire_vert.glsl index 1f404d33c88..253c21745e2 100644 --- a/source/blender/draw/modes/shaders/paint_wire_vert.glsl +++ b/source/blender/draw/modes/shaders/paint_wire_vert.glsl @@ -2,12 +2,13 @@ uniform mat4 ModelViewProjectionMatrix; in vec3 pos; -in int select; +in int data; -flat out int finalSelect; +flat out int finalFlag; void main() { gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); - finalSelect = select; + + finalFlag = data; } |