Cleanup: DRW: Move ModelMatrix declaration to common_view_lib
[blender.git] / source / blender / draw / modes / shaders / object_empty_image_vert.glsl
1
2 uniform vec2 aspect;
3 uniform float size;
4 uniform vec2 offset;
5 #ifdef USE_WIRE
6 uniform vec3 color;
7 #else
8 uniform vec4 objectColor;
9 #endif
10
11 in vec2 texCoord;
12 in vec2 pos;
13
14 flat out vec4 finalColor;
15
16 #ifndef USE_WIRE
17 out vec2 texCoord_interp;
18 #endif
19
20 void main()
21 {
22   vec3 pos = vec3((pos + offset) * (size * aspect), 0.0);
23   vec3 world_pos = point_object_to_world(pos);
24   gl_Position = point_world_to_ndc(world_pos);
25 #ifdef USE_WIRE
26   gl_Position.z -= 1e-5;
27   finalColor = vec4(color, 1.0);
28 #else
29   texCoord_interp = texCoord;
30   finalColor = objectColor;
31 #endif
32
33 #ifdef USE_WORLD_CLIP_PLANES
34   world_clip_planes_calc_clip_distance(world_pos);
35 #endif
36 }