This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/draw/modes/shaders/particle_strand_frag.glsl
Clément Foucault 0b0322099c Fix T57930 : Wrong hair shading in particle edit mode
Implement strand selection visualisation but without any shading.

I think this is not the overlay job to draw the strands shaded.

We can already view the children strands shaded for now but we might add
an option to draw the shaded strand instead of (or in addition to) the
guide strand.
2018-11-26 21:25:33 +01:00

24 lines
359 B
GLSL

uniform mat4 ModelViewProjectionMatrix;
in vec4 finalColor;
#ifdef USE_POINTS
in vec2 radii;
#endif
out vec4 fragColor;
void main()
{
fragColor = finalColor;
#ifdef USE_POINTS
float dist = length(gl_PointCoord - vec2(0.5));
fragColor.a = mix(finalColor.a, 0.0, smoothstep(radii[1], radii[0], dist));
if (fragColor.a == 0.0) {
discard;
}
#endif
}