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

paint_face_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: 2b5d586bdd1dd6965d071aa2e8760f8bda20e62c (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

in vec3 pos;
in vec4 nor; /* select flag on the 4th component */

void main()
{
  GPU_INTEL_VERTEX_SHADER_WORKAROUND

  vec3 world_pos = point_object_to_world(pos);
  gl_Position = point_world_to_ndc(world_pos);

  bool is_select = (nor.w > 0.0);
  bool is_hidden = (nor.w < 0.0);

  /* Don't draw faces that are selected. */
  if (is_hidden || is_select) {
    gl_Position = vec4(-2.0, -2.0, -2.0, 1.0);
  }
  else {
#ifdef USE_WORLD_CLIP_PLANES
    world_clip_planes_calc_clip_distance(world_pos);
#endif
  }
}