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

gpu_shader_point_varying_color_frag.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b0da035ef09c4fda5893498f3c06875b00534be2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

void main()
{
  vec2 centered = gl_PointCoord - vec2(0.5);
  float dist_squared = dot(centered, centered);
  const float rad_squared = 0.25;

  /* Round point with jaggy edges. */
  if (dist_squared > rad_squared) {
    discard;
  }

#if defined(VERT)
  fragColor = finalColor;

  float midStroke = 0.5 * rad_squared;
  if (vertexCrease > 0.0 && dist_squared > midStroke) {
    fragColor.rgb = mix(finalColor.rgb, colorEdgeCrease.rgb, vertexCrease);
  }
#else
  fragColor = finalColor;
#endif
}