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

extra_wire_frag.glsl « shaders « overlay « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3281d0f8f9a71b25a55fe5fa4957c1b5b2bb5bce (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

uniform vec4 color;

noperspective in vec2 stipple_coord;
flat in vec2 stipple_start;
flat in vec4 finalColor;

out vec4 fragColor;

void main()
{
  fragColor = finalColor;

  /* Stipple */
  const float dash_width = 6.0;
  const float dash_factor = 0.5;

  float dist = distance(stipple_start, stipple_coord);
  fragColor.a = 1.0;

  if (fract(dist / dash_width) > dash_factor) {
    discard;
  }
}