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:
Diffstat (limited to 'source/blender/draw/modes/shaders/armature_shape_solid_vert.glsl')
-rw-r--r--source/blender/draw/modes/shaders/armature_shape_solid_vert.glsl27
1 files changed, 13 insertions, 14 deletions
diff --git a/source/blender/draw/modes/shaders/armature_shape_solid_vert.glsl b/source/blender/draw/modes/shaders/armature_shape_solid_vert.glsl
index 8463ffab447..2df25bf0e03 100644
--- a/source/blender/draw/modes/shaders/armature_shape_solid_vert.glsl
+++ b/source/blender/draw/modes/shaders/armature_shape_solid_vert.glsl
@@ -19,24 +19,23 @@ out vec4 finalColor;
void main()
{
- mat3 NormalMatrix = transpose(inverse(mat3(ViewMatrix * InstanceModelMatrix)));
- vec3 normal = normalize(NormalMatrix * nor);
+ mat3 NormalMatrix = transpose(inverse(mat3(ViewMatrix * InstanceModelMatrix)));
+ vec3 normal = normalize(NormalMatrix * nor);
- /* Do lighting at an angle to avoid flat shading on front facing bone. */
- const vec3 light = vec3(0.1, 0.1, 0.8);
- float n = dot(normal, light);
+ /* Do lighting at an angle to avoid flat shading on front facing bone. */
+ const vec3 light = vec3(0.1, 0.1, 0.8);
+ float n = dot(normal, light);
- /* Smooth lighting factor. */
- const float s = 0.2; /* [0.0-0.5] range */
- float fac = clamp((n * (1.0 - s)) + s, 0.0, 1.0);
- finalColor.rgb = mix(stateColor, boneColor, fac);
- finalColor.a = 1.0;
+ /* Smooth lighting factor. */
+ const float s = 0.2; /* [0.0-0.5] range */
+ float fac = clamp((n * (1.0 - s)) + s, 0.0, 1.0);
+ finalColor.rgb = mix(stateColor, boneColor, fac);
+ finalColor.a = 1.0;
-
- vec4 worldPosition = InstanceModelMatrix * vec4(pos, 1.0);
- gl_Position = ViewProjectionMatrix * worldPosition;
+ vec4 worldPosition = InstanceModelMatrix * vec4(pos, 1.0);
+ gl_Position = ViewProjectionMatrix * worldPosition;
#ifdef USE_WORLD_CLIP_PLANES
- world_clip_planes_calc_clip_distance(worldPosition.xyz);
+ world_clip_planes_calc_clip_distance(worldPosition.xyz);
#endif
}