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

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

// Draw dashed lines, perforated in screen space.
// Based on a (3D) version by Mike Erwin.

uniform mat4 ModelViewProjectionMatrix;

#if __VERSION__ == 120
  attribute vec2 pos;
  attribute vec2 line_origin; // = pos for one vertex of the line
  noperspective varying float distance_along_line;
#else
  in vec2 pos;
  in vec2 line_origin;
  noperspective out float distance_along_line;
#endif

void main()
{
	gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0);

	distance_along_line = distance(line_origin, pos);
}