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

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

#pragma BLENDER_REQUIRE(common_view_clipping_lib.glsl)
#pragma BLENDER_REQUIRE(common_view_lib.glsl)

void main()
{
  GPU_INTEL_VERTEX_SHADER_WORKAROUND

  vec2 pos;
  pos.x = float(gl_VertexID % 2);
  pos.y = float(gl_VertexID / 2) / float(halfLineCount - 1);

  if (pos.y > 1.0) {
    pos.xy = pos.yx;
    pos.x -= 1.0 + 1.0 / float(halfLineCount - 1);
  }

  pos -= 0.5;

  vec3 world_pos = xAxis * pos.x + yAxis * pos.y + origin;

  gl_Position = point_world_to_ndc(world_pos);

  view_clipping_distances(world_pos);

  finalColor = color;

  /* Convert to screen position [0..sizeVp]. */
  edgePos = edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;
}