Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2022-01-06 15:42:45 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2022-01-06 16:43:18 +0300
commit1785286ecc908366f1c2935cfdc5287571563628 (patch)
tree8c4804e34a49458bed589a8e92fe8f74ed9017c3 /source/blender/draw/engines/overlay/shaders/armature_wire_frag.glsl
parent7bcf21e66e2e46042b027b4481fa9866e64fe9a1 (diff)
Bone Overlay: support changing bone wireframe opacity.
When weight painting the bone overlay is extremely intrusive, effectively requiring either extensive use of hiding individual bones, or disabling the whole bone overlay between selections. This addresses the issue by adding a bone opacity slider that is used for the 'wireframe' armature drawing mode. It directly controls the uniform opacity as a straightforward option. Differential Revision: https://developer.blender.org/D11804
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders/armature_wire_frag.glsl')
-rw-r--r--source/blender/draw/engines/overlay/shaders/armature_wire_frag.glsl4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/armature_wire_frag.glsl b/source/blender/draw/engines/overlay/shaders/armature_wire_frag.glsl
index 9413ac0f365..55278515f74 100644
--- a/source/blender/draw/engines/overlay/shaders/armature_wire_frag.glsl
+++ b/source/blender/draw/engines/overlay/shaders/armature_wire_frag.glsl
@@ -1,4 +1,6 @@
+uniform float alpha = 1.0;
+
flat in vec4 finalColor;
flat in vec2 edgeStart;
noperspective in vec2 edgePos;
@@ -9,5 +11,5 @@ layout(location = 1) out vec4 lineOutput;
void main()
{
lineOutput = pack_line_data(gl_FragCoord.xy, edgeStart, edgePos);
- fragColor = finalColor;
+ fragColor = vec4(finalColor.rgb, finalColor.a * alpha);
}