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

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

uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelMatrix;
uniform mat4 ModelMatrixInverse;

uniform float normalSize;

in vec3 pos;

#ifdef LOOP_NORMALS
in vec3 lnor;
#  define nor lnor

#elif defined(FACE_NORMALS)
in vec4 norAndFlag;
#  define nor norAndFlag.xyz
#else

in vec3 vnor;
#  define nor vnor
#endif

flat out vec4 v1;
flat out vec4 v2;

void main()
{
  v1 = ModelViewProjectionMatrix * vec4(pos, 1.0);
  vec3 n = normalize(transform_normal_object_to_view(nor));
  v2 = v1 + ProjectionMatrix * vec4(n * normalSize, 0.0);
#ifdef USE_WORLD_CLIP_PLANES
  world_clip_planes_calc_clip_distance((ModelMatrix * vec4(pos, 1.0)).xyz);
#endif
}