diff options
author | Luca Rood <dev@lucarood.com> | 2017-05-06 02:34:16 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2017-05-06 02:34:43 +0300 |
commit | 317544455e0443b34056d88bd1d643f7a90eb99d (patch) | |
tree | 13a10198ffb4afd9bb8c2a3c1434004bfe91e779 /source/blender/draw/modes/shaders | |
parent | cffe15e9c9ead5dfe0c01deac8d7cc292fce95ef (diff) |
Add missing weight paint vertex shader
Diffstat (limited to 'source/blender/draw/modes/shaders')
-rw-r--r-- | source/blender/draw/modes/shaders/paint_vert_frag.glsl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/paint_vert_frag.glsl b/source/blender/draw/modes/shaders/paint_vert_frag.glsl new file mode 100644 index 00000000000..c6eb334711f --- /dev/null +++ b/source/blender/draw/modes/shaders/paint_vert_frag.glsl @@ -0,0 +1,18 @@ + +flat in int finalSelect; +out vec4 fragColor; + +void main() +{ + 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.5, 0.5, 0.5, 1.0); + + // round point with jaggy edges + if (dist_squared > rad_squared) + discard; + + fragColor = bool(finalSelect) ? colSel : colUnsel; +} |