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

gpu_shader_instance_distance_line_vert.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5bd29c55e42d73ca52b9a5bdbcac80d8d6895ea7 (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
31

uniform mat4 ViewProjectionMatrix;

/* ---- Instantiated Attrs ---- */
in vec3 pos;

/* ---- Per instance Attrs ---- */
in vec3 color;
in float start;
in float end;
in mat4 InstanceModelMatrix;

uniform float size;

flat out vec4 finalColor;

void main()
{
  float len = end - start;
  vec3 sta = vec3(0.0, 0.0, -start);

  vec4 wPos = InstanceModelMatrix * vec4(pos * -len + sta, 1.0);

  gl_Position = ViewProjectionMatrix * wPos;
  gl_PointSize = size;
  finalColor = vec4(color, 1.0);

#ifdef USE_WORLD_CLIP_PLANES
  world_clip_planes_calc_clip_distance(wPos.xyz);
#endif
}