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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-09-25 19:19:59 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-09-27 17:33:33 +0300
commit3da46a8d8df26d6fe5b9289ae7ebfe01f1deeda8 (patch)
treee752806eb0db2c61f4592435a1173439ef534cbb /source/blender/draw/modes/shaders/paint_weight_vert.glsl
parent6791d95b1db8a2419b9534e95ea7c73c1cb4ff62 (diff)
Implement a new dedicated weight painting shader.
Move the weight paint drawing to the fragment shader. The shader uses a texture that uses the U.coba_weight custom color band, or an internal color band. In addition to actual weights, the shader has to display two alert colors: missing vertex group, and zero weight. The zero weight alert has to be blended with regular weight colors, so that a single alert vertex surrounded by weighted ones is still visible. Reviewers: campbellbarton, fclem Differential Revision: https://developer.blender.org/D3675
Diffstat (limited to 'source/blender/draw/modes/shaders/paint_weight_vert.glsl')
-rw-r--r--source/blender/draw/modes/shaders/paint_weight_vert.glsl15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/paint_weight_vert.glsl b/source/blender/draw/modes/shaders/paint_weight_vert.glsl
new file mode 100644
index 00000000000..78a3695c82c
--- /dev/null
+++ b/source/blender/draw/modes/shaders/paint_weight_vert.glsl
@@ -0,0 +1,15 @@
+
+uniform mat4 ModelViewProjectionMatrix;
+
+in float weight;
+in vec3 pos;
+
+out vec2 weight_interp; /* (weight, alert) */
+
+void main()
+{
+ gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
+
+ /* Separate actual weight and alerts for independent interpolation */
+ weight_interp = max(vec2(weight, -weight), 0.0);
+}