summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-02-06 12:21:25 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-02-10 12:00:37 +0900
commit21d08f86e6087f7e30ff2015c7551c06e359bba9 (patch)
tree6aff15745ee5d90d3ec80be873c9b2c3f2c64235 /src/modules/evas/engines/gl_common/shader/map_mask_vert.shd
parent888fc6e93f8261666fe9c40addbc40bcd720decc (diff)
Evas GL: Add support for uniforms in the shaders
This will simplify greatly the code for map masking.
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_common/shader/map_mask_vert.shd12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd b/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd
index 7b0c9684e7..726a0f5dd0 100644
--- a/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd
+++ b/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd
@@ -2,20 +2,16 @@
2precision highp float; 2precision highp float;
3#endif 3#endif
4attribute vec4 vertex, color; 4attribute vec4 vertex, color;
5attribute vec2 tex_coord, tex_coordm, tex_sample, tex_coorda; 5attribute vec2 tex_coord;
6uniform float yinvert;
6uniform mat4 mvp; 7uniform mat4 mvp;
7varying vec2 tex_c; 8varying vec2 tex_c;
8varying vec4 mask_Position, col, mask_Absolute; 9varying vec4 mask_Position, col;
9void main() 10void main()
10{ 11{
11 gl_Position = mvp * vertex; 12 gl_Position = mvp * vertex;
12 tex_c = tex_coord; 13 tex_c = tex_coord;
13 col = color; 14 col = color;
14 15
15 // tex_coorda contains the Y-invert flag 16 mask_Position = mvp * vertex * vec4(0.5, yinvert * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
16 // tex_coordm contains the X,Y position of the mask
17 // tex_sample contains the W,H size of the mask (inverted)
18
19 mask_Position = mvp * vertex * vec4(tex_coorda.x * 0.5, tex_coorda.y * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
20 mask_Absolute = vec4(tex_coordm, tex_sample); // x, y, 1/w, 1/h on canvas in GL coords
21} 17}