This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/modes/shaders/paint_vert_frag.glsl

27 lines
553 B
GLSL
Raw Normal View History

2017-05-06 01:34:16 +02:00
flat in int finalFlag;
2017-05-06 01:34:16 +02:00
out vec4 fragColor;
#define VERTEX_SELECTED (1 << 0)
#define VERTEX_HIDE (1 << 4)
2017-05-06 01:34:16 +02:00
void main()
{
if (bool(finalFlag & VERTEX_HIDE)) {
discard;
}
2017-05-06 01:34:16 +02:00
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);
2017-05-06 01:34:16 +02:00
// round point with jaggy edges
if (dist_squared > rad_squared) {
2017-05-06 01:34:16 +02:00
discard;
}
2017-05-06 01:34:16 +02:00
fragColor = bool(finalFlag & VERTEX_SELECTED) ? colSel : colUnsel;
2017-05-06 01:34:16 +02:00
}