Apply PreMultipliedAlpha on BorderlineColor
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / graphics / shaders / glyphy-shader-main.vert
1 uniform   mediump mat4    uProjection;
2 uniform   mediump mat4    uModelView;
3 uniform   mediump mat4    uMvpMatrix;
4 uniform           bool    uTextureMapped;
5 uniform   mediump vec4    uCustomTextureCoords;
6 attribute highp   vec2    aTexCoord;
7 varying   mediump vec2    vTexCoord;
8 uniform   mat3            uModelViewIT;
9 attribute mediump vec3    aNormal;
10 varying   mediump vec3    vNormal;
11 attribute mediump vec2    aPosition;
12 varying   mediump vec4    vVertex;
13 attribute mediump vec4    aColor;
14 varying   mediump vec4    vColor;
15 varying vec4 v_glyph;
16
17 vec4 glyph_vertex_transcode (vec2 v)
18 {
19   ivec2 g = ivec2 (v);
20   ivec2 corner = ivec2 (mod (v, 2.));
21   g /= 2;
22   ivec2 nominal_size = ivec2 (mod (vec2(g), 64.));
23   return vec4 (corner * nominal_size, g * 4);
24 }
25
26 void main()
27 {
28   gl_Position = uMvpMatrix * vec4 (aPosition, 0.0, 1.0);
29   v_glyph = glyph_vertex_transcode (aTexCoord);
30   vColor = aColor;
31 }