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

overlay_sculpt_curves_selection_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: 7be3c8e6dfb0695fb825ed3970eb26ea2079b41a (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
32
33
34
#pragma BLENDER_REQUIRE(common_hair_lib.glsl)
#pragma BLENDER_REQUIRE(common_view_clipping_lib.glsl)
#pragma BLENDER_REQUIRE(common_view_lib.glsl)

float retrieve_selection()
{
  if (is_point_domain) {
    return texelFetch(selection_tx, hair_get_base_id()).r;
  }
  return texelFetch(selection_tx, hair_get_strand_id()).r;
}

void main()
{
  bool is_persp = (ProjectionMatrix[3][3] == 0.0);
  float time, thick_time, thickness;
  vec3 world_pos, tan, binor;
  hair_get_pos_tan_binor_time(is_persp,
                              ModelMatrixInverse,
                              ViewMatrixInverse[3].xyz,
                              ViewMatrixInverse[2].xyz,
                              world_pos,
                              tan,
                              binor,
                              time,
                              thickness,
                              thick_time);

  gl_Position = point_world_to_ndc(world_pos);

  mask_weight = 1.0 - (selection_opacity - retrieve_selection() * selection_opacity);

  view_clipping_distances(world_pos);
}