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

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

uniform mat4 ModelViewProjectionMatrix;
uniform mat3 NormalMatrix;

#if __VERSION__ == 120
  attribute vec3 pos;
  attribute vec3 nor;
  attribute vec4 color;

#  ifdef USE_FLAT_NORMAL
  flat varying vec4 finalColor;
  flat varying vec3 normal;
#  else
  varying vec4 finalColor;
  varying vec3 normal;
#  endif
#else
  in vec3 pos;
  in vec3 nor;
  in vec4 color;

#  ifdef USE_FLAT_NORMAL
  flat out vec3 normal;
  flat out vec4 finalColor;
#  else
  out vec3 normal;
  out vec4 finalColor;
#  endif
#endif

void main()
{
	normal = normalize(NormalMatrix * nor);
	gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0);
	finalColor = color;
}