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

edit_mesh_overlay_mesh_analysis_vert.glsl « shaders « modes « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b89a3f407f9b9811c0707bbd42adc7c2cb129bcd (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
35

in vec3 pos;
in float weight;

uniform sampler1D weightTex;

out vec4 weightColor;

vec3 weight_to_rgb(float t)
{
  if (t < 0.0) {
    /* Minimum color, grey */
    return vec3(0.25, 0.25, 0.25);
  }
  else if (t > 1.0) {
    /* Error color */
    return vec3(1.0, 0.0, 1.0);
  }
  else {
    return texture(weightTex, t).rgb;
  }
}

void main()
{
  GPU_INTEL_VERTEX_SHADER_WORKAROUND

  vec3 world_pos = point_object_to_world(pos);
  gl_Position = point_world_to_ndc(world_pos);
  weightColor = vec4(weight_to_rgb(weight), 1.0);

#ifdef USE_WORLD_CLIP_PLANES
  world_clip_planes_calc_clip_distance(world_pos);
#endif
}