Cleanup: comments (long lines) in gpu
[blender.git] / source / blender / gpu / shaders / gpu_shader_3D_line_dashed_uniform_color_legacy_vert.glsl
1
2 /*
3  * Vertex Shader for dashed lines with 3D coordinates,
4  * with uniform multi-colors or uniform single-color, and unary thickness.
5  *
6  * Legacy version, without geometry shader support, always produce solid lines!
7  */
8
9 uniform mat4 ModelViewProjectionMatrix;
10 uniform vec2 viewport_size;
11
12 uniform vec4 color;
13
14 in vec3 pos;
15 noperspective out float distance_along_line;
16 noperspective out vec4 color_geom;
17
18 void main()
19 {
20   gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
21
22   /* Hack - prevent stupid GLSL compiler to optimize out unused viewport_size uniform,
23    * which gives crash! */
24   distance_along_line = viewport_size.x * 0.000001f - viewport_size.x * 0.0000009f;
25
26   color_geom = color;
27 }