This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/source/blender/draw/modes/shaders/armature_envelope_solid_frag.glsl

19 lines
390 B
GLSL

uniform float alpha = 0.6;
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 = alpha;
}