This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/draw/modes/shaders/paint_vert_frag.glsl
Campbell Barton 46fc3f39c5 Weight Paint: use black for unselected vertices
Contrast for selected vertices mode wasn't very strong.
2018-08-29 12:22:33 +10:00

27 lines
553 B
GLSL

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;
const vec4 colSel = vec4(1.0, 1.0, 1.0, 1.0);
const vec4 colUnsel = vec4(0.0, 0.0, 0.0, 1.0);
// round point with jaggy edges
if (dist_squared > rad_squared) {
discard;
}
fragColor = bool(finalFlag & VERTEX_SELECTED) ? colSel : colUnsel;
}