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:
authorClément Foucault <foucault.clem@gmail.com>2018-05-05 21:51:16 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-05-05 22:04:21 +0300
commit817cf2a317388b8bfc29ddf27a49b0628eb8e1ab (patch)
treeba91e9fbe5ed957d05634de1f0df514d2b4d91ad /source/blender/draw/modes/shaders/armature_envelope_solid_frag.glsl
parentb2188d631a81972f38548a333757eb21ddd784b0 (diff)
Armature: Rename bone shaders and add 2 colors smooth blending.
This will enable us to do more nice stuff in future commits. This commit is a temporary commit, it will compile but will crash if trying to display any armature. Next commit does work.
Diffstat (limited to 'source/blender/draw/modes/shaders/armature_envelope_solid_frag.glsl')
-rw-r--r--source/blender/draw/modes/shaders/armature_envelope_solid_frag.glsl16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/armature_envelope_solid_frag.glsl b/source/blender/draw/modes/shaders/armature_envelope_solid_frag.glsl
new file mode 100644
index 00000000000..3e6ad48700e
--- /dev/null
+++ b/source/blender/draw/modes/shaders/armature_envelope_solid_frag.glsl
@@ -0,0 +1,16 @@
+
+flat in vec3 finalStateColor;
+flat in vec3 finalBoneColor;
+in vec3 normalView;
+
+out vec4 fragColor;
+
+void main()
+{
+ /* Smooth lighting factor. */
+ const float s = 0.2; /* [0.0-0.5] range */
+ float n = normalize(normalView).z;
+ float fac = clamp((n * (1.0 - s)) + s, 0.0, 1.0);
+ fragColor.rgb = mix(finalStateColor, finalBoneColor, fac);
+ fragColor.a = 1.0;
+}