Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpu_shader_3D_polyline_frag.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8687763f4c1a04fbe3eaf4041ec223aa80dd6de7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef USE_GPU_SHADER_CREATE_INFO
uniform float lineWidth;
uniform bool lineSmooth = true;

in vec4 finalColor;
noperspective in float smoothline;
#  ifdef CLIP
in float clip;
#  endif

out vec4 fragColor;
#endif

#define SMOOTH_WIDTH 1.0

void main()
{
#ifdef CLIP
  if (clip < 0.0) {
    discard;
  }
#endif
  fragColor = finalColor;
  if (lineSmooth) {
    fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(smoothline), 0.0, 1.0);
  }
  fragColor = blender_srgb_to_framebuffer_space(fragColor);
}