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

overlay_face_wireframe_vert.glsl « shaders « modes « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 722f62d9b6d7cc393f001595611473c94b456aec (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
36
37
38
39
40
41
42

uniform float wireStepParam;

in vec3 pos;
in vec3 nor;
in float wd; /* wiredata */

float get_edge_sharpness(float wd)
{
#ifndef USE_SCULPT
  return ((wd == 0.0) ? -1.5 : wd) + wireStepParam;
#else
  return 1.0;
#endif
}

/* Geometry shader version */
#if defined(SELECT_EDGES) || defined(USE_GEOM)
out float facing_g;
out float edgeSharpness_g;

#else /* USE_GEOM */
out float facing;
flat out float edgeSharpness;
#  define facing_g facing
#  define edgeSharpness_g edgeSharpness

#endif /* SELECT_EDGES */

void main()
{
  vec3 wpos = point_object_to_world(pos);
  gl_Position = point_world_to_ndc(wpos);

  vec3 wnor = normalize(normal_object_to_world(nor));
  facing_g = dot(wnor, ViewMatrixInverse[2].xyz);
  edgeSharpness_g = get_edge_sharpness(wd);

#ifdef USE_WORLD_CLIP_PLANES
  world_clip_planes_calc_clip_distance(wpos);
#endif
}