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

object_empty_image_vert.glsl « shaders « modes « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 36e86290be79fe2fd52a5d13e0ea344fd6fd9e47 (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 vec2 aspect;
uniform float size;
uniform vec2 offset;
#ifdef USE_WIRE
uniform vec3 color;
#else
uniform vec4 objectColor;
#endif

in vec2 texCoord;
in vec2 pos;

flat out vec4 finalColor;

#ifndef USE_WIRE
out vec2 texCoord_interp;
#endif

void main()
{
  vec3 pos = vec3((pos + offset) * (size * aspect), 0.0);
  vec3 world_pos = point_object_to_world(pos);
  gl_Position = point_world_to_ndc(world_pos);
#ifdef USE_WIRE
  gl_Position.z -= 1e-5;
  finalColor = vec4(color, 1.0);
#else
  texCoord_interp = texCoord;
  finalColor = objectColor;
#endif

#ifdef USE_WORLD_CLIP_PLANES
  world_clip_planes_calc_clip_distance(world_pos);
#endif
}