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

edit_mesh_skin_root_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: 944eb41058e3638e5597c5bac91a4a1e1a8f4990 (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

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

/* ---- Per instance Attrs ---- */
in float size;
in vec3 local_pos;

flat out vec4 finalColor;

void main()
{
  mat3 imat = mat3(ModelMatrixInverse);
  vec3 right = normalize(imat * screenVecs[0].xyz);
  vec3 up = normalize(imat * screenVecs[1].xyz);
  vec3 screen_pos = (right * pos.x + up * pos.z) * size;
  vec4 pos_4d = ModelMatrix * vec4(local_pos + screen_pos, 1.0);
  gl_Position = ViewProjectionMatrix * pos_4d;
  /* Manual stipple: one segment out of 2 is transparent. */
  finalColor = ((gl_VertexID & 1) == 0) ? colorSkinRoot : vec4(0.0);

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