diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index b94ac1fa20..aaf4ea22f2 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -682,9 +682,8 @@ modules/evas/engines/gl_common/evas_gl_api_gles1.c \ modules/evas/engines/gl_common/evas_gl_api_gles3_def.h \ modules/evas/engines/gl_common/evas_gl_api_ext.c \ modules/evas/engines/gl_common/shader/evas_gl_shaders.x \ -modules/evas/engines/gl_common/shader/evas_gl_shaders_bigendian.x \ modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x \ -modules/evas/engines/gl_common/shader/evas_gl_enum.x +$(NULL) # 3D GL_COMMON_SOURCES += \ @@ -696,24 +695,17 @@ modules/evas/engines/gl_common/evas_gl_3d_shader.c GL_SHADERS_GEN = \ modules/evas/engines/gl_common/shader/gen_shaders.sh \ -modules/evas/engines/gl_common/shader/shaders.txt \ modules/evas/engines/gl_common/shader/fragment.glsl \ modules/evas/engines/gl_common/shader/vertex.glsl \ +modules/evas/engines/gl_common/shader/include.glsl \ $(NULL) EXTRA_DIST += $(GL_SHADERS_GEN) -EXTRA_lib_evas_libevas_la_DEPENDENCIES = modules/evas/engines/gl_common/shader/evas_gl_enum.x modules/evas/engines/gl_common/shader/evas_gl_shaders.x: $(GL_SHADERS_GEN) @echo " SHADERS $@" @bash $(srcdir)/modules/evas/engines/gl_common/shader/gen_shaders.sh -modules/evas/engines/gl_common/shader/evas_gl_shaders_bigendian.x: $(GL_SHADERS_GEN) - @echo " SHADERS $@" - @bash $(srcdir)/modules/evas/engines/gl_common/shader/gen_shaders.sh _bigendian - -modules/evas/engines/gl_common/shader/evas_gl_enum.x: modules/evas/engines/gl_common/shader/evas_gl_shaders.x modules/evas/engines/gl_common/shader/evas_gl_shaders_bigendian.x - # NOTE: order here should be equal with modes in file Evas_Eo.h GL_SHADERS_3D_GEN = \ modules/evas/engines/gl_common/shader_3d/vertex_color_vert.shd \ diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h index fb7da52099..c1435843c3 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/engines/gl_common/evas_gl_common.h @@ -67,9 +67,6 @@ typedef struct _Evas_GL_Texture_Async_Preload Evas_GL_Texture_Async_Preload; typedef Eina_Bool (*evas_gl_make_current_cb)(void *engine_data, void *doit); -/* enum Evas_GL_Shader is defined below */ -#include "shader/evas_gl_enum.x" - #ifdef EAPI # undef EAPI #endif @@ -96,12 +93,16 @@ typedef Eina_Bool (*evas_gl_make_current_cb)(void *engine_data, void *doit); # endif #endif /* ! _WIN32 */ +#define PROGRAM_HITCOUNT_MAX 0x1000000 + struct _Evas_GL_Program { GLuint vert, frag, prog; + unsigned int flags, hitcount; int tex_count; - Eina_Bool reset; + Eina_Bool reset : 1; + Eina_Bool bin_saved : 1; }; struct _Evas_GL_Shared @@ -181,12 +182,13 @@ struct _Evas_GL_Shared Eina_Hash *native_tbm_hash; Eina_Hash *native_evasgl_hash; + Eet_File *shaders_cache; + Eina_Hash *shaders_hash; + #ifdef GL_GLES // FIXME: hack. void *eglctxt; #endif - - Evas_GL_Program shader[SHADER_LAST]; int references; int w, h; @@ -212,6 +214,7 @@ enum _Shader_Sampling { enum _Shader_Type { SHD_UNKNOWN, SHD_RECT, + SHD_LINE, SHD_FONT, SHD_IMAGE, SHD_IMAGENATIVE, @@ -221,9 +224,7 @@ enum _Shader_Type { SHD_YUV_709, SHD_YUY2_709, SHD_NV12_709, - SHD_LINE, SHD_RGB_A_PAIR, - SHD_TEX_EXTERNAL, SHD_MAP, SHD_TYPE_LAST }; @@ -245,8 +246,7 @@ struct _Evas_Engine_GL_Context struct { int top_pipe; struct { - Evas_GL_Shader id; - GLuint cur_prog; + Evas_GL_Program *prog; GLuint cur_tex, cur_texu, cur_texv, cur_texa, cur_texm; int render_op; int cx, cy, cw, ch; @@ -273,9 +273,8 @@ struct _Evas_Engine_GL_Context Eina_Bool active : 1; } clip; struct { - Evas_GL_Shader id; + Evas_GL_Program *prog; Evas_GL_Image *surface; - GLuint cur_prog; GLuint cur_tex, cur_texu, cur_texv, cur_texa, cur_texm; void *cur_tex_dyn, *cur_texu_dyn, *cur_texv_dyn; int render_op; @@ -595,9 +594,19 @@ void evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *g int evas_gl_common_shader_program_init(Evas_GL_Shared *shared); void evas_gl_common_shader_program_init_done(void); -void evas_gl_common_shader_program_shutdown(Evas_GL_Program *p); -Evas_GL_Shader evas_gl_common_img_shader_select(Shader_Type type, Shader_Sampling sam, int nomul, int afill, int bgra, int mask, int masksam); -const char *evas_gl_common_shader_name_get(Evas_GL_Shader shd); +void evas_gl_common_shader_program_shutdown(Evas_GL_Shared *shared); + +Evas_GL_Program *evas_gl_common_shader_program_get(Evas_Engine_GL_Context *gc, + Shader_Type type, + RGBA_Map_Point *p, int npoints, + int r, int g, int b, int a, + int sw, int sh, int w, int h, Eina_Bool smooth, + Evas_GL_Texture *tex, Eina_Bool tex_only, + Evas_GL_Texture *mtex, Eina_Bool mask_smooth, + int mw, int mh, + Shader_Sampling *psam, int *pnomul, + Shader_Sampling *pmasksam); +void evas_gl_common_shader_textures_bind(Evas_GL_Program *p); Eina_Bool evas_gl_common_file_cache_is_dir(const char *file); Eina_Bool evas_gl_common_file_cache_mkdir(const char *dir); @@ -606,7 +615,6 @@ Eina_Bool evas_gl_common_file_cache_mkpath_if_not_exists(const char *pat Eina_Bool evas_gl_common_file_cache_mkpath(const char *path); int evas_gl_common_file_cache_dir_check(char *cache_dir, int num); int evas_gl_common_file_cache_file_check(const char *cache_dir, const char *cache_name, char *cache_file, int dir_num); -int evas_gl_common_file_cache_save(Evas_GL_Shared *shared); void evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h); diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index 5e33fbe6e7..58ec6fe173 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -7,7 +7,7 @@ # error gl_common should not get compiled if dlsym is not found on the system! #endif -#define PRG_INVALID 0xffffffff +#define PRG_INVALID NULL #define GLPIPES 1 static int sym_done = 0; @@ -487,8 +487,9 @@ _evas_gl_common_version_check(int *gles_ver) static void _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc) { - unsigned int i; int w = 1, h = 1, m = 1, rot = 1, foc = 0; + Evas_GL_Program *prog; + Eina_Iterator *it; EINA_SAFETY_ON_NULL_RETURN(gc); foc = gc->foc; @@ -619,21 +620,24 @@ _evas_gl_common_viewport_set(Evas_Engine_GL_Context *gc) gc->shared->ay = ay; } - for (i = 0; i < SHADER_LAST; ++i) - { - gc->shared->shader[i].reset = EINA_TRUE; - } + // FIXME: Is this heavy work? + it = eina_hash_iterator_data_new(gc->shared->shaders_hash); + EINA_ITERATOR_FOREACH(it, prog) + prog->reset = EINA_TRUE; + eina_iterator_free(it); - if (gc->state.current.cur_prog == PRG_INVALID) + if (gc->state.current.prog != PRG_INVALID) + /* { glUseProgram(gc->shared->shader[0].prog); glUniformMatrix4fv(glGetUniformLocation(gc->shared->shader[0].prog, "mvp"), 1, GL_FALSE, gc->shared->proj); gc->shared->shader[0].reset = EINA_FALSE; } else + */ { - glUseProgram(gc->state.current.cur_prog); - glUniformMatrix4fv(glGetUniformLocation(gc->state.current.cur_prog, "mvp"), 1, GL_FALSE, gc->shared->proj); + glUseProgram(gc->state.current.prog->prog); + glUniformMatrix4fv(glGetUniformLocation(gc->state.current.prog->prog, "mvp"), 1, GL_FALSE, gc->shared->proj); } } @@ -677,7 +681,6 @@ evas_gl_common_context_new(void) if (!shared) { const char *ext; - int shd; shared = calloc(1, sizeof(Evas_GL_Shared)); ext = (const char *) glGetString(GL_EXTENSIONS); @@ -924,20 +927,11 @@ evas_gl_common_context_new(void) glEnableVertexAttribArray(SHAD_VERTEX); glEnableVertexAttribArray(SHAD_COLOR); - if (!evas_gl_common_shader_program_init(shared)) goto error; + if (!evas_gl_common_shader_program_init(shared)) + goto error; - /* Bind textures */ - for (shd = 0; _shaders_textures[shd].id != SHADER_LAST; shd++) - { - GLuint loc; - glUseProgram(shared->shader[_shaders_textures[shd].id].prog); - loc = glGetUniformLocation(shared->shader[_shaders_textures[shd].id].prog, _shaders_textures[shd].tname); - glUniform1i(loc, shared->shader[_shaders_textures[shd].id].tex_count++); - } - - if (gc->state.current.cur_prog == PRG_INVALID) - glUseProgram(shared->shader[0].prog); - else glUseProgram(gc->state.current.cur_prog); + if (gc->state.current.prog) + glUseProgram(gc->state.current.prog->prog); evas_gl_common_shader_program_init_done(); // in shader: @@ -961,7 +955,8 @@ evas_gl_common_context_new(void) gc->def_surface = evas_gl_common_image_surface_new(gc, 1, 1, 1); return gc; - error: + +error: evas_gl_common_context_free(gc); return NULL; } @@ -1010,8 +1005,7 @@ evas_gl_common_context_free(Evas_Engine_GL_Context *gc) { Evas_GL_Texture_Pool *pt; - for (i = 0; i < SHADER_LAST; ++i) - evas_gl_common_shader_program_shutdown(&(gc->shared->shader[i])); + evas_gl_common_shader_program_shutdown(gc->shared); while (gc->shared->images) { @@ -1072,8 +1066,7 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc) // fprintf(stderr, "------------------------\n"); gc->flushnum = 0; - gc->state.current.id = SHADER_LAST; - gc->state.current.cur_prog = 0; + gc->state.current.prog = NULL; gc->state.current.cur_tex = 0; gc->state.current.cur_texu = 0; gc->state.current.cur_texv = 0; @@ -1101,8 +1094,7 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc) gc->pipe[i].clip.w = 0; gc->pipe[i].clip.h = 0; gc->pipe[i].shader.surface = NULL; - gc->pipe[i].shader.id = SHADER_LAST; - gc->pipe[i].shader.cur_prog = 0; + gc->pipe[i].shader.prog = NULL; gc->pipe[i].shader.cur_tex = 0; gc->pipe[i].shader.cur_texu = 0; gc->pipe[i].shader.cur_texv = 0; @@ -1142,9 +1134,8 @@ evas_gl_common_context_newframe(Evas_Engine_GL_Context *gc) glEnableVertexAttribArray(SHAD_VERTEX); glEnableVertexAttribArray(SHAD_COLOR); - if (gc->state.current.cur_prog == PRG_INVALID) - glUseProgram(gc->shared->shader[0].prog); - else glUseProgram(gc->state.current.cur_prog); + if (gc->state.current.prog != PRG_INVALID) + glUseProgram(gc->state.current.prog->prog); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, gc->pipe[0].shader.cur_tex); @@ -1226,8 +1217,7 @@ evas_gl_common_context_target_surface_set(Evas_Engine_GL_Context *gc, evas_gl_common_context_flush(gc); evas_gl_common_context_done(gc); - gc->state.current.id = SHADER_LAST; - gc->state.current.cur_prog = PRG_INVALID; + gc->state.current.prog = NULL; gc->state.current.cur_tex = 0; gc->state.current.cur_texu = 0; gc->state.current.cur_texv = 0; @@ -1516,165 +1506,12 @@ vertex_array_size_check(Evas_Engine_GL_Context *gc EINA_UNUSED, int pn EINA_UNUS */ } -static Evas_GL_Shader -evas_gl_common_shader_select(Evas_Engine_GL_Context *gc, - Shader_Type type, - RGBA_Map_Point *p, int npoints, - int r, int g, int b, int a, - int sw, int sh, int w, int h, Eina_Bool smooth, - Evas_GL_Texture *tex, Eina_Bool tex_only, - Evas_GL_Texture *mtex, Eina_Bool mask_smooth, - int mw, int mh, - Shader_Sampling *psam, int *pnomul, Shader_Sampling *pmasksam) -{ - const Eina_Bool gc_bgra = gc->shared->info.bgra; - int nomul = 1, bgra = 0; - int mask = (mtex != NULL), afill = 0; - Shader_Sampling sam = SHD_SAM11, masksam = SHD_SAM11; - Evas_GL_Shader shader = SHADER_RECT; - int k = 0; - - if ((type <= SHD_UNKNOWN) || (type >= SHD_TYPE_LAST)) - { - CRI("Unknown shader type requested!"); - goto end; - } - - // image downscale sampling - if (smooth && ((type == SHD_IMAGE) || (type == SHD_IMAGENATIVE))) - { - if ((sw >= (w * 2)) && (sh >= (h * 2))) - sam = SHD_SAM22; - else if (sw >= (w * 2)) - sam = SHD_SAM21; - else if (sh >= (h * 2)) - sam = SHD_SAM12; - } - - // mask downscale sampling - if (mtex && mask_smooth) - { - if ((mtex->w >= (mw * 2)) && (mtex->h >= (mh * 2))) - masksam = SHD_SAM22; - else if (mtex->w >= (mw * 2)) - masksam = SHD_SAM21; - else if (mtex->h >= (mh * 2)) - masksam = SHD_SAM12; - } - - // rect, line, polygon - if ((type == SHD_RECT) || (type == SHD_LINE)) - { - static const Evas_GL_Shader rect_shaders[] = { - SHADER_RECT_MASK, SHADER_RECT_MASK12, SHADER_RECT_MASK21, SHADER_RECT_MASK22 - }; - if (!mtex) shader = SHADER_RECT; - else shader = rect_shaders[masksam]; - goto end; - } - - // text - if (type == SHD_FONT) - { - static const Evas_GL_Shader font_shaders[] = { - SHADER_FONT_MASK, SHADER_FONT_MASK12, SHADER_FONT_MASK21, SHADER_FONT_MASK22 - }; - if (!mtex) shader = SHADER_FONT; - else shader = font_shaders[masksam]; - goto end; - } - - // color mul - if ((a == 255) && (r == 255) && (g == 255) && (b == 255)) - { - if (p) - { - for (k = 0; k < npoints; k++) - if (p[k].col != 0xffffffff) - { - nomul = 0; - break; - } - } - } - else - nomul = 0; - - // bgra - if (tex_only) - { - if (tex->pt->dyn.img) - { - afill = !tex->alpha; - bgra = 1; - } - else if (tex->im && tex->im->native.target == GL_TEXTURE_EXTERNAL_OES) - { - type = SHD_TEX_EXTERNAL; - afill = !tex->alpha; - } - else - bgra = 1; - } - else - bgra = gc_bgra; - - if ((type == SHD_IMAGE) || (type == SHD_IMAGENATIVE) || (type == SHD_MAP)) - shader = evas_gl_common_img_shader_select(type, sam, nomul, afill, bgra, mask, masksam); - else - { -#define SHADERS(name, ...) \ - SHADER_##name##_NOMUL##__VA_ARGS__, SHADER_##name##__VA_ARGS__, \ - SHADER_##name##_MASK_NOMUL, SHADER_##name##_MASK - static const Evas_GL_Shader yuv_shaders[] = { - SHADERS(YUV), - SHADERS(YUY2), - SHADERS(NV12), - SHADERS(YUV_709), - SHADERS(YUY2_709), - SHADERS(NV12_709), - SHADERS(RGB_A_PAIR), - SHADERS(TEX_EXTERNAL), - SHADERS(TEX_EXTERNAL, _AFILL), /* note: afill + mask does not exist */ - }; -#undef SHADERS - - switch (type) - { - case SHD_YUV: k = 0; break; - case SHD_YUY2: k = 4; break; - case SHD_NV12: k = 8; break; - case SHD_YUV_709: k = 12; break; - case SHD_YUY2_709: k = 16; break; - case SHD_NV12_709: k = 20; break; - case SHD_RGB_A_PAIR: k = 24; break; - case SHD_TEX_EXTERNAL: k = 28; break; - default: - CRI("Unknown shader type requested!"); - goto end; - } - - shader = yuv_shaders[k + (afill * 4) + (mask * 2) + (!nomul)]; - } - - /* - DBG("sam %d, nomul %d, afill %d, bgra %d, mask %d --> [%02d] %s", - (int) sam, nomul, afill, bgra, mask, shader, - evas_gl_common_shader_name_get(shader)); - */ -end: - if (psam) *psam = sam; - if (pnomul) *pnomul = nomul; - if (pmasksam) *pmasksam = masksam; - return shader; -} - static int _evas_gl_common_context_push(Shader_Type rtype, Evas_Engine_GL_Context *gc, Evas_GL_Texture *tex, Evas_GL_Texture *texm, - GLuint prog, + Evas_GL_Program *prog, int x, int y, int w, int h, Eina_Bool blend, Eina_Bool smooth, @@ -1705,7 +1542,7 @@ _evas_gl_common_context_push(Shader_Type rtype, && (!tex || gc->pipe[i].shader.cur_tex == current_tex) && (!texm || ((gc->pipe[i].shader.cur_texm == texm->pt->texture) && (gc->pipe[i].shader.mask_smooth == mask_smooth))) - && (gc->pipe[i].shader.cur_prog == prog) + && (gc->pipe[i].shader.prog == prog) && (gc->pipe[i].shader.smooth == smooth) && (gc->pipe[i].shader.blend == blend) && (gc->pipe[i].shader.render_op == gc->dc->render_op) @@ -1748,7 +1585,7 @@ _evas_gl_common_context_push(Shader_Type rtype, /* && (!texa || gc->pipe[pn].shader.cur_texa == current_texa) */ && (!texm || ((gc->pipe[i].shader.cur_texm == texm->pt->texture) && (gc->pipe[i].shader.mask_smooth == mask_smooth))) - && (gc->pipe[pn].shader.cur_prog == prog) + && (gc->pipe[pn].shader.prog == prog) && (gc->pipe[pn].shader.smooth == smooth) && (gc->pipe[pn].shader.blend == blend) && (gc->pipe[pn].shader.render_op == gc->dc->render_op) @@ -1781,28 +1618,26 @@ evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc, int r, int g, int b, int a) { Eina_Bool blend = EINA_FALSE; - Evas_GL_Shader shader; + Evas_GL_Program *prog; int pn = 0, i; - GLuint prog, mtexid = mtex ? mtex->pt->texture : 0; + GLuint mtexid = mtex ? mtex->pt->texture : 0; Shader_Sampling masksam = SHD_SAM11; if (!(gc->dc->render_op == EVAS_RENDER_COPY) && ((a < 255) || (mtex))) blend = EINA_TRUE; - shader = evas_gl_common_shader_select(gc, SHD_LINE, NULL, 0, r, g, b, a, - 0, 0, 0, 0, EINA_FALSE, NULL, EINA_FALSE, - mtex, mask_smooth, mw, mh, NULL, NULL, &masksam); + prog = evas_gl_common_shader_program_get(gc, SHD_LINE, NULL, 0, r, g, b, a, + 0, 0, 0, 0, EINA_FALSE, NULL, EINA_FALSE, + mtex, mask_smooth, mw, mh, NULL, NULL, &masksam); - prog = gc->shared->shader[shader].prog; shader_array_flush(gc); vertex_array_size_check(gc, gc->state.top_pipe, 2); pn = gc->state.top_pipe; gc->pipe[pn].region.type = SHD_LINE; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = 0; gc->pipe[pn].shader.cur_texm = mtexid; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; gc->pipe[pn].shader.clip = clip; @@ -1856,18 +1691,16 @@ evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc, { Eina_Bool blend = EINA_FALSE; Shader_Sampling masksam = SHD_SAM11; - Evas_GL_Shader shader; - GLuint prog; + Evas_GL_Program *prog; GLuint mtexid = mtex ? mtex->pt->texture : 0; int pn = 0; if (!(gc->dc->render_op == EVAS_RENDER_COPY) && ((a < 255) || mtex)) blend = EINA_TRUE; - shader = evas_gl_common_shader_select(gc, SHD_RECT, NULL, 0, r, g, b, a, - 0, 0, 0, 0, EINA_FALSE, NULL, EINA_FALSE, - mtex, mask_smooth, mw, mh, NULL, NULL, &masksam); - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, SHD_RECT, NULL, 0, r, g, b, a, + 0, 0, 0, 0, EINA_FALSE, NULL, EINA_FALSE, + mtex, mask_smooth, mw, mh, NULL, NULL, &masksam); again: vertex_array_size_check(gc, gc->state.top_pipe, 6); @@ -1876,10 +1709,9 @@ again: if ((pn == 0) && (gc->pipe[pn].array.num == 0)) { gc->pipe[pn].region.type = SHD_RECT; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = 0; gc->pipe[pn].shader.cur_texm = mtexid; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; gc->pipe[pn].shader.mask_smooth = mask_smooth; @@ -1908,7 +1740,7 @@ again: if ((gc->pipe[i].region.type == SHD_RECT) && (gc->pipe[i].shader.cur_tex == 0) && (gc->pipe[i].shader.cur_texm == mtexid) - && (gc->pipe[i].shader.cur_prog == prog) + && (gc->pipe[i].shader.prog == prog) && (gc->pipe[i].shader.blend == blend) && (gc->pipe[i].shader.render_op == gc->dc->render_op) && (gc->pipe[i].shader.clip == 0) @@ -1931,10 +1763,9 @@ again: } gc->state.top_pipe = pn; gc->pipe[pn].region.type = SHD_RECT; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = 0; gc->pipe[pn].shader.cur_texm = mtexid; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; gc->pipe[pn].shader.mask_smooth = mask_smooth; @@ -1958,7 +1789,7 @@ again: #else if ((gc->pipe[pn].shader.cur_tex != 0) || (gc->pipe[pn].shader.cur_texm != mtexid) - || (gc->pipe[pn].shader.cur_prog != prog) + || (gc->pipe[pn].shader.prog != prog) || (gc->pipe[pn].shader.blend != blend) || (gc->pipe[pn].shader.render_op != gc->dc->render_op) || (gc->pipe[pn].shader.clip != 0) @@ -1967,10 +1798,9 @@ again: { shader_array_flush(gc); pn = gc->state.top_pipe; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = 0; gc->pipe[pn].shader.cur_texm = mtexid; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; gc->pipe[pn].shader.mask_smooth = mask_smooth; @@ -2083,8 +1913,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, GLfloat offsetx, offsety; double pw, ph; Eina_Bool blend = EINA_FALSE; - Evas_GL_Shader shader = SHADER_IMG; - GLuint prog = gc->shared->shader[shader].prog; + Evas_GL_Program *prog; int pn = 0, render_op = gc->dc->render_op, nomul = 0; Shader_Sampling sam = 0, masksam = 0; int yinvert = 0; @@ -2102,11 +1931,10 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, else if (!(render_op == EVAS_RENDER_COPY) && ((a < 255) || (tex->alpha))) blend = EINA_TRUE; - shader = evas_gl_common_shader_select(gc, shd_in, NULL, 0, r, g, b, a, - sw, sh, w, h, smooth, tex, tex_only, - mtex, mask_smooth, mw, mh, - &sam, &nomul, &masksam); - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, shd_in, NULL, 0, r, g, b, a, + sw, sh, w, h, smooth, tex, tex_only, + mtex, mask_smooth, mw, mh, + &sam, &nomul, &masksam); if (tex->ptt) { @@ -2138,10 +1966,9 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, mask_smooth); gc->pipe[pn].region.type = SHD_IMAGE; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = pt->texture; gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = smooth; gc->pipe[pn].shader.mask_smooth = mask_smooth; gc->pipe[pn].shader.blend = blend; @@ -2290,15 +2117,13 @@ evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc, { GLfloat tx1, tx2, ty1, ty2; Shader_Sampling masksam = SHD_SAM11; - Evas_GL_Shader shader; - GLuint prog; + Evas_GL_Program *prog; int pn = 0; - shader = evas_gl_common_shader_select(gc, SHD_FONT, NULL, 0, r, g, b, a, - sw, sh, w, h, EINA_FALSE, tex, EINA_FALSE, - mtex, mask_smooth, mw, mh, - NULL, NULL, &masksam); - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, SHD_FONT, NULL, 0, r, g, b, a, + sw, sh, w, h, EINA_FALSE, tex, EINA_FALSE, + mtex, mask_smooth, mw, mh, + NULL, NULL, &masksam); pn = _evas_gl_common_context_push(SHD_FONT, gc, tex, mtex, @@ -2310,10 +2135,9 @@ evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc, mask_smooth); gc->pipe[pn].region.type = SHD_FONT; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = tex->pt->texture; gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = 0; gc->pipe[pn].shader.blend = 1; gc->pipe[pn].shader.render_op = gc->dc->render_op; @@ -2369,18 +2193,16 @@ evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc, GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; Shader_Sampling masksam = SHD_SAM11; Eina_Bool blend = 0; - Evas_GL_Shader shader; - GLuint prog; + Evas_GL_Program *prog; int pn = 0, nomul = 0; if ((a < 255) || (!!mtex)) blend = 1; - shader = evas_gl_common_shader_select(gc, SHD_YUV, NULL, 0, r, g, b, a, - w, h, w, h, smooth, tex, 0, - mtex, mask_smooth, mw, mh, - NULL, &nomul, &masksam); - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, SHD_YUV, NULL, 0, r, g, b, a, + w, h, w, h, smooth, tex, 0, + mtex, mask_smooth, mw, mh, + NULL, &nomul, &masksam); pn = _evas_gl_common_context_push(SHD_YUV, gc, tex, mtex, @@ -2392,12 +2214,11 @@ evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc, mask_smooth); gc->pipe[pn].region.type = SHD_YUV; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = tex->pt->texture; gc->pipe[pn].shader.cur_texu = tex->ptu->texture; gc->pipe[pn].shader.cur_texv = tex->ptv->texture; gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = smooth; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; @@ -2451,18 +2272,16 @@ evas_gl_common_context_yuv_709_push(Evas_Engine_GL_Context *gc, GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; Shader_Sampling masksam = SHD_SAM11; Eina_Bool blend = 0; - Evas_GL_Shader shader; - GLuint prog; + Evas_GL_Program *prog; int pn = 0, nomul = 0; if ((a < 255) || (!!mtex)) blend = 1; - shader = evas_gl_common_shader_select(gc, SHD_YUV_709, NULL, 0, r, g, b, a, - w, h, w, h, smooth, tex, 0, - mtex, mask_smooth, mw, mh, - NULL, &nomul, &masksam); - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, SHD_YUV_709, NULL, 0, r, g, b, a, + w, h, w, h, smooth, tex, 0, + mtex, mask_smooth, mw, mh, + NULL, &nomul, &masksam); pn = _evas_gl_common_context_push(SHD_YUV_709, gc, tex, mtex, @@ -2474,12 +2293,11 @@ evas_gl_common_context_yuv_709_push(Evas_Engine_GL_Context *gc, mask_smooth); gc->pipe[pn].region.type = SHD_YUV_709; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = tex->pt->texture; gc->pipe[pn].shader.cur_texu = tex->ptu->texture; gc->pipe[pn].shader.cur_texv = tex->ptv->texture; gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = smooth; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; @@ -2533,18 +2351,16 @@ evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc, GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; Shader_Sampling masksam = SHD_SAM11; Eina_Bool blend = 0; - Evas_GL_Shader shader; - GLuint prog; + Evas_GL_Program *prog; int pn = 0, nomul = 0; if ((a < 255) || (!!mtex)) blend = 1; - shader = evas_gl_common_shader_select(gc, SHD_YUY2, NULL, 0, r, g, b, a, - sw, sh, w, h, smooth, tex, 0, - mtex, mask_smooth, mw, mh, - NULL, &nomul, &masksam); - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, SHD_YUY2, NULL, 0, r, g, b, a, + sw, sh, w, h, smooth, tex, 0, + mtex, mask_smooth, mw, mh, + NULL, &nomul, &masksam); pn = _evas_gl_common_context_push(SHD_YUY2, gc, tex, mtex, @@ -2556,11 +2372,10 @@ evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc, mask_smooth); gc->pipe[pn].region.type = SHD_YUY2; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = tex->pt->texture; gc->pipe[pn].shader.cur_texu = tex->ptuv->texture; gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = smooth; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; @@ -2613,19 +2428,16 @@ evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc, GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; Shader_Sampling masksam = SHD_SAM11; Eina_Bool blend = 0; - Evas_GL_Shader shader; - GLuint prog; + Evas_GL_Program *prog; int pn = 0, nomul = 0; if ((a < 255) || (!!mtex)) blend = 1; - shader = evas_gl_common_shader_select(gc, SHD_NV12, NULL, 0, r, g, b, a, - sw, sh, w, h, smooth, tex, 0, - mtex, mask_smooth, mw, mh, - NULL, &nomul, &masksam); - prog = gc->shared->shader[shader].prog; - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, SHD_NV12, NULL, 0, r, g, b, a, + sw, sh, w, h, smooth, tex, 0, + mtex, mask_smooth, mw, mh, + NULL, &nomul, &masksam); pn = _evas_gl_common_context_push(SHD_NV12, gc, tex, mtex, @@ -2637,13 +2449,12 @@ evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc, mask_smooth); gc->pipe[pn].region.type = SHD_NV12; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = tex->pt->texture; gc->pipe[pn].shader.cur_tex_dyn = tex->pt->dyn.img; gc->pipe[pn].shader.cur_texu = tex->ptuv->texture; gc->pipe[pn].shader.cur_texu_dyn = tex->ptuv->dyn.img; gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = smooth; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; @@ -2704,15 +2515,13 @@ evas_gl_common_context_rgb_a_pair_push(Evas_Engine_GL_Context *gc, GLfloat tx1, tx2, ty1, ty2, t2x1, t2x2, t2y1, t2y2; Shader_Sampling masksam = SHD_SAM11; - Evas_GL_Shader shader; - GLuint prog; + Evas_GL_Program *prog; int pn, nomul = 0; - shader = evas_gl_common_shader_select(gc, SHD_RGB_A_PAIR, NULL, 0, r, g, b, a, - sw, sh, w, h, smooth, tex, 0, - mtex, mask_smooth, mw, mh, - NULL, &nomul, &masksam); - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, SHD_RGB_A_PAIR, NULL, 0, r, g, b, a, + sw, sh, w, h, smooth, tex, 0, + mtex, mask_smooth, mw, mh, + NULL, &nomul, &masksam); pn = _evas_gl_common_context_push(SHD_RGB_A_PAIR, gc, tex, mtex, @@ -2724,11 +2533,10 @@ evas_gl_common_context_rgb_a_pair_push(Evas_Engine_GL_Context *gc, mask_smooth); gc->pipe[pn].region.type = SHD_RGB_A_PAIR; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = tex->pt->texture; gc->pipe[pn].shader.cur_texa = tex->pta->texture; gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = smooth; gc->pipe[pn].shader.blend = EINA_TRUE; gc->pipe[pn].shader.render_op = gc->dc->render_op; @@ -2788,14 +2596,13 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc, Eina_Bool blend = EINA_FALSE; DATA32 cmul; Shader_Sampling masksam = SHD_SAM11; - Evas_GL_Shader shader = SHADER_IMG; + Evas_GL_Program *prog; Eina_Bool utexture = EINA_FALSE; Eina_Bool uvtexture = EINA_FALSE; Eina_Bool use_texa = EINA_FALSE; Shader_Type type; int pn = 0, i; int flat = 0, nomul = 0, yinvert = 0; - GLuint prog; if (!(gc->dc->render_op == EVAS_RENDER_COPY) && ((a < 255) || (tex->alpha) || (!!mtex))) blend = EINA_TRUE; @@ -2841,11 +2648,10 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc, type = SHD_MAP; break; } - shader = evas_gl_common_shader_select(gc, type, p, npoints, r, g, b, a, - w, h, w, h, smooth, tex, tex_only, - mtex, mask_smooth, mw, mh, - NULL, &nomul, &masksam); - prog = gc->shared->shader[shader].prog; + prog = evas_gl_common_shader_program_get(gc, type, p, npoints, r, g, b, a, + w, h, w, h, smooth, tex, tex_only, + mtex, mask_smooth, mw, mh, + NULL, &nomul, &masksam); x = w = (p[0].x >> FP); y = h = (p[0].y >> FP); @@ -2918,7 +2724,7 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc, clip, cx, cy, cw, ch, mask_smooth); gc->pipe[pn].region.type = SHD_MAP; - gc->pipe[pn].shader.id = shader; + gc->pipe[pn].shader.prog = prog; gc->pipe[pn].shader.cur_tex = tex->pt->texture; if (utexture) { @@ -2933,7 +2739,6 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc, gc->pipe[pn].shader.cur_texu_dyn = tex->ptuv->dyn.img; } gc->pipe[pn].shader.cur_texm = mtex ? mtex->pt->texture : 0; - gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = smooth; gc->pipe[pn].shader.blend = blend; gc->pipe[pn].shader.render_op = gc->dc->render_op; @@ -3114,20 +2919,23 @@ shader_array_flush(Evas_Engine_GL_Context *gc) } for (i = 0; i < gc->shared->info.tune.pipes.max; i++) { + Evas_GL_Program *prog; + if (gc->pipe[i].array.num <= 0) break; + prog = gc->pipe[i].shader.prog; setclip = EINA_FALSE; pipe_done++; gc->flushnum++; GLERRV(""); - if (gc->pipe[i].shader.cur_prog != gc->state.current.cur_prog) + if (prog && (prog != gc->state.current.prog)) { - glUseProgram(gc->pipe[i].shader.cur_prog); - if (gc->shared->shader[gc->pipe[i].shader.id].reset) + glUseProgram(prog->prog); + if (prog->reset) { - glUniformMatrix4fv(glGetUniformLocation(gc->pipe[i].shader.cur_prog, "mvp"), 1, GL_FALSE, gc->shared->proj); - gc->shared->shader[gc->pipe[i].shader.id].reset = EINA_FALSE; + glUniformMatrix4fv(glGetUniformLocation(prog->prog, "mvp"), 1, GL_FALSE, gc->shared->proj); + prog->reset = EINA_FALSE; } } @@ -3711,8 +3519,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc) gc->pipe[i].array.im = NULL; } - gc->state.current.id = gc->pipe[i].shader.id; - gc->state.current.cur_prog = gc->pipe[i].shader.cur_prog; + gc->state.current.prog = gc->pipe[i].shader.prog; gc->state.current.cur_tex = gc->pipe[i].shader.cur_tex; gc->state.current.cur_texm = gc->pipe[i].shader.cur_texm; gc->state.current.cur_texa = gc->pipe[i].shader.cur_texa; diff --git a/src/modules/evas/engines/gl_common/evas_gl_shader.c b/src/modules/evas/engines/gl_common/evas_gl_shader.c index 9f70418e22..715a045c94 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_shader.c +++ b/src/modules/evas/engines/gl_common/evas_gl_shader.c @@ -1,10 +1,65 @@ #include "config.h" +#include "shader/evas_gl_shaders.x" +#include "evas_gl_common.h" + +#define SHADER_FLAG_SAM_BITSHIFT 3 +#define SHADER_FLAG_MASKSAM_BITSHIFT 6 +#define SHADER_PROG_NAME_FMT "prog_%08x" +#define SHADER_BINARY_EET_COMPRESS 1 + #ifdef WORDS_BIGENDIAN -# include "shader/evas_gl_shaders_bigendian.x" +# define BASEFLAG SHADER_FLAG_BIGENDIAN; #else -# include "shader/evas_gl_shaders.x" +# define BASEFLAG 0 #endif +typedef enum { + SHADER_FLAG_TEX = (1 << 0), + SHADER_FLAG_BGRA = (1 << 1), + SHADER_FLAG_MASK = (1 << 2), + SHADER_FLAG_SAM12 = (1 << (SHADER_FLAG_SAM_BITSHIFT + 0)), + SHADER_FLAG_SAM21 = (1 << (SHADER_FLAG_SAM_BITSHIFT + 1)), + SHADER_FLAG_SAM22 = (1 << (SHADER_FLAG_SAM_BITSHIFT + 2)), + SHADER_FLAG_MASKSAM12 = (1 << (SHADER_FLAG_MASKSAM_BITSHIFT + 0)), + SHADER_FLAG_MASKSAM21 = (1 << (SHADER_FLAG_MASKSAM_BITSHIFT + 1)), + SHADER_FLAG_MASKSAM22 = (1 << (SHADER_FLAG_MASKSAM_BITSHIFT + 2)), + SHADER_FLAG_IMG = (1 << 9), + SHADER_FLAG_BIGENDIAN = (1 << 10), + SHADER_FLAG_YUV = (1 << 11), + SHADER_FLAG_YUY2 = (1 << 12), + SHADER_FLAG_NV12 = (1 << 13), + SHADER_FLAG_YUV_709 = (1 << 14), + SHADER_FLAG_EXTERNAL = (1 << 15), + SHADER_FLAG_AFILL = (1 << 16), + SHADER_FLAG_NOMUL = (1 << 17), + SHADER_FLAG_ALPHA = (1 << 18), + SHADER_FLAG_RGB_A_PAIR = (1 << 19), +} Shader_Flag; +#define SHADER_FLAG_COUNT 20 + +static const char *_shader_flags[SHADER_FLAG_COUNT] = { + "TEX", + "BGRA", + "MASK", + "SAM12", + "SAM21", + "SAM22", + "MASKSAM12", + "MASKSAM21", + "MASKSAM22", + "IMG", + "BIGENDIAN", + "YUV", + "YUY2", + "NV12", + "YUV_709", + "EXTERNAL", + "AFILL", + "NOMUL", + "ALPHA", + "RGB_A_PAIR" +}; + ///////////////////////////////////////////// static void gl_compile_link_error(GLuint target, const char *action) @@ -39,19 +94,26 @@ gl_compile_link_error(GLuint target, const char *action) } } -static int -_evas_gl_common_shader_program_binary_init(Evas_GL_Program *p, - const char *pname, - Eet_File *ef) +static Evas_GL_Program * +_evas_gl_common_shader_program_binary_load(Eet_File *ef, unsigned int flags) { - int res = 0, num = 0, length = 0; + int num = 0, length = 0; int *formats = NULL; void *data = NULL; - GLint ok = 0; + char pname[32]; + GLint ok = 0, prg, vtx = GL_NONE, frg = GL_NONE; + Evas_GL_Program *p = NULL; + Eina_Bool direct = 1; - if (!ef) return res; + if (!ef || !glsym_glProgramBinary) return NULL; - data = eet_read(ef, pname, &length); + sprintf(pname, SHADER_PROG_NAME_FMT, flags); + data = (void *) eet_read_direct(ef, pname, &length); + if (!data) + { + data = eet_read(ef, pname, &length); + direct = 0; + } if ((!data) || (length <= 0)) goto finish; glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &num); @@ -63,58 +125,62 @@ _evas_gl_common_shader_program_binary_init(Evas_GL_Program *p, glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, formats); if (!formats[0]) goto finish; - p->prog = glCreateProgram(); + prg = glCreateProgram(); #if 1 // TODO: invalid rendering error occurs when attempting to use a // glProgramBinary. in order to render correctly we should create a dummy // vertex shader. - p->vert = glCreateShader(GL_VERTEX_SHADER); - glAttachShader(p->prog, p->vert); - p->frag = glCreateShader(GL_FRAGMENT_SHADER); - glAttachShader(p->prog, p->frag); + vtx = glCreateShader(GL_VERTEX_SHADER); + glAttachShader(prg, vtx); + frg = glCreateShader(GL_FRAGMENT_SHADER); + glAttachShader(prg, frg); #endif - glsym_glProgramBinary(p->prog, formats[0], data, length); + glsym_glProgramBinary(prg, formats[0], data, length); - glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex"); - glBindAttribLocation(p->prog, SHAD_COLOR, "color"); - glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord"); - glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2"); - glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3"); - glBindAttribLocation(p->prog, SHAD_TEXA, "tex_coorda"); - glBindAttribLocation(p->prog, SHAD_TEXSAM, "tex_sample"); - glBindAttribLocation(p->prog, SHAD_MASK, "mask_coord"); - glBindAttribLocation(p->prog, SHAD_MASKSAM, "tex_masksample"); + glBindAttribLocation(prg, SHAD_VERTEX, "vertex"); + glBindAttribLocation(prg, SHAD_COLOR, "color"); + glBindAttribLocation(prg, SHAD_TEXUV, "tex_coord"); + glBindAttribLocation(prg, SHAD_TEXUV2, "tex_coord2"); + glBindAttribLocation(prg, SHAD_TEXUV3, "tex_coord3"); + glBindAttribLocation(prg, SHAD_TEXA, "tex_coorda"); + glBindAttribLocation(prg, SHAD_TEXSAM, "tex_sample"); + glBindAttribLocation(prg, SHAD_MASK, "mask_coord"); + glBindAttribLocation(prg, SHAD_MASKSAM, "tex_masksample"); - glGetProgramiv(p->prog, GL_LINK_STATUS, &ok); + glGetProgramiv(prg, GL_LINK_STATUS, &ok); if (!ok) { - gl_compile_link_error(p->prog, "load a program object"); + gl_compile_link_error(prg, "load a program object"); ERR("Abort load of program (%s)", pname); + glDeleteProgram(prg); + glDeleteShader(vtx); + glDeleteShader(frg); goto finish; } - res = 1; + p = calloc(1, sizeof(*p)); + p->flags = flags; + p->prog = prg; + p->vert = vtx; + p->frag = frg; + p->reset = EINA_TRUE; + p->bin_saved = EINA_TRUE; + evas_gl_common_shader_textures_bind(p); finish: - if (formats) free(formats); - if (data) free(data); - if ((!res) && (p->prog)) - { - glDeleteProgram(p->prog); - p->prog = 0; - } - return res; + free(formats); + if (!direct) free(data); + return p; } static int -_evas_gl_common_shader_program_binary_save(Evas_GL_Program *p, - const char *pname, - Eet_File *ef) +_evas_gl_common_shader_program_binary_save(Evas_GL_Program *p, Eet_File *ef) { void* data = NULL; GLenum format; int length = 0, size = 0; + char pname[32]; if (!glsym_glGetProgramBinary) return 0; @@ -132,133 +198,47 @@ _evas_gl_common_shader_program_binary_save(Evas_GL_Program *p, return 0; } - if (eet_write(ef, pname, data, length, 1) < 0) + sprintf(pname, SHADER_PROG_NAME_FMT, p->flags); + if (eet_write(ef, pname, data, length, SHADER_BINARY_EET_COMPRESS) < 0) { - if (data) free(data); - return 0; - } - if (data) free(data); - return 1; -} - -static int -_evas_gl_common_shader_program_source_init(Evas_GL_Program *p, - const char *vert, - const char *frag, - const char *name) -{ - GLint ok; - - p->vert = glCreateShader(GL_VERTEX_SHADER); - p->frag = glCreateShader(GL_FRAGMENT_SHADER); - - glShaderSource(p->vert, 1, &vert, NULL); - glCompileShader(p->vert); - ok = 0; - glGetShaderiv(p->vert, GL_COMPILE_STATUS, &ok); - if (!ok) - { - gl_compile_link_error(p->vert, "compile vertex shader"); - ERR("Abort compile of shader vert (%s): %s", name, vert); - return 0; - } - glShaderSource(p->frag, 1, &frag, NULL); - glCompileShader(p->frag); - ok = 0; - glGetShaderiv(p->frag, GL_COMPILE_STATUS, &ok); - if (!ok) - { - gl_compile_link_error(p->frag, "compile fragment shader"); - ERR("Abort compile of shader frag (%s): %s", name, frag); + free(data); return 0; } - p->prog = glCreateProgram(); -#ifdef GL_GLES -#else - if ((glsym_glGetProgramBinary) && (glsym_glProgramParameteri)) - { - glsym_glProgramParameteri(p->prog, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, - GL_TRUE); - } -#endif - glAttachShader(p->prog, p->vert); - glAttachShader(p->prog, p->frag); - - glBindAttribLocation(p->prog, SHAD_VERTEX, "vertex"); - glBindAttribLocation(p->prog, SHAD_COLOR, "color"); - glBindAttribLocation(p->prog, SHAD_TEXUV, "tex_coord"); - glBindAttribLocation(p->prog, SHAD_TEXUV2, "tex_coord2"); - glBindAttribLocation(p->prog, SHAD_TEXUV3, "tex_coord3"); - glBindAttribLocation(p->prog, SHAD_TEXA, "tex_coorda"); - glBindAttribLocation(p->prog, SHAD_TEXSAM, "tex_sample"); - glBindAttribLocation(p->prog, SHAD_MASK, "mask_coord"); - glBindAttribLocation(p->prog, SHAD_MASKSAM, "tex_masksample"); - - glLinkProgram(p->prog); - ok = 0; - glGetProgramiv(p->prog, GL_LINK_STATUS, &ok); - if (!ok) - { - gl_compile_link_error(p->prog, "link fragment and vertex shaders"); - ERR("Abort compile of shader frag (%s): %s", name, frag); - ERR("Abort compile of shader vert (%s): %s", name, vert); - return 0; - } - - return 1; -} - -static int -_evas_gl_common_shader_source_init(Evas_GL_Shared *shared) -{ - unsigned int i; - - for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); i++) - { - if (!_evas_gl_common_shader_program_source_init - (&(shared->shader[_shaders_source[i].id]), - _shaders_source[i].vert, - _shaders_source[i].frag, - _shaders_source[i].name)) - return 0; - } + free(data); + p->bin_saved = 1; return 1; } static int _evas_gl_common_shader_binary_init(Evas_GL_Shared *shared) { - /* check eet */ - Eet_File *et = NULL; + Eet_File *ef = NULL; char bin_dir_path[PATH_MAX]; char bin_file_path[PATH_MAX]; - unsigned int i; + + if (!shared || !shared->info.bin_program) + return 1; + + if (shared->shaders_cache) + return 1; if (!evas_gl_common_file_cache_dir_check(bin_dir_path, sizeof(bin_dir_path))) - return 0; + return 0; if (!evas_gl_common_file_cache_file_check(bin_dir_path, "binary_shader", bin_file_path, - sizeof(bin_dir_path))) - return 0; + sizeof(bin_dir_path))) + return 0; - /* use eet */ if (!eet_init()) return 0; - et = eet_open(bin_file_path, EET_FILE_MODE_READ); - if (!et) goto error; + ef = eet_open(bin_file_path, EET_FILE_MODE_READ); + if (!ef) goto error; - for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); ++i) - if (!_evas_gl_common_shader_program_binary_init(&(shared->shader[_shaders_source[i].id]), - _shaders_source[i].name, - et)) - goto error; - - if (et) eet_close(et); - eet_shutdown(); + shared->shaders_cache = ef; return 1; error: - if (et) eet_close(et); + if (ef) eet_close(ef); eet_shutdown(); return 0; } @@ -266,14 +246,16 @@ error: static int _evas_gl_common_shader_binary_save(Evas_GL_Shared *shared) { - /* check eet */ - Eet_File *et = NULL; //check eet file - int tmpfd; - int res = 0; + // FIXME: Save should happen early, before shutdown. + char bin_dir_path[PATH_MAX]; char bin_file_path[PATH_MAX]; char tmp_file[PATH_MAX]; - unsigned int i; + int tmpfd, res = 0, copy; + Eet_File *ef = NULL; + Evas_GL_Program *p; + Eina_Iterator *it; + char pname[32]; if (!evas_gl_common_file_cache_dir_check(bin_dir_path, sizeof(bin_dir_path))) { @@ -281,8 +263,8 @@ _evas_gl_common_shader_binary_save(Evas_GL_Shared *shared) if (!res) return 0; /* we can't make directory */ } - evas_gl_common_file_cache_file_check(bin_dir_path, "binary_shader", bin_file_path, - sizeof(bin_dir_path)); + copy = evas_gl_common_file_cache_file_check(bin_dir_path, "binary_shader", bin_file_path, + sizeof(bin_dir_path)); /* use mkstemp for writing */ snprintf(tmp_file, sizeof(tmp_file), "%s.XXXXXX", bin_file_path); @@ -295,49 +277,97 @@ _evas_gl_common_shader_binary_save(Evas_GL_Shared *shared) umask(old_umask); #endif - if (tmpfd < 0) goto error; + if (tmpfd < 0) return 0; close(tmpfd); /* use eet */ - if (!eet_init()) goto error; + if (!eet_init()) return 0; - et = eet_open(tmp_file, EET_FILE_MODE_WRITE); - if (!et) goto error; + /* copy old file */ + if (copy) + eina_file_copy(bin_file_path, tmp_file, EINA_FILE_COPY_DATA, NULL, NULL); - for (i = 0; i < sizeof (_shaders_source) / sizeof (_shaders_source[0]); ++i) - if (!_evas_gl_common_shader_program_binary_save(&(shared->shader[_shaders_source[i].id]), - _shaders_source[i].name, - et)) - goto error; + ef = eet_open(tmp_file, EET_FILE_MODE_READ_WRITE); + if (!ef) goto error; - if (eet_close(et) != EET_ERROR_NONE) goto error; - if (rename(tmp_file,bin_file_path) < 0) goto error; + it = eina_hash_iterator_data_new(shared->shaders_hash); + EINA_ITERATOR_FOREACH(it, p) + { + if (!p->bin_saved) + { + int len = 0; + sprintf(pname, SHADER_PROG_NAME_FMT, p->flags); + eet_read_direct(ef, pname, &len); + if (len > 0) + p->bin_saved = 1; // assume bin data is correct + else + _evas_gl_common_shader_program_binary_save(p, ef); + } + } + eina_iterator_free(it); + + if (shared->shaders_cache) + { + eet_close(shared->shaders_cache); + shared->shaders_cache = NULL; + eet_shutdown(); + } + + if (eet_close(ef) != EET_ERROR_NONE) goto error; + if (rename(tmp_file, bin_file_path) < 0) goto error; eet_shutdown(); return 1; error: - if (et) eet_close(et); + if (ef) eet_close(ef); if (evas_gl_common_file_cache_file_exists(tmp_file)) unlink(tmp_file); eet_shutdown(); return 0; } +static void +_shaders_hash_free_cb(void *data) +{ + Evas_GL_Program *p = data; + if (p->vert) glDeleteShader(p->vert); + if (p->frag) glDeleteShader(p->frag); + if (p->prog) glDeleteProgram(p->prog); + free(p); +} + int evas_gl_common_shader_program_init(Evas_GL_Shared *shared) { - // gl support binary shader and get env of binary shader path - if (shared->info.bin_program && - _evas_gl_common_shader_binary_init(shared)) return 1; - /* compile all shader.*/ - if (!_evas_gl_common_shader_source_init(shared)) return 0; - /* success compile all shader. if gl support binary shader, we need to save */ - if (shared->info.bin_program) _evas_gl_common_shader_binary_save(shared); + /* most popular shaders */ + const int BGRA = (shared->info.bgra ? SHADER_FLAG_BGRA : 0); + const int autoload[] = { + /* rect */ BASEFLAG, + /* text */ BASEFLAG | SHADER_FLAG_TEX | SHADER_FLAG_ALPHA, + /* img1 */ BASEFLAG | SHADER_FLAG_TEX | SHADER_FLAG_IMG | BGRA, + /* img2 */ BASEFLAG | SHADER_FLAG_TEX | SHADER_FLAG_IMG | SHADER_FLAG_NOMUL | BGRA, + }; + unsigned i; + + shared->shaders_hash = eina_hash_int32_new(_shaders_hash_free_cb); + if (_evas_gl_common_shader_binary_init(shared)) + { + for (i = 0; i < (sizeof(autoload) / sizeof(autoload[0])); i++) + { + Evas_GL_Program *p; + + p = _evas_gl_common_shader_program_binary_load(shared->shaders_cache, autoload[i]); + if (p) eina_hash_add(shared->shaders_hash, &autoload[i], p); + } + } + return 1; } void evas_gl_common_shader_program_init_done(void) { +#warning FIXME: Disabled compiler unload for now. + return; #ifdef GL_GLES glReleaseShaderCompiler(); #else @@ -347,69 +377,361 @@ evas_gl_common_shader_program_init_done(void) } void -evas_gl_common_shader_program_shutdown(Evas_GL_Program *p) +evas_gl_common_shader_program_shutdown(Evas_GL_Shared *shared) { - if (p->vert) glDeleteShader(p->vert); - if (p->frag) glDeleteShader(p->frag); - if (p->prog) glDeleteProgram(p->prog); -} + if (!shared) return; -Evas_GL_Shader -evas_gl_common_img_shader_select(Shader_Type type, Shader_Sampling sam, int nomul, int afill, int bgra, int mask, int masksam) -{ - // 256 combinaisons including many impossible - static Evas_GL_Shader _shaders[4 * 2 * 2 * 2 * 2 * 4 * 2]; - static Eina_Bool init = EINA_FALSE; - int idx; + if (shared->info.bin_program) + _evas_gl_common_shader_binary_save(shared); - if (EINA_UNLIKELY(!init)) + if (shared->shaders_cache) { - unsigned int k; - - init = EINA_TRUE; - for (k = 0; k < (sizeof(_shaders) / sizeof(_shaders[0])); k++) - _shaders[k] = SHADER_IMG; - - for (k = 0; k < (sizeof(_shaders_source) / sizeof(_shaders_source[0])); k++) - { - if (_shaders_source[k].type == SHD_IMAGE) - { - idx = _shaders_source[k].sam << 6; // 2 bits - idx |= _shaders_source[k].masksam << 4; // 2 bits - idx |= _shaders_source[k].bgra << 3; // bool - idx |= _shaders_source[k].mask << 2; // bool - idx |= _shaders_source[k].nomul << 1; // bool - idx |= _shaders_source[k].afill; // bool - _shaders[idx] = _shaders_source[k].id; - } - else if (_shaders_source[k].type == SHD_IMAGENATIVE) - { - idx = _shaders_source[k].sam << 6; // 2 bits - idx |= _shaders_source[k].masksam << 4; // 2 bits - idx |= _shaders_source[k].bgra << 3; // bool - idx |= _shaders_source[k].mask << 2; // bool - idx |= _shaders_source[k].nomul << 1; // bool - idx |= _shaders_source[k].afill; // bool - idx += (4 * 2 * 2 * 2 * 2 * 4); - _shaders[idx] = _shaders_source[k].id; - } - } + eet_close(shared->shaders_cache); + shared->shaders_cache = NULL; + eet_shutdown(); } - idx = sam << 6; - idx |= masksam << 4; - idx |= bgra << 3; - idx |= mask << 2; - idx |= nomul << 1; - idx |= afill; - if (type == SHD_IMAGENATIVE) idx += (4 * 2 * 2 * 2 * 2 * 4); - return _shaders[idx]; + eina_hash_free(shared->shaders_hash); + shared->shaders_hash = NULL; } -const char * -evas_gl_common_shader_name_get(Evas_GL_Shader shd) +static inline unsigned int +evas_gl_common_shader_flags_get(Evas_GL_Shared *shared, Shader_Type type, + RGBA_Map_Point *map_points, int npoints, + int r, int g, int b, int a, + int sw, int sh, int w, int h, Eina_Bool smooth, + Evas_GL_Texture *tex, Eina_Bool tex_only, + Evas_GL_Texture *mtex, Eina_Bool mask_smooth, + int mw, int mh, + Shader_Sampling *psam, int *pnomul, Shader_Sampling *pmasksam) { - if (shd < (sizeof(_shaders_source) / sizeof(_shaders_source[0]))) - return _shaders_source[shd].name; - return "UNKNOWN"; + Shader_Sampling sam = SHD_SAM11, masksam = SHD_SAM11; + int nomul = 1, bgra = 0, afill = 0, k; + unsigned int flags = BASEFLAG; + + // image downscale sampling + if (smooth && ((type == SHD_IMAGE) || (type == SHD_IMAGENATIVE))) + { + if ((sw >= (w * 2)) && (sh >= (h * 2))) + sam = SHD_SAM22; + else if (sw >= (w * 2)) + sam = SHD_SAM21; + else if (sh >= (h * 2)) + sam = SHD_SAM12; + flags |= (1 << (SHADER_FLAG_SAM_BITSHIFT + sam - 1)); + } + + // mask downscale sampling + if (mtex && mask_smooth) + { + if ((mtex->w >= (mw * 2)) && (mtex->h >= (mh * 2))) + masksam = SHD_SAM22; + else if (mtex->w >= (mw * 2)) + masksam = SHD_SAM21; + else if (mtex->h >= (mh * 2)) + masksam = SHD_SAM12; + flags |= (1 << (SHADER_FLAG_MASKSAM_BITSHIFT + masksam - 1)); + } + + switch (type) + { + case SHD_RECT: + case SHD_LINE: + goto end; + case SHD_FONT: + flags |= (SHADER_FLAG_ALPHA | SHADER_FLAG_TEX); + goto end; + case SHD_IMAGE: + flags |= SHADER_FLAG_IMG; + break; + case SHD_IMAGENATIVE: + break; + case SHD_YUV: + flags |= SHADER_FLAG_YUV; + break; + case SHD_YUY2: + flags |= SHADER_FLAG_YUY2; + break; + case SHD_NV12: + flags |= SHADER_FLAG_NV12; + break; + case SHD_YUV_709: + flags |= (SHADER_FLAG_YUV_709 | SHADER_FLAG_YUV); + break; + case SHD_RGB_A_PAIR: + case SHD_MAP: + break; + default: + CRI("Impossible shader type."); + return 0; + } + + // color mul + if ((a == 255) && (r == 255) && (g == 255) && (b == 255)) + { + if (map_points) + { + for (k = 0; k < npoints; k++) + if (map_points[k].col != 0xffffffff) + { + nomul = 0; + break; + } + } + } + else + nomul = 0; + + if (nomul) + flags |= SHADER_FLAG_NOMUL; + + // bgra + if (tex_only) + { + if (tex->pt->dyn.img) + { + afill = !tex->alpha; + bgra = 1; + } + else if (tex->im && tex->im->native.target == GL_TEXTURE_EXTERNAL_OES) + { + flags |= SHADER_FLAG_EXTERNAL; + afill = !tex->alpha; + } + else + bgra = 1; + } + else + bgra = shared->info.bgra; + + if (tex) + flags |= SHADER_FLAG_TEX; + + if (mtex) + flags |= SHADER_FLAG_MASK; + + if (afill) + flags |= SHADER_FLAG_AFILL; + + if (bgra) + flags |= SHADER_FLAG_BGRA; + +end: + if (psam) *psam = sam; + if (pnomul) *pnomul = nomul; + if (pmasksam) *pmasksam = masksam; + return flags; +} + +static char * +evas_gl_common_shader_glsl_get(unsigned int flags, const char *base) +{ + Eina_Strbuf *s = eina_strbuf_new(); + unsigned int k; + char *str; + + for (k = 0; k < SHADER_FLAG_COUNT; k++) + { + if (flags & (1 << k)) + eina_strbuf_append_printf(s, "#define SHD_%s\n", _shader_flags[k]); + } + + eina_strbuf_append(s, base); + str = eina_strbuf_string_steal(s); + eina_strbuf_free(s); + return str; +} + +static Evas_GL_Program * +evas_gl_common_shader_compile(unsigned int flags, const char *vertex, + const char *fragment) +{ + Evas_GL_Program *p; + GLuint vtx, frg, prg; + GLint ok = 0; + + vtx = glCreateShader(GL_VERTEX_SHADER); + frg = glCreateShader(GL_FRAGMENT_SHADER); + + glShaderSource(vtx, 1, &vertex, NULL); + glCompileShader(vtx); + glGetShaderiv(vtx, GL_COMPILE_STATUS, &ok); + if (!ok) + { + gl_compile_link_error(vtx, "compile vertex shader"); + ERR("Abort compile of vertex shader:\n%s", vertex); + glDeleteShader(vtx); + return NULL; + } + ok = 0; + + glShaderSource(frg, 1, &fragment, NULL); + glCompileShader(frg); + glGetShaderiv(frg, GL_COMPILE_STATUS, &ok); + if (!ok) + { + gl_compile_link_error(frg, "compile fragment shader"); + ERR("Abort compile of fragment shader:\n%s", fragment); + glDeleteShader(vtx); + glDeleteShader(frg); + return NULL; + } + ok = 0; + + prg = glCreateProgram(); +#ifndef GL_GLES + if ((glsym_glGetProgramBinary) && (glsym_glProgramParameteri)) + glsym_glProgramParameteri(prg, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, GL_TRUE); +#endif + glAttachShader(prg, vtx); + glAttachShader(prg, frg); + + glBindAttribLocation(prg, SHAD_VERTEX, "vertex"); + glBindAttribLocation(prg, SHAD_COLOR, "color"); + glBindAttribLocation(prg, SHAD_TEXUV, "tex_coord"); + glBindAttribLocation(prg, SHAD_TEXUV2, "tex_coord2"); + glBindAttribLocation(prg, SHAD_TEXUV3, "tex_coord3"); + glBindAttribLocation(prg, SHAD_TEXA, "tex_coorda"); + glBindAttribLocation(prg, SHAD_TEXSAM, "tex_sample"); + glBindAttribLocation(prg, SHAD_MASK, "mask_coord"); + glBindAttribLocation(prg, SHAD_MASKSAM, "tex_masksample"); + + glLinkProgram(prg); + glGetProgramiv(prg, GL_LINK_STATUS, &ok); + if (!ok) + { + gl_compile_link_error(prg, "link fragment and vertex shaders"); + ERR("Abort compile of shader (flags: %#x)", flags); + glDeleteShader(vtx); + glDeleteShader(frg); + glDeleteProgram(prg); + return 0; + } + + p = calloc(1, sizeof(*p)); + p->flags = flags; + p->prog = prg; + p->vert = vtx; + p->frag = frg; + p->reset = EINA_TRUE; + + return p; +} + +void +evas_gl_common_shader_textures_bind(Evas_GL_Program *p) +{ + struct { + const char *name; + int enabled; + } textures[] = { + { "tex", 0 }, + { "texm", 0 }, + { "texa", 0 }, + { "texu", 0 }, + { "texv", 0 }, + { "texuv", 0 }, + { NULL, 0 } + }; + Eina_Bool hastex = 0; + GLint loc; + int i; + + if (!p || (p->tex_count > 0)) return; + + if ((p->flags & SHADER_FLAG_TEX) != 0) + { + textures[0].enabled = 1; + hastex = 1; + } + if ((p->flags & SHADER_FLAG_MASK) != 0) + { + textures[1].enabled = 1; + hastex = 1; + } + if ((p->flags & SHADER_FLAG_RGB_A_PAIR) != 0) + { + textures[2].enabled = 1; + hastex = 1; + } + if (p->flags & SHADER_FLAG_YUV) + { + textures[3].enabled = 1; + textures[4].enabled = 1; + hastex = 1; + } + else if ((p->flags & SHADER_FLAG_NV12) || (p->flags & SHADER_FLAG_YUY2)) + { + textures[5].enabled = 1; + hastex = 1; + } + + if (hastex) + { + glUseProgram(p->prog); // is this necessary?? + for (i = 0; textures[i].name; i++) + { + if (!textures[i].enabled) continue; + loc = glGetUniformLocation(p->prog, textures[i].name); + if (loc < 0) + { + ERR("Couldn't find uniform '%s' (shader: %#x)", + textures[i].name, p->flags); + } + glUniform1i(loc, p->tex_count++); + } + } +} + +Evas_GL_Program * +evas_gl_common_shader_program_get(Evas_Engine_GL_Context *gc, + Shader_Type type, + RGBA_Map_Point *map_points, int npoints, + int r, int g, int b, int a, + int sw, int sh, int w, int h, Eina_Bool smooth, + Evas_GL_Texture *tex, Eina_Bool tex_only, + Evas_GL_Texture *mtex, Eina_Bool mask_smooth, + int mw, int mh, + Shader_Sampling *psam, int *pnomul, + Shader_Sampling *pmasksam) +{ + unsigned int flags; + Evas_GL_Program *p; + + flags = evas_gl_common_shader_flags_get(gc->shared, type, map_points, npoints, r, g, b, a, + sw, sh, w, h, smooth, tex, tex_only, + mtex, mask_smooth, mw, mh, + psam, pnomul, pmasksam); + p = eina_hash_find(gc->shared->shaders_hash, &flags); + if (!p) + { + char *vertex, *fragment; + + _evas_gl_common_shader_binary_init(gc->shared); + if (gc->shared->shaders_cache) + { + char pname[32]; + sprintf(pname, SHADER_PROG_NAME_FMT, flags); + p = _evas_gl_common_shader_program_binary_load(gc->shared->shaders_cache, flags); + if (p) + { + eina_hash_add(gc->shared->shaders_hash, &flags, p); + goto end; + } + } + + vertex = evas_gl_common_shader_glsl_get(flags, vertex_glsl); + fragment = evas_gl_common_shader_glsl_get(flags, fragment_glsl); + + p = evas_gl_common_shader_compile(flags, vertex, fragment); + evas_gl_common_shader_textures_bind(p); + eina_hash_add(gc->shared->shaders_hash, &flags, p); + + free(vertex); + free(fragment); + } +end: + if (p->hitcount < PROGRAM_HITCOUNT_MAX) + p->hitcount++; + return p; } diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x b/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x deleted file mode 100644 index 41d372ac74..0000000000 --- a/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x +++ /dev/null @@ -1,595 +0,0 @@ -/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */ -/* IF IT IS CHANGED PLEASE COMMIT THE CHANGES */ - -typedef enum { - SHADER_RECT, - SHADER_RECT_MASK, - SHADER_RECT_MASK12, - SHADER_RECT_MASK21, - SHADER_RECT_MASK22, - SHADER_FONT, - SHADER_FONT_MASK, - SHADER_FONT_MASK12, - SHADER_FONT_MASK21, - SHADER_FONT_MASK22, - SHADER_IMG, - SHADER_IMG_BGRA, - SHADER_IMG_12, - SHADER_IMG_21, - SHADER_IMG_22, - SHADER_IMG_12_BGRA, - SHADER_IMG_21_BGRA, - SHADER_IMG_22_BGRA, - SHADER_IMG_MASK, - SHADER_IMG_BGRA_MASK, - SHADER_IMG_12_MASK, - SHADER_IMG_21_MASK, - SHADER_IMG_22_MASK, - SHADER_IMG_12_BGRA_MASK, - SHADER_IMG_21_BGRA_MASK, - SHADER_IMG_22_BGRA_MASK, - SHADER_IMG_NOMUL, - SHADER_IMG_BGRA_NOMUL, - SHADER_IMG_12_NOMUL, - SHADER_IMG_21_NOMUL, - SHADER_IMG_22_NOMUL, - SHADER_IMG_12_BGRA_NOMUL, - SHADER_IMG_21_BGRA_NOMUL, - SHADER_IMG_22_BGRA_NOMUL, - SHADER_IMG_MASK_NOMUL, - SHADER_IMG_BGRA_MASK_NOMUL, - SHADER_IMG_12_MASK_NOMUL, - SHADER_IMG_21_MASK_NOMUL, - SHADER_IMG_22_MASK_NOMUL, - SHADER_IMG_12_BGRA_MASK_NOMUL, - SHADER_IMG_21_BGRA_MASK_NOMUL, - SHADER_IMG_22_BGRA_MASK_NOMUL, - SHADER_IMG_MASK12, - SHADER_IMG_BGRA_MASK12, - SHADER_IMG_12_MASK12, - SHADER_IMG_21_MASK12, - SHADER_IMG_22_MASK12, - SHADER_IMG_12_BGRA_MASK12, - SHADER_IMG_21_BGRA_MASK12, - SHADER_IMG_22_BGRA_MASK12, - SHADER_IMG_MASK12_NOMUL, - SHADER_IMG_BGRA_MASK12_NOMUL, - SHADER_IMG_12_MASK12_NOMUL, - SHADER_IMG_21_MASK12_NOMUL, - SHADER_IMG_22_MASK12_NOMUL, - SHADER_IMG_12_BGRA_MASK12_NOMUL, - SHADER_IMG_21_BGRA_MASK12_NOMUL, - SHADER_IMG_22_BGRA_MASK12_NOMUL, - SHADER_IMG_MASK21, - SHADER_IMG_BGRA_MASK21, - SHADER_IMG_12_MASK21, - SHADER_IMG_21_MASK21, - SHADER_IMG_22_MASK21, - SHADER_IMG_12_BGRA_MASK21, - SHADER_IMG_21_BGRA_MASK21, - SHADER_IMG_22_BGRA_MASK21, - SHADER_IMG_MASK21_NOMUL, - SHADER_IMG_BGRA_MASK21_NOMUL, - SHADER_IMG_12_MASK21_NOMUL, - SHADER_IMG_21_MASK21_NOMUL, - SHADER_IMG_22_MASK21_NOMUL, - SHADER_IMG_12_BGRA_MASK21_NOMUL, - SHADER_IMG_21_BGRA_MASK21_NOMUL, - SHADER_IMG_22_BGRA_MASK21_NOMUL, - SHADER_IMG_MASK22, - SHADER_IMG_BGRA_MASK22, - SHADER_IMG_12_MASK22, - SHADER_IMG_21_MASK22, - SHADER_IMG_22_MASK22, - SHADER_IMG_12_BGRA_MASK22, - SHADER_IMG_21_BGRA_MASK22, - SHADER_IMG_22_BGRA_MASK22, - SHADER_IMG_MASK22_NOMUL, - SHADER_IMG_BGRA_MASK22_NOMUL, - SHADER_IMG_12_MASK22_NOMUL, - SHADER_IMG_21_MASK22_NOMUL, - SHADER_IMG_22_MASK22_NOMUL, - SHADER_IMG_12_BGRA_MASK22_NOMUL, - SHADER_IMG_21_BGRA_MASK22_NOMUL, - SHADER_IMG_22_BGRA_MASK22_NOMUL, - SHADER_IMG_AFILL, - SHADER_IMG_BGRA_AFILL, - SHADER_IMG_NOMUL_AFILL, - SHADER_IMG_BGRA_NOMUL_AFILL, - SHADER_IMG_12_AFILL, - SHADER_IMG_21_AFILL, - SHADER_IMG_22_AFILL, - SHADER_IMG_12_BGRA_AFILL, - SHADER_IMG_21_BGRA_AFILL, - SHADER_IMG_22_BGRA_AFILL, - SHADER_IMG_12_NOMUL_AFILL, - SHADER_IMG_21_NOMUL_AFILL, - SHADER_IMG_22_NOMUL_AFILL, - SHADER_IMG_12_BGRA_NOMUL_AFILL, - SHADER_IMG_21_BGRA_NOMUL_AFILL, - SHADER_IMG_22_BGRA_NOMUL_AFILL, - SHADER_IMGNAT, - SHADER_IMGNAT_BGRA, - SHADER_IMGNAT_12, - SHADER_IMGNAT_21, - SHADER_IMGNAT_22, - SHADER_IMGNAT_12_BGRA, - SHADER_IMGNAT_21_BGRA, - SHADER_IMGNAT_22_BGRA, - SHADER_IMGNAT_MASK, - SHADER_IMGNAT_BGRA_MASK, - SHADER_IMGNAT_12_MASK, - SHADER_IMGNAT_21_MASK, - SHADER_IMGNAT_22_MASK, - SHADER_IMGNAT_12_BGRA_MASK, - SHADER_IMGNAT_21_BGRA_MASK, - SHADER_IMGNAT_22_BGRA_MASK, - SHADER_IMGNAT_NOMUL, - SHADER_IMGNAT_BGRA_NOMUL, - SHADER_IMGNAT_12_NOMUL, - SHADER_IMGNAT_21_NOMUL, - SHADER_IMGNAT_22_NOMUL, - SHADER_IMGNAT_12_BGRA_NOMUL, - SHADER_IMGNAT_21_BGRA_NOMUL, - SHADER_IMGNAT_22_BGRA_NOMUL, - SHADER_IMGNAT_MASK_NOMUL, - SHADER_IMGNAT_BGRA_MASK_NOMUL, - SHADER_IMGNAT_12_MASK_NOMUL, - SHADER_IMGNAT_21_MASK_NOMUL, - SHADER_IMGNAT_22_MASK_NOMUL, - SHADER_IMGNAT_12_BGRA_MASK_NOMUL, - SHADER_IMGNAT_21_BGRA_MASK_NOMUL, - SHADER_IMGNAT_22_BGRA_MASK_NOMUL, - SHADER_IMGNAT_MASK12, - SHADER_IMGNAT_BGRA_MASK12, - SHADER_IMGNAT_12_MASK12, - SHADER_IMGNAT_21_MASK12, - SHADER_IMGNAT_22_MASK12, - SHADER_IMGNAT_12_BGRA_MASK12, - SHADER_IMGNAT_21_BGRA_MASK12, - SHADER_IMGNAT_22_BGRA_MASK12, - SHADER_IMGNAT_MASK12_NOMUL, - SHADER_IMGNAT_BGRA_MASK12_NOMUL, - SHADER_IMGNAT_12_MASK12_NOMUL, - SHADER_IMGNAT_21_MASK12_NOMUL, - SHADER_IMGNAT_22_MASK12_NOMUL, - SHADER_IMGNAT_12_BGRA_MASK12_NOMUL, - SHADER_IMGNAT_21_BGRA_MASK12_NOMUL, - SHADER_IMGNAT_22_BGRA_MASK12_NOMUL, - SHADER_IMGNAT_MASK21, - SHADER_IMGNAT_BGRA_MASK21, - SHADER_IMGNAT_12_MASK21, - SHADER_IMGNAT_21_MASK21, - SHADER_IMGNAT_22_MASK21, - SHADER_IMGNAT_12_BGRA_MASK21, - SHADER_IMGNAT_21_BGRA_MASK21, - SHADER_IMGNAT_22_BGRA_MASK21, - SHADER_IMGNAT_MASK21_NOMUL, - SHADER_IMGNAT_BGRA_MASK21_NOMUL, - SHADER_IMGNAT_12_MASK21_NOMUL, - SHADER_IMGNAT_21_MASK21_NOMUL, - SHADER_IMGNAT_22_MASK21_NOMUL, - SHADER_IMGNAT_12_BGRA_MASK21_NOMUL, - SHADER_IMGNAT_21_BGRA_MASK21_NOMUL, - SHADER_IMGNAT_22_BGRA_MASK21_NOMUL, - SHADER_IMGNAT_MASK22, - SHADER_IMGNAT_BGRA_MASK22, - SHADER_IMGNAT_12_MASK22, - SHADER_IMGNAT_21_MASK22, - SHADER_IMGNAT_22_MASK22, - SHADER_IMGNAT_12_BGRA_MASK22, - SHADER_IMGNAT_21_BGRA_MASK22, - SHADER_IMGNAT_22_BGRA_MASK22, - SHADER_IMGNAT_MASK22_NOMUL, - SHADER_IMGNAT_BGRA_MASK22_NOMUL, - SHADER_IMGNAT_12_MASK22_NOMUL, - SHADER_IMGNAT_21_MASK22_NOMUL, - SHADER_IMGNAT_22_MASK22_NOMUL, - SHADER_IMGNAT_12_BGRA_MASK22_NOMUL, - SHADER_IMGNAT_21_BGRA_MASK22_NOMUL, - SHADER_IMGNAT_22_BGRA_MASK22_NOMUL, - SHADER_IMGNAT_AFILL, - SHADER_IMGNAT_BGRA_AFILL, - SHADER_IMGNAT_NOMUL_AFILL, - SHADER_IMGNAT_BGRA_NOMUL_AFILL, - SHADER_IMGNAT_12_AFILL, - SHADER_IMGNAT_21_AFILL, - SHADER_IMGNAT_22_AFILL, - SHADER_IMGNAT_12_BGRA_AFILL, - SHADER_IMGNAT_21_BGRA_AFILL, - SHADER_IMGNAT_22_BGRA_AFILL, - SHADER_IMGNAT_12_NOMUL_AFILL, - SHADER_IMGNAT_21_NOMUL_AFILL, - SHADER_IMGNAT_22_NOMUL_AFILL, - SHADER_IMGNAT_12_BGRA_NOMUL_AFILL, - SHADER_IMGNAT_21_BGRA_NOMUL_AFILL, - SHADER_IMGNAT_22_BGRA_NOMUL_AFILL, - SHADER_RGB_A_PAIR, - SHADER_RGB_A_PAIR_MASK, - SHADER_RGB_A_PAIR_NOMUL, - SHADER_RGB_A_PAIR_MASK_NOMUL, - SHADER_TEX_EXTERNAL, - SHADER_TEX_EXTERNAL_AFILL, - SHADER_TEX_EXTERNAL_NOMUL, - SHADER_TEX_EXTERNAL_NOMUL_AFILL, - SHADER_TEX_EXTERNAL_MASK, - SHADER_TEX_EXTERNAL_MASK_NOMUL, - SHADER_YUV, - SHADER_YUV_NOMUL, - SHADER_YUV_MASK, - SHADER_YUV_MASK_NOMUL, - SHADER_YUY2, - SHADER_YUY2_NOMUL, - SHADER_YUY2_MASK, - SHADER_YUY2_MASK_NOMUL, - SHADER_NV12, - SHADER_NV12_NOMUL, - SHADER_NV12_MASK, - SHADER_NV12_MASK_NOMUL, - SHADER_YUV_709, - SHADER_YUV_709_NOMUL, - SHADER_YUV_709_MASK, - SHADER_YUV_709_MASK_NOMUL, - SHADER_YUY2_709, - SHADER_YUY2_709_NOMUL, - SHADER_YUY2_709_MASK, - SHADER_YUY2_709_MASK_NOMUL, - SHADER_NV12_709, - SHADER_NV12_709_NOMUL, - SHADER_NV12_709_MASK, - SHADER_NV12_709_MASK_NOMUL, - SHADER_LAST -} Evas_GL_Shader; - -#ifdef _EVAS_GL_CONTEXT_C - -static struct { - Evas_GL_Shader id; - const char *tname; -} _shaders_textures[] = { - { SHADER_FONT_MASK, "tex" }, - { SHADER_FONT_MASK, "texm" }, - { SHADER_FONT_MASK12, "tex" }, - { SHADER_FONT_MASK12, "texm" }, - { SHADER_FONT_MASK21, "tex" }, - { SHADER_FONT_MASK21, "texm" }, - { SHADER_FONT_MASK22, "tex" }, - { SHADER_FONT_MASK22, "texm" }, - { SHADER_IMG_MASK, "tex" }, - { SHADER_IMG_MASK, "texm" }, - { SHADER_IMG_BGRA_MASK, "tex" }, - { SHADER_IMG_BGRA_MASK, "texm" }, - { SHADER_IMG_12_MASK, "tex" }, - { SHADER_IMG_12_MASK, "texm" }, - { SHADER_IMG_21_MASK, "tex" }, - { SHADER_IMG_21_MASK, "texm" }, - { SHADER_IMG_22_MASK, "tex" }, - { SHADER_IMG_22_MASK, "texm" }, - { SHADER_IMG_12_BGRA_MASK, "tex" }, - { SHADER_IMG_12_BGRA_MASK, "texm" }, - { SHADER_IMG_21_BGRA_MASK, "tex" }, - { SHADER_IMG_21_BGRA_MASK, "texm" }, - { SHADER_IMG_22_BGRA_MASK, "tex" }, - { SHADER_IMG_22_BGRA_MASK, "texm" }, - { SHADER_IMG_MASK_NOMUL, "tex" }, - { SHADER_IMG_MASK_NOMUL, "texm" }, - { SHADER_IMG_BGRA_MASK_NOMUL, "tex" }, - { SHADER_IMG_BGRA_MASK_NOMUL, "texm" }, - { SHADER_IMG_12_MASK_NOMUL, "tex" }, - { SHADER_IMG_12_MASK_NOMUL, "texm" }, - { SHADER_IMG_21_MASK_NOMUL, "tex" }, - { SHADER_IMG_21_MASK_NOMUL, "texm" }, - { SHADER_IMG_22_MASK_NOMUL, "tex" }, - { SHADER_IMG_22_MASK_NOMUL, "texm" }, - { SHADER_IMG_12_BGRA_MASK_NOMUL, "tex" }, - { SHADER_IMG_12_BGRA_MASK_NOMUL, "texm" }, - { SHADER_IMG_21_BGRA_MASK_NOMUL, "tex" }, - { SHADER_IMG_21_BGRA_MASK_NOMUL, "texm" }, - { SHADER_IMG_22_BGRA_MASK_NOMUL, "tex" }, - { SHADER_IMG_22_BGRA_MASK_NOMUL, "texm" }, - { SHADER_IMG_MASK12, "tex" }, - { SHADER_IMG_MASK12, "texm" }, - { SHADER_IMG_BGRA_MASK12, "tex" }, - { SHADER_IMG_BGRA_MASK12, "texm" }, - { SHADER_IMG_12_MASK12, "tex" }, - { SHADER_IMG_12_MASK12, "texm" }, - { SHADER_IMG_21_MASK12, "tex" }, - { SHADER_IMG_21_MASK12, "texm" }, - { SHADER_IMG_22_MASK12, "tex" }, - { SHADER_IMG_22_MASK12, "texm" }, - { SHADER_IMG_12_BGRA_MASK12, "tex" }, - { SHADER_IMG_12_BGRA_MASK12, "texm" }, - { SHADER_IMG_21_BGRA_MASK12, "tex" }, - { SHADER_IMG_21_BGRA_MASK12, "texm" }, - { SHADER_IMG_22_BGRA_MASK12, "tex" }, - { SHADER_IMG_22_BGRA_MASK12, "texm" }, - { SHADER_IMG_MASK12_NOMUL, "tex" }, - { SHADER_IMG_MASK12_NOMUL, "texm" }, - { SHADER_IMG_BGRA_MASK12_NOMUL, "tex" }, - { SHADER_IMG_BGRA_MASK12_NOMUL, "texm" }, - { SHADER_IMG_12_MASK12_NOMUL, "tex" }, - { SHADER_IMG_12_MASK12_NOMUL, "texm" }, - { SHADER_IMG_21_MASK12_NOMUL, "tex" }, - { SHADER_IMG_21_MASK12_NOMUL, "texm" }, - { SHADER_IMG_22_MASK12_NOMUL, "tex" }, - { SHADER_IMG_22_MASK12_NOMUL, "texm" }, - { SHADER_IMG_12_BGRA_MASK12_NOMUL, "tex" }, - { SHADER_IMG_12_BGRA_MASK12_NOMUL, "texm" }, - { SHADER_IMG_21_BGRA_MASK12_NOMUL, "tex" }, - { SHADER_IMG_21_BGRA_MASK12_NOMUL, "texm" }, - { SHADER_IMG_22_BGRA_MASK12_NOMUL, "tex" }, - { SHADER_IMG_22_BGRA_MASK12_NOMUL, "texm" }, - { SHADER_IMG_MASK21, "tex" }, - { SHADER_IMG_MASK21, "texm" }, - { SHADER_IMG_BGRA_MASK21, "tex" }, - { SHADER_IMG_BGRA_MASK21, "texm" }, - { SHADER_IMG_12_MASK21, "tex" }, - { SHADER_IMG_12_MASK21, "texm" }, - { SHADER_IMG_21_MASK21, "tex" }, - { SHADER_IMG_21_MASK21, "texm" }, - { SHADER_IMG_22_MASK21, "tex" }, - { SHADER_IMG_22_MASK21, "texm" }, - { SHADER_IMG_12_BGRA_MASK21, "tex" }, - { SHADER_IMG_12_BGRA_MASK21, "texm" }, - { SHADER_IMG_21_BGRA_MASK21, "tex" }, - { SHADER_IMG_21_BGRA_MASK21, "texm" }, - { SHADER_IMG_22_BGRA_MASK21, "tex" }, - { SHADER_IMG_22_BGRA_MASK21, "texm" }, - { SHADER_IMG_MASK21_NOMUL, "tex" }, - { SHADER_IMG_MASK21_NOMUL, "texm" }, - { SHADER_IMG_BGRA_MASK21_NOMUL, "tex" }, - { SHADER_IMG_BGRA_MASK21_NOMUL, "texm" }, - { SHADER_IMG_12_MASK21_NOMUL, "tex" }, - { SHADER_IMG_12_MASK21_NOMUL, "texm" }, - { SHADER_IMG_21_MASK21_NOMUL, "tex" }, - { SHADER_IMG_21_MASK21_NOMUL, "texm" }, - { SHADER_IMG_22_MASK21_NOMUL, "tex" }, - { SHADER_IMG_22_MASK21_NOMUL, "texm" }, - { SHADER_IMG_12_BGRA_MASK21_NOMUL, "tex" }, - { SHADER_IMG_12_BGRA_MASK21_NOMUL, "texm" }, - { SHADER_IMG_21_BGRA_MASK21_NOMUL, "tex" }, - { SHADER_IMG_21_BGRA_MASK21_NOMUL, "texm" }, - { SHADER_IMG_22_BGRA_MASK21_NOMUL, "tex" }, - { SHADER_IMG_22_BGRA_MASK21_NOMUL, "texm" }, - { SHADER_IMG_MASK22, "tex" }, - { SHADER_IMG_MASK22, "texm" }, - { SHADER_IMG_BGRA_MASK22, "tex" }, - { SHADER_IMG_BGRA_MASK22, "texm" }, - { SHADER_IMG_12_MASK22, "tex" }, - { SHADER_IMG_12_MASK22, "texm" }, - { SHADER_IMG_21_MASK22, "tex" }, - { SHADER_IMG_21_MASK22, "texm" }, - { SHADER_IMG_22_MASK22, "tex" }, - { SHADER_IMG_22_MASK22, "texm" }, - { SHADER_IMG_12_BGRA_MASK22, "tex" }, - { SHADER_IMG_12_BGRA_MASK22, "texm" }, - { SHADER_IMG_21_BGRA_MASK22, "tex" }, - { SHADER_IMG_21_BGRA_MASK22, "texm" }, - { SHADER_IMG_22_BGRA_MASK22, "tex" }, - { SHADER_IMG_22_BGRA_MASK22, "texm" }, - { SHADER_IMG_MASK22_NOMUL, "tex" }, - { SHADER_IMG_MASK22_NOMUL, "texm" }, - { SHADER_IMG_BGRA_MASK22_NOMUL, "tex" }, - { SHADER_IMG_BGRA_MASK22_NOMUL, "texm" }, - { SHADER_IMG_12_MASK22_NOMUL, "tex" }, - { SHADER_IMG_12_MASK22_NOMUL, "texm" }, - { SHADER_IMG_21_MASK22_NOMUL, "tex" }, - { SHADER_IMG_21_MASK22_NOMUL, "texm" }, - { SHADER_IMG_22_MASK22_NOMUL, "tex" }, - { SHADER_IMG_22_MASK22_NOMUL, "texm" }, - { SHADER_IMG_12_BGRA_MASK22_NOMUL, "tex" }, - { SHADER_IMG_12_BGRA_MASK22_NOMUL, "texm" }, - { SHADER_IMG_21_BGRA_MASK22_NOMUL, "tex" }, - { SHADER_IMG_21_BGRA_MASK22_NOMUL, "texm" }, - { SHADER_IMG_22_BGRA_MASK22_NOMUL, "tex" }, - { SHADER_IMG_22_BGRA_MASK22_NOMUL, "texm" }, - { SHADER_IMGNAT_MASK, "tex" }, - { SHADER_IMGNAT_MASK, "texm" }, - { SHADER_IMGNAT_BGRA_MASK, "tex" }, - { SHADER_IMGNAT_BGRA_MASK, "texm" }, - { SHADER_IMGNAT_12_MASK, "tex" }, - { SHADER_IMGNAT_12_MASK, "texm" }, - { SHADER_IMGNAT_21_MASK, "tex" }, - { SHADER_IMGNAT_21_MASK, "texm" }, - { SHADER_IMGNAT_22_MASK, "tex" }, - { SHADER_IMGNAT_22_MASK, "texm" }, - { SHADER_IMGNAT_12_BGRA_MASK, "tex" }, - { SHADER_IMGNAT_12_BGRA_MASK, "texm" }, - { SHADER_IMGNAT_21_BGRA_MASK, "tex" }, - { SHADER_IMGNAT_21_BGRA_MASK, "texm" }, - { SHADER_IMGNAT_22_BGRA_MASK, "tex" }, - { SHADER_IMGNAT_22_BGRA_MASK, "texm" }, - { SHADER_IMGNAT_MASK_NOMUL, "tex" }, - { SHADER_IMGNAT_MASK_NOMUL, "texm" }, - { SHADER_IMGNAT_BGRA_MASK_NOMUL, "tex" }, - { SHADER_IMGNAT_BGRA_MASK_NOMUL, "texm" }, - { SHADER_IMGNAT_12_MASK_NOMUL, "tex" }, - { SHADER_IMGNAT_12_MASK_NOMUL, "texm" }, - { SHADER_IMGNAT_21_MASK_NOMUL, "tex" }, - { SHADER_IMGNAT_21_MASK_NOMUL, "texm" }, - { SHADER_IMGNAT_22_MASK_NOMUL, "tex" }, - { SHADER_IMGNAT_22_MASK_NOMUL, "texm" }, - { SHADER_IMGNAT_12_BGRA_MASK_NOMUL, "tex" }, - { SHADER_IMGNAT_12_BGRA_MASK_NOMUL, "texm" }, - { SHADER_IMGNAT_21_BGRA_MASK_NOMUL, "tex" }, - { SHADER_IMGNAT_21_BGRA_MASK_NOMUL, "texm" }, - { SHADER_IMGNAT_22_BGRA_MASK_NOMUL, "tex" }, - { SHADER_IMGNAT_22_BGRA_MASK_NOMUL, "texm" }, - { SHADER_IMGNAT_MASK12, "tex" }, - { SHADER_IMGNAT_MASK12, "texm" }, - { SHADER_IMGNAT_BGRA_MASK12, "tex" }, - { SHADER_IMGNAT_BGRA_MASK12, "texm" }, - { SHADER_IMGNAT_12_MASK12, "tex" }, - { SHADER_IMGNAT_12_MASK12, "texm" }, - { SHADER_IMGNAT_21_MASK12, "tex" }, - { SHADER_IMGNAT_21_MASK12, "texm" }, - { SHADER_IMGNAT_22_MASK12, "tex" }, - { SHADER_IMGNAT_22_MASK12, "texm" }, - { SHADER_IMGNAT_12_BGRA_MASK12, "tex" }, - { SHADER_IMGNAT_12_BGRA_MASK12, "texm" }, - { SHADER_IMGNAT_21_BGRA_MASK12, "tex" }, - { SHADER_IMGNAT_21_BGRA_MASK12, "texm" }, - { SHADER_IMGNAT_22_BGRA_MASK12, "tex" }, - { SHADER_IMGNAT_22_BGRA_MASK12, "texm" }, - { SHADER_IMGNAT_MASK12_NOMUL, "tex" }, - { SHADER_IMGNAT_MASK12_NOMUL, "texm" }, - { SHADER_IMGNAT_BGRA_MASK12_NOMUL, "tex" }, - { SHADER_IMGNAT_BGRA_MASK12_NOMUL, "texm" }, - { SHADER_IMGNAT_12_MASK12_NOMUL, "tex" }, - { SHADER_IMGNAT_12_MASK12_NOMUL, "texm" }, - { SHADER_IMGNAT_21_MASK12_NOMUL, "tex" }, - { SHADER_IMGNAT_21_MASK12_NOMUL, "texm" }, - { SHADER_IMGNAT_22_MASK12_NOMUL, "tex" }, - { SHADER_IMGNAT_22_MASK12_NOMUL, "texm" }, - { SHADER_IMGNAT_12_BGRA_MASK12_NOMUL, "tex" }, - { SHADER_IMGNAT_12_BGRA_MASK12_NOMUL, "texm" }, - { SHADER_IMGNAT_21_BGRA_MASK12_NOMUL, "tex" }, - { SHADER_IMGNAT_21_BGRA_MASK12_NOMUL, "texm" }, - { SHADER_IMGNAT_22_BGRA_MASK12_NOMUL, "tex" }, - { SHADER_IMGNAT_22_BGRA_MASK12_NOMUL, "texm" }, - { SHADER_IMGNAT_MASK21, "tex" }, - { SHADER_IMGNAT_MASK21, "texm" }, - { SHADER_IMGNAT_BGRA_MASK21, "tex" }, - { SHADER_IMGNAT_BGRA_MASK21, "texm" }, - { SHADER_IMGNAT_12_MASK21, "tex" }, - { SHADER_IMGNAT_12_MASK21, "texm" }, - { SHADER_IMGNAT_21_MASK21, "tex" }, - { SHADER_IMGNAT_21_MASK21, "texm" }, - { SHADER_IMGNAT_22_MASK21, "tex" }, - { SHADER_IMGNAT_22_MASK21, "texm" }, - { SHADER_IMGNAT_12_BGRA_MASK21, "tex" }, - { SHADER_IMGNAT_12_BGRA_MASK21, "texm" }, - { SHADER_IMGNAT_21_BGRA_MASK21, "tex" }, - { SHADER_IMGNAT_21_BGRA_MASK21, "texm" }, - { SHADER_IMGNAT_22_BGRA_MASK21, "tex" }, - { SHADER_IMGNAT_22_BGRA_MASK21, "texm" }, - { SHADER_IMGNAT_MASK21_NOMUL, "tex" }, - { SHADER_IMGNAT_MASK21_NOMUL, "texm" }, - { SHADER_IMGNAT_BGRA_MASK21_NOMUL, "tex" }, - { SHADER_IMGNAT_BGRA_MASK21_NOMUL, "texm" }, - { SHADER_IMGNAT_12_MASK21_NOMUL, "tex" }, - { SHADER_IMGNAT_12_MASK21_NOMUL, "texm" }, - { SHADER_IMGNAT_21_MASK21_NOMUL, "tex" }, - { SHADER_IMGNAT_21_MASK21_NOMUL, "texm" }, - { SHADER_IMGNAT_22_MASK21_NOMUL, "tex" }, - { SHADER_IMGNAT_22_MASK21_NOMUL, "texm" }, - { SHADER_IMGNAT_12_BGRA_MASK21_NOMUL, "tex" }, - { SHADER_IMGNAT_12_BGRA_MASK21_NOMUL, "texm" }, - { SHADER_IMGNAT_21_BGRA_MASK21_NOMUL, "tex" }, - { SHADER_IMGNAT_21_BGRA_MASK21_NOMUL, "texm" }, - { SHADER_IMGNAT_22_BGRA_MASK21_NOMUL, "tex" }, - { SHADER_IMGNAT_22_BGRA_MASK21_NOMUL, "texm" }, - { SHADER_IMGNAT_MASK22, "tex" }, - { SHADER_IMGNAT_MASK22, "texm" }, - { SHADER_IMGNAT_BGRA_MASK22, "tex" }, - { SHADER_IMGNAT_BGRA_MASK22, "texm" }, - { SHADER_IMGNAT_12_MASK22, "tex" }, - { SHADER_IMGNAT_12_MASK22, "texm" }, - { SHADER_IMGNAT_21_MASK22, "tex" }, - { SHADER_IMGNAT_21_MASK22, "texm" }, - { SHADER_IMGNAT_22_MASK22, "tex" }, - { SHADER_IMGNAT_22_MASK22, "texm" }, - { SHADER_IMGNAT_12_BGRA_MASK22, "tex" }, - { SHADER_IMGNAT_12_BGRA_MASK22, "texm" }, - { SHADER_IMGNAT_21_BGRA_MASK22, "tex" }, - { SHADER_IMGNAT_21_BGRA_MASK22, "texm" }, - { SHADER_IMGNAT_22_BGRA_MASK22, "tex" }, - { SHADER_IMGNAT_22_BGRA_MASK22, "texm" }, - { SHADER_IMGNAT_MASK22_NOMUL, "tex" }, - { SHADER_IMGNAT_MASK22_NOMUL, "texm" }, - { SHADER_IMGNAT_BGRA_MASK22_NOMUL, "tex" }, - { SHADER_IMGNAT_BGRA_MASK22_NOMUL, "texm" }, - { SHADER_IMGNAT_12_MASK22_NOMUL, "tex" }, - { SHADER_IMGNAT_12_MASK22_NOMUL, "texm" }, - { SHADER_IMGNAT_21_MASK22_NOMUL, "tex" }, - { SHADER_IMGNAT_21_MASK22_NOMUL, "texm" }, - { SHADER_IMGNAT_22_MASK22_NOMUL, "tex" }, - { SHADER_IMGNAT_22_MASK22_NOMUL, "texm" }, - { SHADER_IMGNAT_12_BGRA_MASK22_NOMUL, "tex" }, - { SHADER_IMGNAT_12_BGRA_MASK22_NOMUL, "texm" }, - { SHADER_IMGNAT_21_BGRA_MASK22_NOMUL, "tex" }, - { SHADER_IMGNAT_21_BGRA_MASK22_NOMUL, "texm" }, - { SHADER_IMGNAT_22_BGRA_MASK22_NOMUL, "tex" }, - { SHADER_IMGNAT_22_BGRA_MASK22_NOMUL, "texm" }, - { SHADER_RGB_A_PAIR, "tex" }, - { SHADER_RGB_A_PAIR, "texa" }, - { SHADER_RGB_A_PAIR_MASK, "tex" }, - { SHADER_RGB_A_PAIR_MASK, "texa" }, - { SHADER_RGB_A_PAIR_MASK, "texm" }, - { SHADER_RGB_A_PAIR_NOMUL, "tex" }, - { SHADER_RGB_A_PAIR_NOMUL, "texa" }, - { SHADER_RGB_A_PAIR_MASK_NOMUL, "tex" }, - { SHADER_RGB_A_PAIR_MASK_NOMUL, "texa" }, - { SHADER_RGB_A_PAIR_MASK_NOMUL, "texm" }, - { SHADER_YUV, "tex" }, - { SHADER_YUV, "texu" }, - { SHADER_YUV, "texv" }, - { SHADER_YUV_NOMUL, "tex" }, - { SHADER_YUV_NOMUL, "texu" }, - { SHADER_YUV_NOMUL, "texv" }, - { SHADER_YUV_MASK, "tex" }, - { SHADER_YUV_MASK, "texu" }, - { SHADER_YUV_MASK, "texv" }, - { SHADER_YUV_MASK, "texm" }, - { SHADER_YUV_MASK_NOMUL, "tex" }, - { SHADER_YUV_MASK_NOMUL, "texu" }, - { SHADER_YUV_MASK_NOMUL, "texv" }, - { SHADER_YUV_MASK_NOMUL, "texm" }, - { SHADER_YUY2, "tex" }, - { SHADER_YUY2, "texuv" }, - { SHADER_YUY2_NOMUL, "tex" }, - { SHADER_YUY2_NOMUL, "texuv" }, - { SHADER_YUY2_MASK, "tex" }, - { SHADER_YUY2_MASK, "texuv" }, - { SHADER_YUY2_MASK, "texm" }, - { SHADER_YUY2_MASK_NOMUL, "tex" }, - { SHADER_YUY2_MASK_NOMUL, "texuv" }, - { SHADER_YUY2_MASK_NOMUL, "texm" }, - { SHADER_NV12, "tex" }, - { SHADER_NV12, "texuv" }, - { SHADER_NV12_NOMUL, "tex" }, - { SHADER_NV12_NOMUL, "texuv" }, - { SHADER_NV12_MASK, "tex" }, - { SHADER_NV12_MASK, "texuv" }, - { SHADER_NV12_MASK, "texm" }, - { SHADER_NV12_MASK_NOMUL, "tex" }, - { SHADER_NV12_MASK_NOMUL, "texuv" }, - { SHADER_NV12_MASK_NOMUL, "texm" }, - { SHADER_YUV_709, "tex" }, - { SHADER_YUV_709, "texu" }, - { SHADER_YUV_709, "texv" }, - { SHADER_YUV_709_NOMUL, "tex" }, - { SHADER_YUV_709_NOMUL, "texu" }, - { SHADER_YUV_709_NOMUL, "texv" }, - { SHADER_YUV_709_MASK, "tex" }, - { SHADER_YUV_709_MASK, "texu" }, - { SHADER_YUV_709_MASK, "texv" }, - { SHADER_YUV_709_MASK, "texm" }, - { SHADER_YUV_709_MASK_NOMUL, "tex" }, - { SHADER_YUV_709_MASK_NOMUL, "texu" }, - { SHADER_YUV_709_MASK_NOMUL, "texv" }, - { SHADER_YUV_709_MASK_NOMUL, "texm" }, - { SHADER_YUY2_709, "tex" }, - { SHADER_YUY2_709, "texuv" }, - { SHADER_YUY2_709_NOMUL, "tex" }, - { SHADER_YUY2_709_NOMUL, "texuv" }, - { SHADER_YUY2_709_MASK, "tex" }, - { SHADER_YUY2_709_MASK, "texuv" }, - { SHADER_YUY2_709_MASK, "texm" }, - { SHADER_YUY2_709_MASK_NOMUL, "tex" }, - { SHADER_YUY2_709_MASK_NOMUL, "texuv" }, - { SHADER_YUY2_709_MASK_NOMUL, "texm" }, - { SHADER_NV12_709, "tex" }, - { SHADER_NV12_709, "texuv" }, - { SHADER_NV12_709_NOMUL, "tex" }, - { SHADER_NV12_709_NOMUL, "texuv" }, - { SHADER_NV12_709_MASK, "tex" }, - { SHADER_NV12_709_MASK, "texuv" }, - { SHADER_NV12_709_MASK, "texm" }, - { SHADER_NV12_709_MASK_NOMUL, "tex" }, - { SHADER_NV12_709_MASK_NOMUL, "texuv" }, - { SHADER_NV12_709_MASK_NOMUL, "texm" }, - { SHADER_LAST, NULL } -}; - -#endif // _EVAS_GL_CONTEXT_C diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x index c9778d69cd..19120e26c3 100644 --- a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x +++ b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x @@ -1,13345 +1,285 @@ /* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */ /* IF IT IS CHANGED PLEASE COMMIT THE CHANGES */ -#include "../evas_gl_private.h" - -static const char rect_frag_src[] = +static const char fragment_glsl[] = + "/* General-purpose fragment shader for all operations in Evas.\n" + " * This file can either be used directly by evas at runtime to\n" + " * generate its shaders with the appropriate #defines, or passed\n" + " * through cpp first (in which case the precision must be manually added).\n" + " */\n" "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" + "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char rect_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - "}\n"; - -static const char rect_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char rect_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char rect_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char rect_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char rect_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char rect_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char rect_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char rect_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char font_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char font_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char font_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char font_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char font_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char font_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char font_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char font_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char font_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char font_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_12_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_12_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_21_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_22_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_12_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_21_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_22_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_12_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_21_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_22_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_12_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_21_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_22_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_12_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_12_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_21_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_22_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_12_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" + "# else\n" "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_21_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" + "# endif\n" + "# ifdef SHD_EXTERNAL\n" + "extension GL_OES_EGL_image_external : require\n" + "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" + "# endif\n" "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_22_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" + "# define SAMPLER_EXTERNAL_OES sampler2D\n" "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" + "#ifndef SHD_NOMUL\n" "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_12_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" + "#ifdef SHD_EXTERNAL\n" + "uniform SAMPLER_EXTERNAL_OES tex;\n" "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_21_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_22_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_12_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_21_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" + "#elif defined(SHD_TEX)\n" "uniform sampler2D tex;\n" "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_22_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char rgb_a_pair_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" + "#if defined(SHD_NV12) || defined(SHD_YUY2)\n" + "uniform sampler2D texuv;\n" + "varying vec2 tex_c2;\n" "#endif\n" + "#if defined(SHD_YUV)\n" + "uniform sampler2D texu;\n" + "uniform sampler2D texv;\n" + "varying vec2 tex_c2;\n" + "varying vec2 tex_c3;\n" "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" + "#ifdef SHD_TEXA\n" "uniform sampler2D texa;\n" "varying vec2 tex_a;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * texture2D(texa, tex_a).r\n" - " ;\n" - "}\n"; - -static const char rgb_a_pair_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coorda;\n" - "varying vec2 tex_a;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_a = tex_coorda;\n" - "}\n"; - -static const char rgb_a_pair_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" + "#if defined(SHD_SAM12) || defined(SHD_SAM21) || defined(SHD_SAM22)\n" + "varying vec4 div_s;\n" + "# if defined(SHD_SAM12) || defined(SHD_SAM21)\n" + "varying vec2 tex_s[2];\n" + "# else\n" + "varying vec2 tex_s[4];\n" + "# endif\n" "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texa;\n" - "varying vec2 tex_a;\n" + "#ifdef SHD_MASK\n" "uniform sampler2D texm;\n" "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " * texture2D(texa, tex_a).r\n" - " ;\n" - "}\n"; - -static const char rgb_a_pair_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coorda;\n" - "varying vec2 tex_a;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_a = tex_coorda;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char rgb_a_pair_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texa;\n" - "varying vec2 tex_a;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * texture2D(texa, tex_a).r\n" - " ;\n" - "}\n"; - -static const char rgb_a_pair_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coorda;\n" - "varying vec2 tex_a;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_a = tex_coorda;\n" - "}\n"; - -static const char rgb_a_pair_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texa;\n" - "varying vec2 tex_a;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " * texture2D(texa, tex_a).r\n" - " ;\n" - "}\n"; - -static const char rgb_a_pair_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coorda;\n" - "varying vec2 tex_a;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_a = tex_coorda;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char tex_external_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" + "# if defined(SHD_MASKSAM12) || defined(SHD_MASKSAM21)\n" + "varying float maskdiv_s;\n" + "varying vec2 masktex_s[2];\n" + "# elif defined(SHD_MASKSAM22)\n" + "varying float maskdiv_s;\n" + "varying vec2 masktex_s[4];\n" "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" + "#endif\n" + "#ifdef SHD_ALPHA\n" + "# define SWZ aaaa\n" "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" + "# ifndef SHD_BGRA\n" + "# if defined(SHD_IMG) && defined(BIGENDIAN)\n" + "# define SWZ gbar\n" + "# else\n" + "# define SWZ bgra\n" "#endif\n" - "varying vec4 col;\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char tex_external_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char tex_external_afill_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" "# else\n" - "precision mediump float;\n" + "# if defined(SHD_IMG) && defined(BIGENDIAN)\n" + "# define SWZ grab\n" + "# else\n" + "# define SWZ rgba\n" + "# endif\n" "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" "#endif\n" - "varying vec4 col;\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" "void main()\n" "{\n" " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" + "#if defined(SHD_YUV) || defined(SHD_NV12) || defined(SHD_YUY2)\n" + " float r, g, b, y, u, v, vmu;\n" + "# if defined(SHD_YUV)\n" + " y = texture2D(tex, tex_c).r;\n" + " u = texture2D(texu, tex_c2).r;\n" + " v = texture2D(texv, tex_c3).r;\n" + "# elif defined(SHD_NV12) || defined(SHD_YUY2)\n" + " y = texture2D(tex, tex_c).g;\n" + " u = texture2D(texuv, tex_c2).g;\n" + " v = texture2D(texuv, tex_c2).a;\n" + "# endif\n" + "// center u and v around 0 for uv and y (with 128/255 for u + v, 16/255 for y)\n" + " u = u - 0.5;\n" + " v = v - 0.5;\n" + "# if defined (SHD_YUV_709)\n" + "// 709 yuv colorspace for hd content\n" + " y = (y - 0.062) * 1.164;\n" + " vmu = (v * 0.534) + (u * 0.213);\n" + " v = v * 1.793;\n" + " u = u * 2.115;\n" + "# else\n" + "// 601 colorspace constants (older yuv content)\n" + " y = (y - 0.062) * 1.164;\n" + " vmu = (v * 0.813) + (u * 0.391);\n" + " v = v * 1.596;\n" + " u = u * 2.018;\n" + "# endif\n" + "// common yuv\n" + " r = y + v;\n" + " g = y - vmu;\n" + " b = y + u;\n" + " c = vec4(r, g, b, 1.0);\n" + "#elif defined(SHD_SAM12) || defined(SHD_SAM21)\n" + " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).SWZ;\n" + " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).SWZ;\n" + " c = (col00 + col01) / div_s;\n" + "#elif defined(SHD_SAM22)\n" + " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).SWZ;\n" + " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).SWZ;\n" + " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).SWZ;\n" + " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).SWZ;\n" + " c = (col00 + col01 + col10 + col11) / div_s;\n" + "#elif defined(SHD_TEX) || defined(SHD_EXTERNAL)\n" + " c = texture2D(tex, tex_c).SWZ;\n" + "#else\n" + " c = vec4(1, 1, 1, 1);\n" + "#endif\n" + "#ifdef SHD_MASK\n" + " float ma;\n" + "# if defined(SHD_MASKSAM12) || defined(SHD_MASKSAM21)\n" + " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" + " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" + " ma = (ma00 + ma01) / maskdiv_s;\n" + "# elif defined(SHD_MASKSAM22)\n" + " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" + " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" + " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" + " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" + " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" + "# else\n" + " ma = texture2D(texm, tex_m).a;\n" + "# endif\n" + "#endif\n" " gl_FragColor =\n" " c\n" + "#ifndef SHD_NOMUL\n" " * col\n" + "#endif\n" + "#ifdef SHD_MASK\n" + " * ma\n" + "#endif\n" + "#ifdef SHD_TEXA\n" + " * texture2D(texa, tex_a).r\n" + "#endif\n" " ;\n" + "#ifdef SHD_AFILL\n" " gl_FragColor.a = 1.0;\n" + "#endif\n" "}\n"; -static const char tex_external_afill_vert_src[] = +static const char vertex_glsl[] = + "/* General-purpose vertex shader for all operations in Evas.\n" + " * This file can either be used directly by evas at runtime to\n" + " * generate its shaders with the appropriate #defines, or passed\n" + " * through cpp first (in which case the precision must be manually added).\n" + " */\n" "#ifdef GL_ES\n" "precision highp float;\n" "#endif\n" "attribute vec4 vertex;\n" "uniform mat4 mvp;\n" + "/* All except nomul */\n" + "#ifndef SHD_NOMUL\n" "attribute vec4 color;\n" "varying vec4 col;\n" + "#endif\n" + "/* All images & fonts */\n" + "#if defined(SHD_TEX) || defined(SHD_EXTERNAL)\n" "attribute vec2 tex_coord;\n" "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char tex_external_nomul_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" + "#endif\n" + "/* NV12, YUY2 */\n" + "#if defined(SHD_NV12) || defined(SHD_YUY2) || defined(SHD_YUV)\n" + "attribute vec2 tex_coord2;\n" + "varying vec2 tex_c2;\n" + "#endif\n" + "/* YUV */\n" + "#ifdef SHD_YUV\n" + "attribute vec2 tex_coord3;\n" + "varying vec2 tex_c3;\n" + "#endif\n" + "/* RGB+A */\n" + "#ifdef SHD_TEXA\n" + "attribute vec2 tex_coorda;\n" + "varying vec2 tex_a;\n" + "#endif\n" + "/* Sampling */\n" + "#if defined(SHD_SAM12) || defined(SHD_SAM21) || defined(SHD_SAM22)\n" + "attribute vec2 tex_sample;\n" + "varying vec4 div_s;\n" + "# if defined(SHD_SAM12) || defined(SHD_SAM21)\n" + "varying vec2 tex_s[2];\n" "# else\n" - "precision mediump float;\n" + "varying vec2 tex_s[4];\n" "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" "#endif\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char tex_external_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char tex_external_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" + "/* Masking */\n" + "#ifdef SHD_MASK\n" + "attribute vec4 mask_coord;\n" + "varying vec2 tex_m;\n" + "# if defined(SHD_MASKSAM12) || defined(SHD_MASKSAM21)\n" + "attribute vec2 tex_masksample;\n" + "varying float maskdiv_s;\n" + "varying vec2 masktex_s[2];\n" + "# elif defined(SHD_MASKSAM22)\n" + "attribute vec2 tex_masksample;\n" + "varying float maskdiv_s;\n" + "varying vec2 masktex_s[4];\n" "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" "#endif\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char tex_external_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char tex_external_mask_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" - "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" - "#endif\n" - "varying vec4 col;\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char tex_external_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" "void main()\n" "{\n" " gl_Position = mvp * vertex;\n" + "#ifndef SHD_NOMUL\n" " col = color;\n" + "#endif\n" + "#if defined(SHD_TEX) || defined(SHD_EXTERNAL)\n" " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char tex_external_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" - "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" "#endif\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char tex_external_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" + "#ifdef SHD_NV12\n" + " tex_c2 = tex_coord2 * 0.5;\n" "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuv_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" + "#ifdef SHD_YUY2\n" + " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char yuv_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" + "#ifdef SHD_YUV\n" " tex_c2 = tex_coord2;\n" " tex_c3 = tex_coord3;\n" - "}\n"; - -static const char yuv_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" "#endif\n" + "#ifdef SHD_TEXA\n" + " tex_a = tex_coorda;\n" "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char yuv_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" + "#if defined(SHD_SAM12)\n" + " tex_s[0] = vec2(0, -tex_sample.y);\n" + " tex_s[1] = vec2(0, tex_sample.y);\n" + " div_s = vec4(2, 2, 2, 2);\n" + "#elif defined(SHD_SAM21)\n" + " tex_s[0] = vec2(-tex_sample.x, 0);\n" + " tex_s[1] = vec2( tex_sample.x, 0);\n" + " div_s = vec4(2, 2, 2, 2);\n" + "#elif defined(SHD_SAM22)\n" + " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" + " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" + " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" + " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" + " div_s = vec4(4, 4, 4, 4);\n" "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - "}\n"; - -static const char yuv_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" + "#if defined(SHD_MASKSAM12)\n" + " masktex_s[0] = vec2(0, -tex_masksample.y);\n" + " masktex_s[1] = vec2(0, tex_masksample.y);\n" + " maskdiv_s = 2.0;\n" + "#elif defined(SHD_MASKSAM21)\n" + " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" + " masktex_s[1] = vec2( tex_masksample.x, 0);\n" + " maskdiv_s = 2.0;\n" + "#elif defined(SHD_MASKSAM22)\n" + " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" + " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" + " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" + " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" + " maskdiv_s = 4.0;\n" "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuv_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" + "#ifdef SHD_MASK\n" + " // mask_coord.w contains the Y-invert flag\n" + " // position on screen in [0..1] range of current pixel\n" " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" + "#endif\n" "}\n"; -static const char yuv_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuv_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuy2_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char yuy2_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - "}\n"; - -static const char yuy2_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char yuy2_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - "}\n"; - -static const char yuy2_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuy2_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuy2_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuy2_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char nv12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char nv12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - "}\n"; - -static const char nv12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char nv12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - "}\n"; - -static const char nv12_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char nv12_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char nv12_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char nv12_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuv_709_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char yuv_709_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - "}\n"; - -static const char yuv_709_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char yuv_709_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - "}\n"; - -static const char yuv_709_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuv_709_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuv_709_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuv_709_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuy2_709_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char yuy2_709_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - "}\n"; - -static const char yuy2_709_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char yuy2_709_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - "}\n"; - -static const char yuy2_709_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuy2_709_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuy2_709_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuy2_709_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char nv12_709_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char nv12_709_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - "}\n"; - -static const char nv12_709_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char nv12_709_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - "}\n"; - -static const char nv12_709_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char nv12_709_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char nv12_709_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char nv12_709_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - - -static const struct { - Evas_GL_Shader id; - const char *vert; - const char *frag; - const char *name; - Shader_Type type; - Shader_Sampling sam; - Shader_Sampling masksam; - Eina_Bool bgra : 1; - Eina_Bool mask : 1; - Eina_Bool nomul : 1; - Eina_Bool afill : 1; -} _shaders_source[] = { - { SHADER_RECT, rect_vert_src, rect_frag_src, "rect", SHD_RECT, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_RECT_MASK, rect_mask_vert_src, rect_mask_frag_src, "rect_mask", SHD_RECT, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_RECT_MASK12, rect_mask12_vert_src, rect_mask12_frag_src, "rect_mask12", SHD_RECT, SHD_SAM11, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_RECT_MASK21, rect_mask21_vert_src, rect_mask21_frag_src, "rect_mask21", SHD_RECT, SHD_SAM11, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_RECT_MASK22, rect_mask22_vert_src, rect_mask22_frag_src, "rect_mask22", SHD_RECT, SHD_SAM11, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_FONT, font_vert_src, font_frag_src, "font", SHD_FONT, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_FONT_MASK, font_mask_vert_src, font_mask_frag_src, "font_mask", SHD_FONT, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_FONT_MASK12, font_mask12_vert_src, font_mask12_frag_src, "font_mask12", SHD_FONT, SHD_SAM11, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_FONT_MASK21, font_mask21_vert_src, font_mask21_frag_src, "font_mask21", SHD_FONT, SHD_SAM11, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_FONT_MASK22, font_mask22_vert_src, font_mask22_frag_src, "font_mask22", SHD_FONT, SHD_SAM11, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG, img_vert_src, img_frag_src, "img", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMG_BGRA, img_bgra_vert_src, img_bgra_frag_src, "img_bgra", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMG_12, img_12_vert_src, img_12_frag_src, "img_12", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMG_21, img_21_vert_src, img_21_frag_src, "img_21", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMG_22, img_22_vert_src, img_22_frag_src, "img_22", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMG_12_BGRA, img_12_bgra_vert_src, img_12_bgra_frag_src, "img_12_bgra", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMG_21_BGRA, img_21_bgra_vert_src, img_21_bgra_frag_src, "img_21_bgra", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMG_22_BGRA, img_22_bgra_vert_src, img_22_bgra_frag_src, "img_22_bgra", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMG_MASK, img_mask_vert_src, img_mask_frag_src, "img_mask", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMG_BGRA_MASK, img_bgra_mask_vert_src, img_bgra_mask_frag_src, "img_bgra_mask", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMG_12_MASK, img_12_mask_vert_src, img_12_mask_frag_src, "img_12_mask", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMG_21_MASK, img_21_mask_vert_src, img_21_mask_frag_src, "img_21_mask", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMG_22_MASK, img_22_mask_vert_src, img_22_mask_frag_src, "img_22_mask", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMG_12_BGRA_MASK, img_12_bgra_mask_vert_src, img_12_bgra_mask_frag_src, "img_12_bgra_mask", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMG_21_BGRA_MASK, img_21_bgra_mask_vert_src, img_21_bgra_mask_frag_src, "img_21_bgra_mask", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMG_22_BGRA_MASK, img_22_bgra_mask_vert_src, img_22_bgra_mask_frag_src, "img_22_bgra_mask", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMG_NOMUL, img_nomul_vert_src, img_nomul_frag_src, "img_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMG_BGRA_NOMUL, img_bgra_nomul_vert_src, img_bgra_nomul_frag_src, "img_bgra_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMG_12_NOMUL, img_12_nomul_vert_src, img_12_nomul_frag_src, "img_12_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMG_21_NOMUL, img_21_nomul_vert_src, img_21_nomul_frag_src, "img_21_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMG_22_NOMUL, img_22_nomul_vert_src, img_22_nomul_frag_src, "img_22_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMG_12_BGRA_NOMUL, img_12_bgra_nomul_vert_src, img_12_bgra_nomul_frag_src, "img_12_bgra_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMG_21_BGRA_NOMUL, img_21_bgra_nomul_vert_src, img_21_bgra_nomul_frag_src, "img_21_bgra_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMG_22_BGRA_NOMUL, img_22_bgra_nomul_vert_src, img_22_bgra_nomul_frag_src, "img_22_bgra_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMG_MASK_NOMUL, img_mask_nomul_vert_src, img_mask_nomul_frag_src, "img_mask_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMG_BGRA_MASK_NOMUL, img_bgra_mask_nomul_vert_src, img_bgra_mask_nomul_frag_src, "img_bgra_mask_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMG_12_MASK_NOMUL, img_12_mask_nomul_vert_src, img_12_mask_nomul_frag_src, "img_12_mask_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMG_21_MASK_NOMUL, img_21_mask_nomul_vert_src, img_21_mask_nomul_frag_src, "img_21_mask_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMG_22_MASK_NOMUL, img_22_mask_nomul_vert_src, img_22_mask_nomul_frag_src, "img_22_mask_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMG_12_BGRA_MASK_NOMUL, img_12_bgra_mask_nomul_vert_src, img_12_bgra_mask_nomul_frag_src, "img_12_bgra_mask_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMG_21_BGRA_MASK_NOMUL, img_21_bgra_mask_nomul_vert_src, img_21_bgra_mask_nomul_frag_src, "img_21_bgra_mask_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMG_22_BGRA_MASK_NOMUL, img_22_bgra_mask_nomul_vert_src, img_22_bgra_mask_nomul_frag_src, "img_22_bgra_mask_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMG_MASK12, img_mask12_vert_src, img_mask12_frag_src, "img_mask12", SHD_IMAGE, SHD_SAM11, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMG_BGRA_MASK12, img_bgra_mask12_vert_src, img_bgra_mask12_frag_src, "img_bgra_mask12", SHD_IMAGE, SHD_SAM11, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMG_12_MASK12, img_12_mask12_vert_src, img_12_mask12_frag_src, "img_12_mask12", SHD_IMAGE, SHD_SAM12, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMG_21_MASK12, img_21_mask12_vert_src, img_21_mask12_frag_src, "img_21_mask12", SHD_IMAGE, SHD_SAM21, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMG_22_MASK12, img_22_mask12_vert_src, img_22_mask12_frag_src, "img_22_mask12", SHD_IMAGE, SHD_SAM22, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMG_12_BGRA_MASK12, img_12_bgra_mask12_vert_src, img_12_bgra_mask12_frag_src, "img_12_bgra_mask12", SHD_IMAGE, SHD_SAM12, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMG_21_BGRA_MASK12, img_21_bgra_mask12_vert_src, img_21_bgra_mask12_frag_src, "img_21_bgra_mask12", SHD_IMAGE, SHD_SAM21, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMG_22_BGRA_MASK12, img_22_bgra_mask12_vert_src, img_22_bgra_mask12_frag_src, "img_22_bgra_mask12", SHD_IMAGE, SHD_SAM22, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMG_MASK12_NOMUL, img_mask12_nomul_vert_src, img_mask12_nomul_frag_src, "img_mask12_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMG_BGRA_MASK12_NOMUL, img_bgra_mask12_nomul_vert_src, img_bgra_mask12_nomul_frag_src, "img_bgra_mask12_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMG_12_MASK12_NOMUL, img_12_mask12_nomul_vert_src, img_12_mask12_nomul_frag_src, "img_12_mask12_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMG_21_MASK12_NOMUL, img_21_mask12_nomul_vert_src, img_21_mask12_nomul_frag_src, "img_21_mask12_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMG_22_MASK12_NOMUL, img_22_mask12_nomul_vert_src, img_22_mask12_nomul_frag_src, "img_22_mask12_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMG_12_BGRA_MASK12_NOMUL, img_12_bgra_mask12_nomul_vert_src, img_12_bgra_mask12_nomul_frag_src, "img_12_bgra_mask12_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMG_21_BGRA_MASK12_NOMUL, img_21_bgra_mask12_nomul_vert_src, img_21_bgra_mask12_nomul_frag_src, "img_21_bgra_mask12_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMG_22_BGRA_MASK12_NOMUL, img_22_bgra_mask12_nomul_vert_src, img_22_bgra_mask12_nomul_frag_src, "img_22_bgra_mask12_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMG_MASK21, img_mask21_vert_src, img_mask21_frag_src, "img_mask21", SHD_IMAGE, SHD_SAM11, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMG_BGRA_MASK21, img_bgra_mask21_vert_src, img_bgra_mask21_frag_src, "img_bgra_mask21", SHD_IMAGE, SHD_SAM11, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMG_12_MASK21, img_12_mask21_vert_src, img_12_mask21_frag_src, "img_12_mask21", SHD_IMAGE, SHD_SAM12, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMG_21_MASK21, img_21_mask21_vert_src, img_21_mask21_frag_src, "img_21_mask21", SHD_IMAGE, SHD_SAM21, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMG_22_MASK21, img_22_mask21_vert_src, img_22_mask21_frag_src, "img_22_mask21", SHD_IMAGE, SHD_SAM22, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMG_12_BGRA_MASK21, img_12_bgra_mask21_vert_src, img_12_bgra_mask21_frag_src, "img_12_bgra_mask21", SHD_IMAGE, SHD_SAM12, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMG_21_BGRA_MASK21, img_21_bgra_mask21_vert_src, img_21_bgra_mask21_frag_src, "img_21_bgra_mask21", SHD_IMAGE, SHD_SAM21, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMG_22_BGRA_MASK21, img_22_bgra_mask21_vert_src, img_22_bgra_mask21_frag_src, "img_22_bgra_mask21", SHD_IMAGE, SHD_SAM22, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMG_MASK21_NOMUL, img_mask21_nomul_vert_src, img_mask21_nomul_frag_src, "img_mask21_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMG_BGRA_MASK21_NOMUL, img_bgra_mask21_nomul_vert_src, img_bgra_mask21_nomul_frag_src, "img_bgra_mask21_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMG_12_MASK21_NOMUL, img_12_mask21_nomul_vert_src, img_12_mask21_nomul_frag_src, "img_12_mask21_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMG_21_MASK21_NOMUL, img_21_mask21_nomul_vert_src, img_21_mask21_nomul_frag_src, "img_21_mask21_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMG_22_MASK21_NOMUL, img_22_mask21_nomul_vert_src, img_22_mask21_nomul_frag_src, "img_22_mask21_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMG_12_BGRA_MASK21_NOMUL, img_12_bgra_mask21_nomul_vert_src, img_12_bgra_mask21_nomul_frag_src, "img_12_bgra_mask21_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMG_21_BGRA_MASK21_NOMUL, img_21_bgra_mask21_nomul_vert_src, img_21_bgra_mask21_nomul_frag_src, "img_21_bgra_mask21_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMG_22_BGRA_MASK21_NOMUL, img_22_bgra_mask21_nomul_vert_src, img_22_bgra_mask21_nomul_frag_src, "img_22_bgra_mask21_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMG_MASK22, img_mask22_vert_src, img_mask22_frag_src, "img_mask22", SHD_IMAGE, SHD_SAM11, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG_BGRA_MASK22, img_bgra_mask22_vert_src, img_bgra_mask22_frag_src, "img_bgra_mask22", SHD_IMAGE, SHD_SAM11, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMG_12_MASK22, img_12_mask22_vert_src, img_12_mask22_frag_src, "img_12_mask22", SHD_IMAGE, SHD_SAM12, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG_21_MASK22, img_21_mask22_vert_src, img_21_mask22_frag_src, "img_21_mask22", SHD_IMAGE, SHD_SAM21, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG_22_MASK22, img_22_mask22_vert_src, img_22_mask22_frag_src, "img_22_mask22", SHD_IMAGE, SHD_SAM22, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG_12_BGRA_MASK22, img_12_bgra_mask22_vert_src, img_12_bgra_mask22_frag_src, "img_12_bgra_mask22", SHD_IMAGE, SHD_SAM12, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMG_21_BGRA_MASK22, img_21_bgra_mask22_vert_src, img_21_bgra_mask22_frag_src, "img_21_bgra_mask22", SHD_IMAGE, SHD_SAM21, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMG_22_BGRA_MASK22, img_22_bgra_mask22_vert_src, img_22_bgra_mask22_frag_src, "img_22_bgra_mask22", SHD_IMAGE, SHD_SAM22, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMG_MASK22_NOMUL, img_mask22_nomul_vert_src, img_mask22_nomul_frag_src, "img_mask22_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMG_BGRA_MASK22_NOMUL, img_bgra_mask22_nomul_vert_src, img_bgra_mask22_nomul_frag_src, "img_bgra_mask22_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMG_12_MASK22_NOMUL, img_12_mask22_nomul_vert_src, img_12_mask22_nomul_frag_src, "img_12_mask22_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMG_21_MASK22_NOMUL, img_21_mask22_nomul_vert_src, img_21_mask22_nomul_frag_src, "img_21_mask22_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMG_22_MASK22_NOMUL, img_22_mask22_nomul_vert_src, img_22_mask22_nomul_frag_src, "img_22_mask22_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMG_12_BGRA_MASK22_NOMUL, img_12_bgra_mask22_nomul_vert_src, img_12_bgra_mask22_nomul_frag_src, "img_12_bgra_mask22_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMG_21_BGRA_MASK22_NOMUL, img_21_bgra_mask22_nomul_vert_src, img_21_bgra_mask22_nomul_frag_src, "img_21_bgra_mask22_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMG_22_BGRA_MASK22_NOMUL, img_22_bgra_mask22_nomul_vert_src, img_22_bgra_mask22_nomul_frag_src, "img_22_bgra_mask22_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMG_AFILL, img_afill_vert_src, img_afill_frag_src, "img_afill", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMG_BGRA_AFILL, img_bgra_afill_vert_src, img_bgra_afill_frag_src, "img_bgra_afill", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMG_NOMUL_AFILL, img_nomul_afill_vert_src, img_nomul_afill_frag_src, "img_nomul_afill", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMG_BGRA_NOMUL_AFILL, img_bgra_nomul_afill_vert_src, img_bgra_nomul_afill_frag_src, "img_bgra_nomul_afill", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMG_12_AFILL, img_12_afill_vert_src, img_12_afill_frag_src, "img_12_afill", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMG_21_AFILL, img_21_afill_vert_src, img_21_afill_frag_src, "img_21_afill", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMG_22_AFILL, img_22_afill_vert_src, img_22_afill_frag_src, "img_22_afill", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMG_12_BGRA_AFILL, img_12_bgra_afill_vert_src, img_12_bgra_afill_frag_src, "img_12_bgra_afill", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMG_21_BGRA_AFILL, img_21_bgra_afill_vert_src, img_21_bgra_afill_frag_src, "img_21_bgra_afill", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMG_22_BGRA_AFILL, img_22_bgra_afill_vert_src, img_22_bgra_afill_frag_src, "img_22_bgra_afill", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMG_12_NOMUL_AFILL, img_12_nomul_afill_vert_src, img_12_nomul_afill_frag_src, "img_12_nomul_afill", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMG_21_NOMUL_AFILL, img_21_nomul_afill_vert_src, img_21_nomul_afill_frag_src, "img_21_nomul_afill", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMG_22_NOMUL_AFILL, img_22_nomul_afill_vert_src, img_22_nomul_afill_frag_src, "img_22_nomul_afill", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMG_12_BGRA_NOMUL_AFILL, img_12_bgra_nomul_afill_vert_src, img_12_bgra_nomul_afill_frag_src, "img_12_bgra_nomul_afill", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMG_21_BGRA_NOMUL_AFILL, img_21_bgra_nomul_afill_vert_src, img_21_bgra_nomul_afill_frag_src, "img_21_bgra_nomul_afill", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMG_22_BGRA_NOMUL_AFILL, img_22_bgra_nomul_afill_vert_src, img_22_bgra_nomul_afill_frag_src, "img_22_bgra_nomul_afill", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMGNAT, imgnat_vert_src, imgnat_frag_src, "imgnat", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMGNAT_BGRA, imgnat_bgra_vert_src, imgnat_bgra_frag_src, "imgnat_bgra", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMGNAT_12, imgnat_12_vert_src, imgnat_12_frag_src, "imgnat_12", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMGNAT_21, imgnat_21_vert_src, imgnat_21_frag_src, "imgnat_21", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMGNAT_22, imgnat_22_vert_src, imgnat_22_frag_src, "imgnat_22", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMGNAT_12_BGRA, imgnat_12_bgra_vert_src, imgnat_12_bgra_frag_src, "imgnat_12_bgra", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMGNAT_21_BGRA, imgnat_21_bgra_vert_src, imgnat_21_bgra_frag_src, "imgnat_21_bgra", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMGNAT_22_BGRA, imgnat_22_bgra_vert_src, imgnat_22_bgra_frag_src, "imgnat_22_bgra", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMGNAT_MASK, imgnat_mask_vert_src, imgnat_mask_frag_src, "imgnat_mask", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMGNAT_BGRA_MASK, imgnat_bgra_mask_vert_src, imgnat_bgra_mask_frag_src, "imgnat_bgra_mask", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMGNAT_12_MASK, imgnat_12_mask_vert_src, imgnat_12_mask_frag_src, "imgnat_12_mask", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMGNAT_21_MASK, imgnat_21_mask_vert_src, imgnat_21_mask_frag_src, "imgnat_21_mask", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMGNAT_22_MASK, imgnat_22_mask_vert_src, imgnat_22_mask_frag_src, "imgnat_22_mask", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK, imgnat_12_bgra_mask_vert_src, imgnat_12_bgra_mask_frag_src, "imgnat_12_bgra_mask", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK, imgnat_21_bgra_mask_vert_src, imgnat_21_bgra_mask_frag_src, "imgnat_21_bgra_mask", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK, imgnat_22_bgra_mask_vert_src, imgnat_22_bgra_mask_frag_src, "imgnat_22_bgra_mask", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMGNAT_NOMUL, imgnat_nomul_vert_src, imgnat_nomul_frag_src, "imgnat_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMGNAT_BGRA_NOMUL, imgnat_bgra_nomul_vert_src, imgnat_bgra_nomul_frag_src, "imgnat_bgra_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMGNAT_12_NOMUL, imgnat_12_nomul_vert_src, imgnat_12_nomul_frag_src, "imgnat_12_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMGNAT_21_NOMUL, imgnat_21_nomul_vert_src, imgnat_21_nomul_frag_src, "imgnat_21_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMGNAT_22_NOMUL, imgnat_22_nomul_vert_src, imgnat_22_nomul_frag_src, "imgnat_22_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_NOMUL, imgnat_12_bgra_nomul_vert_src, imgnat_12_bgra_nomul_frag_src, "imgnat_12_bgra_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_NOMUL, imgnat_21_bgra_nomul_vert_src, imgnat_21_bgra_nomul_frag_src, "imgnat_21_bgra_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_NOMUL, imgnat_22_bgra_nomul_vert_src, imgnat_22_bgra_nomul_frag_src, "imgnat_22_bgra_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMGNAT_MASK_NOMUL, imgnat_mask_nomul_vert_src, imgnat_mask_nomul_frag_src, "imgnat_mask_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMGNAT_BGRA_MASK_NOMUL, imgnat_bgra_mask_nomul_vert_src, imgnat_bgra_mask_nomul_frag_src, "imgnat_bgra_mask_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMGNAT_12_MASK_NOMUL, imgnat_12_mask_nomul_vert_src, imgnat_12_mask_nomul_frag_src, "imgnat_12_mask_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMGNAT_21_MASK_NOMUL, imgnat_21_mask_nomul_vert_src, imgnat_21_mask_nomul_frag_src, "imgnat_21_mask_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMGNAT_22_MASK_NOMUL, imgnat_22_mask_nomul_vert_src, imgnat_22_mask_nomul_frag_src, "imgnat_22_mask_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK_NOMUL, imgnat_12_bgra_mask_nomul_vert_src, imgnat_12_bgra_mask_nomul_frag_src, "imgnat_12_bgra_mask_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK_NOMUL, imgnat_21_bgra_mask_nomul_vert_src, imgnat_21_bgra_mask_nomul_frag_src, "imgnat_21_bgra_mask_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK_NOMUL, imgnat_22_bgra_mask_nomul_vert_src, imgnat_22_bgra_mask_nomul_frag_src, "imgnat_22_bgra_mask_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMGNAT_MASK12, imgnat_mask12_vert_src, imgnat_mask12_frag_src, "imgnat_mask12", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMGNAT_BGRA_MASK12, imgnat_bgra_mask12_vert_src, imgnat_bgra_mask12_frag_src, "imgnat_bgra_mask12", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMGNAT_12_MASK12, imgnat_12_mask12_vert_src, imgnat_12_mask12_frag_src, "imgnat_12_mask12", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMGNAT_21_MASK12, imgnat_21_mask12_vert_src, imgnat_21_mask12_frag_src, "imgnat_21_mask12", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMGNAT_22_MASK12, imgnat_22_mask12_vert_src, imgnat_22_mask12_frag_src, "imgnat_22_mask12", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK12, imgnat_12_bgra_mask12_vert_src, imgnat_12_bgra_mask12_frag_src, "imgnat_12_bgra_mask12", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK12, imgnat_21_bgra_mask12_vert_src, imgnat_21_bgra_mask12_frag_src, "imgnat_21_bgra_mask12", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK12, imgnat_22_bgra_mask12_vert_src, imgnat_22_bgra_mask12_frag_src, "imgnat_22_bgra_mask12", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMGNAT_MASK12_NOMUL, imgnat_mask12_nomul_vert_src, imgnat_mask12_nomul_frag_src, "imgnat_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMGNAT_BGRA_MASK12_NOMUL, imgnat_bgra_mask12_nomul_vert_src, imgnat_bgra_mask12_nomul_frag_src, "imgnat_bgra_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMGNAT_12_MASK12_NOMUL, imgnat_12_mask12_nomul_vert_src, imgnat_12_mask12_nomul_frag_src, "imgnat_12_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMGNAT_21_MASK12_NOMUL, imgnat_21_mask12_nomul_vert_src, imgnat_21_mask12_nomul_frag_src, "imgnat_21_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMGNAT_22_MASK12_NOMUL, imgnat_22_mask12_nomul_vert_src, imgnat_22_mask12_nomul_frag_src, "imgnat_22_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK12_NOMUL, imgnat_12_bgra_mask12_nomul_vert_src, imgnat_12_bgra_mask12_nomul_frag_src, "imgnat_12_bgra_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK12_NOMUL, imgnat_21_bgra_mask12_nomul_vert_src, imgnat_21_bgra_mask12_nomul_frag_src, "imgnat_21_bgra_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK12_NOMUL, imgnat_22_bgra_mask12_nomul_vert_src, imgnat_22_bgra_mask12_nomul_frag_src, "imgnat_22_bgra_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMGNAT_MASK21, imgnat_mask21_vert_src, imgnat_mask21_frag_src, "imgnat_mask21", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMGNAT_BGRA_MASK21, imgnat_bgra_mask21_vert_src, imgnat_bgra_mask21_frag_src, "imgnat_bgra_mask21", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMGNAT_12_MASK21, imgnat_12_mask21_vert_src, imgnat_12_mask21_frag_src, "imgnat_12_mask21", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMGNAT_21_MASK21, imgnat_21_mask21_vert_src, imgnat_21_mask21_frag_src, "imgnat_21_mask21", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMGNAT_22_MASK21, imgnat_22_mask21_vert_src, imgnat_22_mask21_frag_src, "imgnat_22_mask21", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK21, imgnat_12_bgra_mask21_vert_src, imgnat_12_bgra_mask21_frag_src, "imgnat_12_bgra_mask21", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK21, imgnat_21_bgra_mask21_vert_src, imgnat_21_bgra_mask21_frag_src, "imgnat_21_bgra_mask21", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK21, imgnat_22_bgra_mask21_vert_src, imgnat_22_bgra_mask21_frag_src, "imgnat_22_bgra_mask21", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMGNAT_MASK21_NOMUL, imgnat_mask21_nomul_vert_src, imgnat_mask21_nomul_frag_src, "imgnat_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMGNAT_BGRA_MASK21_NOMUL, imgnat_bgra_mask21_nomul_vert_src, imgnat_bgra_mask21_nomul_frag_src, "imgnat_bgra_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMGNAT_12_MASK21_NOMUL, imgnat_12_mask21_nomul_vert_src, imgnat_12_mask21_nomul_frag_src, "imgnat_12_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMGNAT_21_MASK21_NOMUL, imgnat_21_mask21_nomul_vert_src, imgnat_21_mask21_nomul_frag_src, "imgnat_21_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMGNAT_22_MASK21_NOMUL, imgnat_22_mask21_nomul_vert_src, imgnat_22_mask21_nomul_frag_src, "imgnat_22_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK21_NOMUL, imgnat_12_bgra_mask21_nomul_vert_src, imgnat_12_bgra_mask21_nomul_frag_src, "imgnat_12_bgra_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK21_NOMUL, imgnat_21_bgra_mask21_nomul_vert_src, imgnat_21_bgra_mask21_nomul_frag_src, "imgnat_21_bgra_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK21_NOMUL, imgnat_22_bgra_mask21_nomul_vert_src, imgnat_22_bgra_mask21_nomul_frag_src, "imgnat_22_bgra_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMGNAT_MASK22, imgnat_mask22_vert_src, imgnat_mask22_frag_src, "imgnat_mask22", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMGNAT_BGRA_MASK22, imgnat_bgra_mask22_vert_src, imgnat_bgra_mask22_frag_src, "imgnat_bgra_mask22", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMGNAT_12_MASK22, imgnat_12_mask22_vert_src, imgnat_12_mask22_frag_src, "imgnat_12_mask22", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMGNAT_21_MASK22, imgnat_21_mask22_vert_src, imgnat_21_mask22_frag_src, "imgnat_21_mask22", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMGNAT_22_MASK22, imgnat_22_mask22_vert_src, imgnat_22_mask22_frag_src, "imgnat_22_mask22", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK22, imgnat_12_bgra_mask22_vert_src, imgnat_12_bgra_mask22_frag_src, "imgnat_12_bgra_mask22", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK22, imgnat_21_bgra_mask22_vert_src, imgnat_21_bgra_mask22_frag_src, "imgnat_21_bgra_mask22", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK22, imgnat_22_bgra_mask22_vert_src, imgnat_22_bgra_mask22_frag_src, "imgnat_22_bgra_mask22", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMGNAT_MASK22_NOMUL, imgnat_mask22_nomul_vert_src, imgnat_mask22_nomul_frag_src, "imgnat_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMGNAT_BGRA_MASK22_NOMUL, imgnat_bgra_mask22_nomul_vert_src, imgnat_bgra_mask22_nomul_frag_src, "imgnat_bgra_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMGNAT_12_MASK22_NOMUL, imgnat_12_mask22_nomul_vert_src, imgnat_12_mask22_nomul_frag_src, "imgnat_12_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMGNAT_21_MASK22_NOMUL, imgnat_21_mask22_nomul_vert_src, imgnat_21_mask22_nomul_frag_src, "imgnat_21_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMGNAT_22_MASK22_NOMUL, imgnat_22_mask22_nomul_vert_src, imgnat_22_mask22_nomul_frag_src, "imgnat_22_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK22_NOMUL, imgnat_12_bgra_mask22_nomul_vert_src, imgnat_12_bgra_mask22_nomul_frag_src, "imgnat_12_bgra_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK22_NOMUL, imgnat_21_bgra_mask22_nomul_vert_src, imgnat_21_bgra_mask22_nomul_frag_src, "imgnat_21_bgra_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK22_NOMUL, imgnat_22_bgra_mask22_nomul_vert_src, imgnat_22_bgra_mask22_nomul_frag_src, "imgnat_22_bgra_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMGNAT_AFILL, imgnat_afill_vert_src, imgnat_afill_frag_src, "imgnat_afill", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMGNAT_BGRA_AFILL, imgnat_bgra_afill_vert_src, imgnat_bgra_afill_frag_src, "imgnat_bgra_afill", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMGNAT_NOMUL_AFILL, imgnat_nomul_afill_vert_src, imgnat_nomul_afill_frag_src, "imgnat_nomul_afill", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMGNAT_BGRA_NOMUL_AFILL, imgnat_bgra_nomul_afill_vert_src, imgnat_bgra_nomul_afill_frag_src, "imgnat_bgra_nomul_afill", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMGNAT_12_AFILL, imgnat_12_afill_vert_src, imgnat_12_afill_frag_src, "imgnat_12_afill", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMGNAT_21_AFILL, imgnat_21_afill_vert_src, imgnat_21_afill_frag_src, "imgnat_21_afill", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMGNAT_22_AFILL, imgnat_22_afill_vert_src, imgnat_22_afill_frag_src, "imgnat_22_afill", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMGNAT_12_BGRA_AFILL, imgnat_12_bgra_afill_vert_src, imgnat_12_bgra_afill_frag_src, "imgnat_12_bgra_afill", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMGNAT_21_BGRA_AFILL, imgnat_21_bgra_afill_vert_src, imgnat_21_bgra_afill_frag_src, "imgnat_21_bgra_afill", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMGNAT_22_BGRA_AFILL, imgnat_22_bgra_afill_vert_src, imgnat_22_bgra_afill_frag_src, "imgnat_22_bgra_afill", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMGNAT_12_NOMUL_AFILL, imgnat_12_nomul_afill_vert_src, imgnat_12_nomul_afill_frag_src, "imgnat_12_nomul_afill", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMGNAT_21_NOMUL_AFILL, imgnat_21_nomul_afill_vert_src, imgnat_21_nomul_afill_frag_src, "imgnat_21_nomul_afill", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMGNAT_22_NOMUL_AFILL, imgnat_22_nomul_afill_vert_src, imgnat_22_nomul_afill_frag_src, "imgnat_22_nomul_afill", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMGNAT_12_BGRA_NOMUL_AFILL, imgnat_12_bgra_nomul_afill_vert_src, imgnat_12_bgra_nomul_afill_frag_src, "imgnat_12_bgra_nomul_afill", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMGNAT_21_BGRA_NOMUL_AFILL, imgnat_21_bgra_nomul_afill_vert_src, imgnat_21_bgra_nomul_afill_frag_src, "imgnat_21_bgra_nomul_afill", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMGNAT_22_BGRA_NOMUL_AFILL, imgnat_22_bgra_nomul_afill_vert_src, imgnat_22_bgra_nomul_afill_frag_src, "imgnat_22_bgra_nomul_afill", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_RGB_A_PAIR, rgb_a_pair_vert_src, rgb_a_pair_frag_src, "rgb_a_pair", SHD_RGB_A_PAIR, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_RGB_A_PAIR_MASK, rgb_a_pair_mask_vert_src, rgb_a_pair_mask_frag_src, "rgb_a_pair_mask", SHD_RGB_A_PAIR, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_RGB_A_PAIR_NOMUL, rgb_a_pair_nomul_vert_src, rgb_a_pair_nomul_frag_src, "rgb_a_pair_nomul", SHD_RGB_A_PAIR, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_RGB_A_PAIR_MASK_NOMUL, rgb_a_pair_mask_nomul_vert_src, rgb_a_pair_mask_nomul_frag_src, "rgb_a_pair_mask_nomul", SHD_RGB_A_PAIR, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_TEX_EXTERNAL, tex_external_vert_src, tex_external_frag_src, "tex_external", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_TEX_EXTERNAL_AFILL, tex_external_afill_vert_src, tex_external_afill_frag_src, "tex_external_afill", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_TEX_EXTERNAL_NOMUL, tex_external_nomul_vert_src, tex_external_nomul_frag_src, "tex_external_nomul", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_TEX_EXTERNAL_NOMUL_AFILL, tex_external_nomul_afill_vert_src, tex_external_nomul_afill_frag_src, "tex_external_nomul_afill", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_TEX_EXTERNAL_MASK, tex_external_mask_vert_src, tex_external_mask_frag_src, "tex_external_mask", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_TEX_EXTERNAL_MASK_NOMUL, tex_external_mask_nomul_vert_src, tex_external_mask_nomul_frag_src, "tex_external_mask_nomul", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_YUV, yuv_vert_src, yuv_frag_src, "yuv", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_YUV_NOMUL, yuv_nomul_vert_src, yuv_nomul_frag_src, "yuv_nomul", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_YUV_MASK, yuv_mask_vert_src, yuv_mask_frag_src, "yuv_mask", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_YUV_MASK_NOMUL, yuv_mask_nomul_vert_src, yuv_mask_nomul_frag_src, "yuv_mask_nomul", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_YUY2, yuy2_vert_src, yuy2_frag_src, "yuy2", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_YUY2_NOMUL, yuy2_nomul_vert_src, yuy2_nomul_frag_src, "yuy2_nomul", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_YUY2_MASK, yuy2_mask_vert_src, yuy2_mask_frag_src, "yuy2_mask", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_YUY2_MASK_NOMUL, yuy2_mask_nomul_vert_src, yuy2_mask_nomul_frag_src, "yuy2_mask_nomul", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_NV12, nv12_vert_src, nv12_frag_src, "nv12", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_NV12_NOMUL, nv12_nomul_vert_src, nv12_nomul_frag_src, "nv12_nomul", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_NV12_MASK, nv12_mask_vert_src, nv12_mask_frag_src, "nv12_mask", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_NV12_MASK_NOMUL, nv12_mask_nomul_vert_src, nv12_mask_nomul_frag_src, "nv12_mask_nomul", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_YUV_709, yuv_709_vert_src, yuv_709_frag_src, "yuv_709", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_YUV_709_NOMUL, yuv_709_nomul_vert_src, yuv_709_nomul_frag_src, "yuv_709_nomul", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_YUV_709_MASK, yuv_709_mask_vert_src, yuv_709_mask_frag_src, "yuv_709_mask", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_YUV_709_MASK_NOMUL, yuv_709_mask_nomul_vert_src, yuv_709_mask_nomul_frag_src, "yuv_709_mask_nomul", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_YUY2_709, yuy2_709_vert_src, yuy2_709_frag_src, "yuy2_709", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_YUY2_709_NOMUL, yuy2_709_nomul_vert_src, yuy2_709_nomul_frag_src, "yuy2_709_nomul", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_YUY2_709_MASK, yuy2_709_mask_vert_src, yuy2_709_mask_frag_src, "yuy2_709_mask", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_YUY2_709_MASK_NOMUL, yuy2_709_mask_nomul_vert_src, yuy2_709_mask_nomul_frag_src, "yuy2_709_mask_nomul", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_NV12_709, nv12_709_vert_src, nv12_709_frag_src, "nv12_709", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_NV12_709_NOMUL, nv12_709_nomul_vert_src, nv12_709_nomul_frag_src, "nv12_709_nomul", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_NV12_709_MASK, nv12_709_mask_vert_src, nv12_709_mask_frag_src, "nv12_709_mask", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_NV12_709_MASK_NOMUL, nv12_709_mask_nomul_vert_src, nv12_709_mask_nomul_frag_src, "nv12_709_mask_nomul", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, -}; - diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders_bigendian.x b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders_bigendian.x deleted file mode 100644 index edad70dd85..0000000000 --- a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders_bigendian.x +++ /dev/null @@ -1,13345 +0,0 @@ -/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */ -/* IF IT IS CHANGED PLEASE COMMIT THE CHANGES */ - -#include "../evas_gl_private.h" - -static const char rect_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char rect_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - "}\n"; - -static const char rect_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char rect_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char rect_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char rect_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char rect_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char rect_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char rect_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = vec4(1, 1, 1, 1);\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char rect_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char font_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char font_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char font_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char font_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char font_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char font_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char font_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char font_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char font_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).aaaa;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char font_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_12_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_12_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_21_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_21_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_22_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char img_22_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char img_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).gbar;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).grab;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char img_12_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_12_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_21_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_22_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_12_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_21_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_22_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_12_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_21_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).gbar;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).gbar;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).gbar;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).gbar;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_22_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char img_12_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_12_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_21_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_21_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char img_22_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).grab;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).grab;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).grab;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).grab;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char img_22_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_bgra_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_bgra_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(0, -tex_masksample.y);\n" - " masktex_s[1] = vec2(0, tex_masksample.y);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask21_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask21_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask21_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " ma = (ma00 + ma01) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask21_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, 0);\n" - " masktex_s[1] = vec2( tex_masksample.x, 0);\n" - " maskdiv_s = 2.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask22_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask22_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_12_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_12_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_21_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_21_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_22_bgra_mask22_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " float ma;\n" - " float ma00 = texture2D(texm, tex_m + masktex_s[0]).a;\n" - " float ma01 = texture2D(texm, tex_m + masktex_s[1]).a;\n" - " float ma10 = texture2D(texm, tex_m + masktex_s[2]).a;\n" - " float ma11 = texture2D(texm, tex_m + masktex_s[3]).a;\n" - " ma = (ma00 + ma01 + ma10 + ma11) / maskdiv_s;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char imgnat_22_bgra_mask22_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "attribute vec2 tex_masksample;\n" - "varying float maskdiv_s;\n" - "varying vec2 masktex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - " masktex_s[0] = vec2(-tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[1] = vec2( tex_masksample.x, -tex_masksample.y);\n" - " masktex_s[2] = vec2( tex_masksample.x, tex_masksample.y);\n" - " masktex_s[3] = vec2(-tex_masksample.x, tex_masksample.y);\n" - " maskdiv_s = 4.0;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char imgnat_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).rgba;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char imgnat_12_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_12_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_21_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_22_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_12_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_21_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_bgra_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_22_bgra_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_12_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_21_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_22_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char imgnat_12_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_12_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(0, -tex_sample.y);\n" - " tex_s[1] = vec2(0, tex_sample.y);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_21_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " c = (col00 + col01) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_21_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[2];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, 0);\n" - " tex_s[1] = vec2( tex_sample.x, 0);\n" - " div_s = vec4(2, 2, 2, 2);\n" - "}\n"; - -static const char imgnat_22_bgra_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " vec4 col00 = texture2D(tex, tex_c + tex_s[0]).rgba;\n" - " vec4 col01 = texture2D(tex, tex_c + tex_s[1]).rgba;\n" - " vec4 col10 = texture2D(tex, tex_c + tex_s[2]).rgba;\n" - " vec4 col11 = texture2D(tex, tex_c + tex_s[3]).rgba;\n" - " c = (col00 + col01 + col10 + col11) / div_s;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char imgnat_22_bgra_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_sample;\n" - "varying vec4 div_s;\n" - "varying vec2 tex_s[4];\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" - " tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" - " tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" - " tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" - " div_s = vec4(4, 4, 4, 4);\n" - "}\n"; - -static const char rgb_a_pair_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texa;\n" - "varying vec2 tex_a;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * texture2D(texa, tex_a).r\n" - " ;\n" - "}\n"; - -static const char rgb_a_pair_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coorda;\n" - "varying vec2 tex_a;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_a = tex_coorda;\n" - "}\n"; - -static const char rgb_a_pair_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texa;\n" - "varying vec2 tex_a;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " * texture2D(texa, tex_a).r\n" - " ;\n" - "}\n"; - -static const char rgb_a_pair_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coorda;\n" - "varying vec2 tex_a;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_a = tex_coorda;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char rgb_a_pair_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texa;\n" - "varying vec2 tex_a;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * texture2D(texa, tex_a).r\n" - " ;\n" - "}\n"; - -static const char rgb_a_pair_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coorda;\n" - "varying vec2 tex_a;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_a = tex_coorda;\n" - "}\n"; - -static const char rgb_a_pair_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texa;\n" - "varying vec2 tex_a;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " * texture2D(texa, tex_a).r\n" - " ;\n" - "}\n"; - -static const char rgb_a_pair_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coorda;\n" - "varying vec2 tex_a;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_a = tex_coorda;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char tex_external_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" - "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" - "#endif\n" - "varying vec4 col;\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char tex_external_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char tex_external_afill_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" - "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" - "#endif\n" - "varying vec4 col;\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char tex_external_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char tex_external_nomul_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" - "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" - "#endif\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char tex_external_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char tex_external_nomul_afill_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" - "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" - "#endif\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - " gl_FragColor.a = 1.0;\n" - "}\n"; - -static const char tex_external_nomul_afill_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - "}\n"; - -static const char tex_external_mask_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" - "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" - "#endif\n" - "varying vec4 col;\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char tex_external_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char tex_external_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "# extension GL_OES_EGL_image_external : require\n" - "# ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "# else\n" - "precision mediump float;\n" - "# endif\n" - "# define SAMPLER_EXTERNAL_OES samplerExternalOES\n" - "#else\n" - "# define SAMPLER_EXTERNAL_OES sampler2D\n" - "#endif\n" - "uniform SAMPLER_EXTERNAL_OES tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " c = texture2D(tex, tex_c).bgra;\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char tex_external_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuv_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char yuv_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - "}\n"; - -static const char yuv_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char yuv_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - "}\n"; - -static const char yuv_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuv_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuv_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuv_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuy2_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char yuy2_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - "}\n"; - -static const char yuy2_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char yuy2_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - "}\n"; - -static const char yuy2_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuy2_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuy2_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuy2_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char nv12_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char nv12_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - "}\n"; - -static const char nv12_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char nv12_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - "}\n"; - -static const char nv12_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char nv12_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char nv12_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.813) + (u * 0.391);\n" - " v = v * 1.596;\n" - " u = u * 2.018;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char nv12_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuv_709_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char yuv_709_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - "}\n"; - -static const char yuv_709_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char yuv_709_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - "}\n"; - -static const char yuv_709_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuv_709_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuv_709_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texu;\n" - "uniform sampler2D texv;\n" - "varying vec2 tex_c2;\n" - "varying vec2 tex_c3;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).r;\n" - " u = texture2D(texu, tex_c2).r;\n" - " v = texture2D(texv, tex_c3).r;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuv_709_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec2 tex_coord3;\n" - "varying vec2 tex_c3;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2;\n" - " tex_c3 = tex_coord3;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuy2_709_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char yuy2_709_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - "}\n"; - -static const char yuy2_709_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char yuy2_709_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - "}\n"; - -static const char yuy2_709_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuy2_709_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char yuy2_709_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char yuy2_709_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = vec2(tex_coord2.x * 0.5, tex_coord2.y);\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char nv12_709_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " ;\n" - "}\n"; - -static const char nv12_709_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - "}\n"; - -static const char nv12_709_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " gl_FragColor =\n" - " c\n" - " ;\n" - "}\n"; - -static const char nv12_709_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - "}\n"; - -static const char nv12_709_mask_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "varying vec4 col;\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * col\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char nv12_709_mask_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec4 color;\n" - "varying vec4 col;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " col = color;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - -static const char nv12_709_mask_nomul_frag_src[] = - "#ifdef GL_ES\n" - "#ifdef GL_FRAGMENT_PRECISION_HIGH\n" - "precision highp float;\n" - "#else\n" - "precision mediump float;\n" - "#endif\n" - "#endif\n" - "uniform sampler2D tex;\n" - "varying vec2 tex_c;\n" - "uniform sampler2D texuv;\n" - "varying vec2 tex_c2;\n" - "uniform sampler2D texm;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " vec4 c;\n" - " float r, g, b, y, u, v, vmu;\n" - " y = texture2D(tex, tex_c).g;\n" - " u = texture2D(texuv, tex_c2).g;\n" - " v = texture2D(texuv, tex_c2).a;\n" - " u = u - 0.5;\n" - " v = v - 0.5;\n" - " y = (y - 0.062) * 1.164;\n" - " vmu = (v * 0.534) + (u * 0.213);\n" - " v = v * 1.793;\n" - " u = u * 2.115;\n" - " r = y + v;\n" - " g = y - vmu;\n" - " b = y + u;\n" - " c = vec4(r, g, b, 1.0);\n" - " float ma;\n" - " ma = texture2D(texm, tex_m).a;\n" - " gl_FragColor =\n" - " c\n" - " * ma\n" - " ;\n" - "}\n"; - -static const char nv12_709_mask_nomul_vert_src[] = - "#ifdef GL_ES\n" - "precision highp float;\n" - "#endif\n" - "attribute vec4 vertex;\n" - "uniform mat4 mvp;\n" - "attribute vec2 tex_coord;\n" - "varying vec2 tex_c;\n" - "attribute vec2 tex_coord2;\n" - "varying vec2 tex_c2;\n" - "attribute vec4 mask_coord;\n" - "varying vec2 tex_m;\n" - "void main()\n" - "{\n" - " gl_Position = mvp * vertex;\n" - " tex_c = tex_coord;\n" - " tex_c2 = tex_coord2 * 0.5;\n" - " vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" - " tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;\n" - "}\n"; - - -static const struct { - Evas_GL_Shader id; - const char *vert; - const char *frag; - const char *name; - Shader_Type type; - Shader_Sampling sam; - Shader_Sampling masksam; - Eina_Bool bgra : 1; - Eina_Bool mask : 1; - Eina_Bool nomul : 1; - Eina_Bool afill : 1; -} _shaders_source[] = { - { SHADER_RECT, rect_vert_src, rect_frag_src, "rect", SHD_RECT, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_RECT_MASK, rect_mask_vert_src, rect_mask_frag_src, "rect_mask", SHD_RECT, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_RECT_MASK12, rect_mask12_vert_src, rect_mask12_frag_src, "rect_mask12", SHD_RECT, SHD_SAM11, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_RECT_MASK21, rect_mask21_vert_src, rect_mask21_frag_src, "rect_mask21", SHD_RECT, SHD_SAM11, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_RECT_MASK22, rect_mask22_vert_src, rect_mask22_frag_src, "rect_mask22", SHD_RECT, SHD_SAM11, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_FONT, font_vert_src, font_frag_src, "font", SHD_FONT, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_FONT_MASK, font_mask_vert_src, font_mask_frag_src, "font_mask", SHD_FONT, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_FONT_MASK12, font_mask12_vert_src, font_mask12_frag_src, "font_mask12", SHD_FONT, SHD_SAM11, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_FONT_MASK21, font_mask21_vert_src, font_mask21_frag_src, "font_mask21", SHD_FONT, SHD_SAM11, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_FONT_MASK22, font_mask22_vert_src, font_mask22_frag_src, "font_mask22", SHD_FONT, SHD_SAM11, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG, img_vert_src, img_frag_src, "img", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMG_BGRA, img_bgra_vert_src, img_bgra_frag_src, "img_bgra", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMG_12, img_12_vert_src, img_12_frag_src, "img_12", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMG_21, img_21_vert_src, img_21_frag_src, "img_21", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMG_22, img_22_vert_src, img_22_frag_src, "img_22", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMG_12_BGRA, img_12_bgra_vert_src, img_12_bgra_frag_src, "img_12_bgra", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMG_21_BGRA, img_21_bgra_vert_src, img_21_bgra_frag_src, "img_21_bgra", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMG_22_BGRA, img_22_bgra_vert_src, img_22_bgra_frag_src, "img_22_bgra", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMG_MASK, img_mask_vert_src, img_mask_frag_src, "img_mask", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMG_BGRA_MASK, img_bgra_mask_vert_src, img_bgra_mask_frag_src, "img_bgra_mask", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMG_12_MASK, img_12_mask_vert_src, img_12_mask_frag_src, "img_12_mask", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMG_21_MASK, img_21_mask_vert_src, img_21_mask_frag_src, "img_21_mask", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMG_22_MASK, img_22_mask_vert_src, img_22_mask_frag_src, "img_22_mask", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMG_12_BGRA_MASK, img_12_bgra_mask_vert_src, img_12_bgra_mask_frag_src, "img_12_bgra_mask", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMG_21_BGRA_MASK, img_21_bgra_mask_vert_src, img_21_bgra_mask_frag_src, "img_21_bgra_mask", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMG_22_BGRA_MASK, img_22_bgra_mask_vert_src, img_22_bgra_mask_frag_src, "img_22_bgra_mask", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMG_NOMUL, img_nomul_vert_src, img_nomul_frag_src, "img_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMG_BGRA_NOMUL, img_bgra_nomul_vert_src, img_bgra_nomul_frag_src, "img_bgra_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMG_12_NOMUL, img_12_nomul_vert_src, img_12_nomul_frag_src, "img_12_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMG_21_NOMUL, img_21_nomul_vert_src, img_21_nomul_frag_src, "img_21_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMG_22_NOMUL, img_22_nomul_vert_src, img_22_nomul_frag_src, "img_22_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMG_12_BGRA_NOMUL, img_12_bgra_nomul_vert_src, img_12_bgra_nomul_frag_src, "img_12_bgra_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMG_21_BGRA_NOMUL, img_21_bgra_nomul_vert_src, img_21_bgra_nomul_frag_src, "img_21_bgra_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMG_22_BGRA_NOMUL, img_22_bgra_nomul_vert_src, img_22_bgra_nomul_frag_src, "img_22_bgra_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMG_MASK_NOMUL, img_mask_nomul_vert_src, img_mask_nomul_frag_src, "img_mask_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMG_BGRA_MASK_NOMUL, img_bgra_mask_nomul_vert_src, img_bgra_mask_nomul_frag_src, "img_bgra_mask_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMG_12_MASK_NOMUL, img_12_mask_nomul_vert_src, img_12_mask_nomul_frag_src, "img_12_mask_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMG_21_MASK_NOMUL, img_21_mask_nomul_vert_src, img_21_mask_nomul_frag_src, "img_21_mask_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMG_22_MASK_NOMUL, img_22_mask_nomul_vert_src, img_22_mask_nomul_frag_src, "img_22_mask_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMG_12_BGRA_MASK_NOMUL, img_12_bgra_mask_nomul_vert_src, img_12_bgra_mask_nomul_frag_src, "img_12_bgra_mask_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMG_21_BGRA_MASK_NOMUL, img_21_bgra_mask_nomul_vert_src, img_21_bgra_mask_nomul_frag_src, "img_21_bgra_mask_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMG_22_BGRA_MASK_NOMUL, img_22_bgra_mask_nomul_vert_src, img_22_bgra_mask_nomul_frag_src, "img_22_bgra_mask_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMG_MASK12, img_mask12_vert_src, img_mask12_frag_src, "img_mask12", SHD_IMAGE, SHD_SAM11, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMG_BGRA_MASK12, img_bgra_mask12_vert_src, img_bgra_mask12_frag_src, "img_bgra_mask12", SHD_IMAGE, SHD_SAM11, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMG_12_MASK12, img_12_mask12_vert_src, img_12_mask12_frag_src, "img_12_mask12", SHD_IMAGE, SHD_SAM12, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMG_21_MASK12, img_21_mask12_vert_src, img_21_mask12_frag_src, "img_21_mask12", SHD_IMAGE, SHD_SAM21, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMG_22_MASK12, img_22_mask12_vert_src, img_22_mask12_frag_src, "img_22_mask12", SHD_IMAGE, SHD_SAM22, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMG_12_BGRA_MASK12, img_12_bgra_mask12_vert_src, img_12_bgra_mask12_frag_src, "img_12_bgra_mask12", SHD_IMAGE, SHD_SAM12, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMG_21_BGRA_MASK12, img_21_bgra_mask12_vert_src, img_21_bgra_mask12_frag_src, "img_21_bgra_mask12", SHD_IMAGE, SHD_SAM21, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMG_22_BGRA_MASK12, img_22_bgra_mask12_vert_src, img_22_bgra_mask12_frag_src, "img_22_bgra_mask12", SHD_IMAGE, SHD_SAM22, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMG_MASK12_NOMUL, img_mask12_nomul_vert_src, img_mask12_nomul_frag_src, "img_mask12_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMG_BGRA_MASK12_NOMUL, img_bgra_mask12_nomul_vert_src, img_bgra_mask12_nomul_frag_src, "img_bgra_mask12_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMG_12_MASK12_NOMUL, img_12_mask12_nomul_vert_src, img_12_mask12_nomul_frag_src, "img_12_mask12_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMG_21_MASK12_NOMUL, img_21_mask12_nomul_vert_src, img_21_mask12_nomul_frag_src, "img_21_mask12_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMG_22_MASK12_NOMUL, img_22_mask12_nomul_vert_src, img_22_mask12_nomul_frag_src, "img_22_mask12_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMG_12_BGRA_MASK12_NOMUL, img_12_bgra_mask12_nomul_vert_src, img_12_bgra_mask12_nomul_frag_src, "img_12_bgra_mask12_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMG_21_BGRA_MASK12_NOMUL, img_21_bgra_mask12_nomul_vert_src, img_21_bgra_mask12_nomul_frag_src, "img_21_bgra_mask12_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMG_22_BGRA_MASK12_NOMUL, img_22_bgra_mask12_nomul_vert_src, img_22_bgra_mask12_nomul_frag_src, "img_22_bgra_mask12_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMG_MASK21, img_mask21_vert_src, img_mask21_frag_src, "img_mask21", SHD_IMAGE, SHD_SAM11, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMG_BGRA_MASK21, img_bgra_mask21_vert_src, img_bgra_mask21_frag_src, "img_bgra_mask21", SHD_IMAGE, SHD_SAM11, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMG_12_MASK21, img_12_mask21_vert_src, img_12_mask21_frag_src, "img_12_mask21", SHD_IMAGE, SHD_SAM12, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMG_21_MASK21, img_21_mask21_vert_src, img_21_mask21_frag_src, "img_21_mask21", SHD_IMAGE, SHD_SAM21, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMG_22_MASK21, img_22_mask21_vert_src, img_22_mask21_frag_src, "img_22_mask21", SHD_IMAGE, SHD_SAM22, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMG_12_BGRA_MASK21, img_12_bgra_mask21_vert_src, img_12_bgra_mask21_frag_src, "img_12_bgra_mask21", SHD_IMAGE, SHD_SAM12, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMG_21_BGRA_MASK21, img_21_bgra_mask21_vert_src, img_21_bgra_mask21_frag_src, "img_21_bgra_mask21", SHD_IMAGE, SHD_SAM21, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMG_22_BGRA_MASK21, img_22_bgra_mask21_vert_src, img_22_bgra_mask21_frag_src, "img_22_bgra_mask21", SHD_IMAGE, SHD_SAM22, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMG_MASK21_NOMUL, img_mask21_nomul_vert_src, img_mask21_nomul_frag_src, "img_mask21_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMG_BGRA_MASK21_NOMUL, img_bgra_mask21_nomul_vert_src, img_bgra_mask21_nomul_frag_src, "img_bgra_mask21_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMG_12_MASK21_NOMUL, img_12_mask21_nomul_vert_src, img_12_mask21_nomul_frag_src, "img_12_mask21_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMG_21_MASK21_NOMUL, img_21_mask21_nomul_vert_src, img_21_mask21_nomul_frag_src, "img_21_mask21_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMG_22_MASK21_NOMUL, img_22_mask21_nomul_vert_src, img_22_mask21_nomul_frag_src, "img_22_mask21_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMG_12_BGRA_MASK21_NOMUL, img_12_bgra_mask21_nomul_vert_src, img_12_bgra_mask21_nomul_frag_src, "img_12_bgra_mask21_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMG_21_BGRA_MASK21_NOMUL, img_21_bgra_mask21_nomul_vert_src, img_21_bgra_mask21_nomul_frag_src, "img_21_bgra_mask21_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMG_22_BGRA_MASK21_NOMUL, img_22_bgra_mask21_nomul_vert_src, img_22_bgra_mask21_nomul_frag_src, "img_22_bgra_mask21_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMG_MASK22, img_mask22_vert_src, img_mask22_frag_src, "img_mask22", SHD_IMAGE, SHD_SAM11, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG_BGRA_MASK22, img_bgra_mask22_vert_src, img_bgra_mask22_frag_src, "img_bgra_mask22", SHD_IMAGE, SHD_SAM11, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMG_12_MASK22, img_12_mask22_vert_src, img_12_mask22_frag_src, "img_12_mask22", SHD_IMAGE, SHD_SAM12, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG_21_MASK22, img_21_mask22_vert_src, img_21_mask22_frag_src, "img_21_mask22", SHD_IMAGE, SHD_SAM21, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG_22_MASK22, img_22_mask22_vert_src, img_22_mask22_frag_src, "img_22_mask22", SHD_IMAGE, SHD_SAM22, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMG_12_BGRA_MASK22, img_12_bgra_mask22_vert_src, img_12_bgra_mask22_frag_src, "img_12_bgra_mask22", SHD_IMAGE, SHD_SAM12, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMG_21_BGRA_MASK22, img_21_bgra_mask22_vert_src, img_21_bgra_mask22_frag_src, "img_21_bgra_mask22", SHD_IMAGE, SHD_SAM21, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMG_22_BGRA_MASK22, img_22_bgra_mask22_vert_src, img_22_bgra_mask22_frag_src, "img_22_bgra_mask22", SHD_IMAGE, SHD_SAM22, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMG_MASK22_NOMUL, img_mask22_nomul_vert_src, img_mask22_nomul_frag_src, "img_mask22_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMG_BGRA_MASK22_NOMUL, img_bgra_mask22_nomul_vert_src, img_bgra_mask22_nomul_frag_src, "img_bgra_mask22_nomul", SHD_IMAGE, SHD_SAM11, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMG_12_MASK22_NOMUL, img_12_mask22_nomul_vert_src, img_12_mask22_nomul_frag_src, "img_12_mask22_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMG_21_MASK22_NOMUL, img_21_mask22_nomul_vert_src, img_21_mask22_nomul_frag_src, "img_21_mask22_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMG_22_MASK22_NOMUL, img_22_mask22_nomul_vert_src, img_22_mask22_nomul_frag_src, "img_22_mask22_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMG_12_BGRA_MASK22_NOMUL, img_12_bgra_mask22_nomul_vert_src, img_12_bgra_mask22_nomul_frag_src, "img_12_bgra_mask22_nomul", SHD_IMAGE, SHD_SAM12, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMG_21_BGRA_MASK22_NOMUL, img_21_bgra_mask22_nomul_vert_src, img_21_bgra_mask22_nomul_frag_src, "img_21_bgra_mask22_nomul", SHD_IMAGE, SHD_SAM21, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMG_22_BGRA_MASK22_NOMUL, img_22_bgra_mask22_nomul_vert_src, img_22_bgra_mask22_nomul_frag_src, "img_22_bgra_mask22_nomul", SHD_IMAGE, SHD_SAM22, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMG_AFILL, img_afill_vert_src, img_afill_frag_src, "img_afill", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMG_BGRA_AFILL, img_bgra_afill_vert_src, img_bgra_afill_frag_src, "img_bgra_afill", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMG_NOMUL_AFILL, img_nomul_afill_vert_src, img_nomul_afill_frag_src, "img_nomul_afill", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMG_BGRA_NOMUL_AFILL, img_bgra_nomul_afill_vert_src, img_bgra_nomul_afill_frag_src, "img_bgra_nomul_afill", SHD_IMAGE, SHD_SAM11, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMG_12_AFILL, img_12_afill_vert_src, img_12_afill_frag_src, "img_12_afill", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMG_21_AFILL, img_21_afill_vert_src, img_21_afill_frag_src, "img_21_afill", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMG_22_AFILL, img_22_afill_vert_src, img_22_afill_frag_src, "img_22_afill", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMG_12_BGRA_AFILL, img_12_bgra_afill_vert_src, img_12_bgra_afill_frag_src, "img_12_bgra_afill", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMG_21_BGRA_AFILL, img_21_bgra_afill_vert_src, img_21_bgra_afill_frag_src, "img_21_bgra_afill", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMG_22_BGRA_AFILL, img_22_bgra_afill_vert_src, img_22_bgra_afill_frag_src, "img_22_bgra_afill", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMG_12_NOMUL_AFILL, img_12_nomul_afill_vert_src, img_12_nomul_afill_frag_src, "img_12_nomul_afill", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMG_21_NOMUL_AFILL, img_21_nomul_afill_vert_src, img_21_nomul_afill_frag_src, "img_21_nomul_afill", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMG_22_NOMUL_AFILL, img_22_nomul_afill_vert_src, img_22_nomul_afill_frag_src, "img_22_nomul_afill", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMG_12_BGRA_NOMUL_AFILL, img_12_bgra_nomul_afill_vert_src, img_12_bgra_nomul_afill_frag_src, "img_12_bgra_nomul_afill", SHD_IMAGE, SHD_SAM12, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMG_21_BGRA_NOMUL_AFILL, img_21_bgra_nomul_afill_vert_src, img_21_bgra_nomul_afill_frag_src, "img_21_bgra_nomul_afill", SHD_IMAGE, SHD_SAM21, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMG_22_BGRA_NOMUL_AFILL, img_22_bgra_nomul_afill_vert_src, img_22_bgra_nomul_afill_frag_src, "img_22_bgra_nomul_afill", SHD_IMAGE, SHD_SAM22, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMGNAT, imgnat_vert_src, imgnat_frag_src, "imgnat", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMGNAT_BGRA, imgnat_bgra_vert_src, imgnat_bgra_frag_src, "imgnat_bgra", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMGNAT_12, imgnat_12_vert_src, imgnat_12_frag_src, "imgnat_12", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMGNAT_21, imgnat_21_vert_src, imgnat_21_frag_src, "imgnat_21", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMGNAT_22, imgnat_22_vert_src, imgnat_22_frag_src, "imgnat_22", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_IMGNAT_12_BGRA, imgnat_12_bgra_vert_src, imgnat_12_bgra_frag_src, "imgnat_12_bgra", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMGNAT_21_BGRA, imgnat_21_bgra_vert_src, imgnat_21_bgra_frag_src, "imgnat_21_bgra", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMGNAT_22_BGRA, imgnat_22_bgra_vert_src, imgnat_22_bgra_frag_src, "imgnat_22_bgra", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 0, 0, 0 }, - { SHADER_IMGNAT_MASK, imgnat_mask_vert_src, imgnat_mask_frag_src, "imgnat_mask", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMGNAT_BGRA_MASK, imgnat_bgra_mask_vert_src, imgnat_bgra_mask_frag_src, "imgnat_bgra_mask", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMGNAT_12_MASK, imgnat_12_mask_vert_src, imgnat_12_mask_frag_src, "imgnat_12_mask", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMGNAT_21_MASK, imgnat_21_mask_vert_src, imgnat_21_mask_frag_src, "imgnat_21_mask", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMGNAT_22_MASK, imgnat_22_mask_vert_src, imgnat_22_mask_frag_src, "imgnat_22_mask", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK, imgnat_12_bgra_mask_vert_src, imgnat_12_bgra_mask_frag_src, "imgnat_12_bgra_mask", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK, imgnat_21_bgra_mask_vert_src, imgnat_21_bgra_mask_frag_src, "imgnat_21_bgra_mask", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK, imgnat_22_bgra_mask_vert_src, imgnat_22_bgra_mask_frag_src, "imgnat_22_bgra_mask", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 1, 0, 0 }, - { SHADER_IMGNAT_NOMUL, imgnat_nomul_vert_src, imgnat_nomul_frag_src, "imgnat_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMGNAT_BGRA_NOMUL, imgnat_bgra_nomul_vert_src, imgnat_bgra_nomul_frag_src, "imgnat_bgra_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMGNAT_12_NOMUL, imgnat_12_nomul_vert_src, imgnat_12_nomul_frag_src, "imgnat_12_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMGNAT_21_NOMUL, imgnat_21_nomul_vert_src, imgnat_21_nomul_frag_src, "imgnat_21_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMGNAT_22_NOMUL, imgnat_22_nomul_vert_src, imgnat_22_nomul_frag_src, "imgnat_22_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_NOMUL, imgnat_12_bgra_nomul_vert_src, imgnat_12_bgra_nomul_frag_src, "imgnat_12_bgra_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_NOMUL, imgnat_21_bgra_nomul_vert_src, imgnat_21_bgra_nomul_frag_src, "imgnat_21_bgra_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_NOMUL, imgnat_22_bgra_nomul_vert_src, imgnat_22_bgra_nomul_frag_src, "imgnat_22_bgra_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 0, 1, 0 }, - { SHADER_IMGNAT_MASK_NOMUL, imgnat_mask_nomul_vert_src, imgnat_mask_nomul_frag_src, "imgnat_mask_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMGNAT_BGRA_MASK_NOMUL, imgnat_bgra_mask_nomul_vert_src, imgnat_bgra_mask_nomul_frag_src, "imgnat_bgra_mask_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMGNAT_12_MASK_NOMUL, imgnat_12_mask_nomul_vert_src, imgnat_12_mask_nomul_frag_src, "imgnat_12_mask_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMGNAT_21_MASK_NOMUL, imgnat_21_mask_nomul_vert_src, imgnat_21_mask_nomul_frag_src, "imgnat_21_mask_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMGNAT_22_MASK_NOMUL, imgnat_22_mask_nomul_vert_src, imgnat_22_mask_nomul_frag_src, "imgnat_22_mask_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK_NOMUL, imgnat_12_bgra_mask_nomul_vert_src, imgnat_12_bgra_mask_nomul_frag_src, "imgnat_12_bgra_mask_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK_NOMUL, imgnat_21_bgra_mask_nomul_vert_src, imgnat_21_bgra_mask_nomul_frag_src, "imgnat_21_bgra_mask_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK_NOMUL, imgnat_22_bgra_mask_nomul_vert_src, imgnat_22_bgra_mask_nomul_frag_src, "imgnat_22_bgra_mask_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 1, 1, 0 }, - { SHADER_IMGNAT_MASK12, imgnat_mask12_vert_src, imgnat_mask12_frag_src, "imgnat_mask12", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMGNAT_BGRA_MASK12, imgnat_bgra_mask12_vert_src, imgnat_bgra_mask12_frag_src, "imgnat_bgra_mask12", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMGNAT_12_MASK12, imgnat_12_mask12_vert_src, imgnat_12_mask12_frag_src, "imgnat_12_mask12", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMGNAT_21_MASK12, imgnat_21_mask12_vert_src, imgnat_21_mask12_frag_src, "imgnat_21_mask12", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMGNAT_22_MASK12, imgnat_22_mask12_vert_src, imgnat_22_mask12_frag_src, "imgnat_22_mask12", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM12, 0, 1, 0, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK12, imgnat_12_bgra_mask12_vert_src, imgnat_12_bgra_mask12_frag_src, "imgnat_12_bgra_mask12", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK12, imgnat_21_bgra_mask12_vert_src, imgnat_21_bgra_mask12_frag_src, "imgnat_21_bgra_mask12", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK12, imgnat_22_bgra_mask12_vert_src, imgnat_22_bgra_mask12_frag_src, "imgnat_22_bgra_mask12", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM12, 1, 1, 0, 0 }, - { SHADER_IMGNAT_MASK12_NOMUL, imgnat_mask12_nomul_vert_src, imgnat_mask12_nomul_frag_src, "imgnat_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMGNAT_BGRA_MASK12_NOMUL, imgnat_bgra_mask12_nomul_vert_src, imgnat_bgra_mask12_nomul_frag_src, "imgnat_bgra_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMGNAT_12_MASK12_NOMUL, imgnat_12_mask12_nomul_vert_src, imgnat_12_mask12_nomul_frag_src, "imgnat_12_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMGNAT_21_MASK12_NOMUL, imgnat_21_mask12_nomul_vert_src, imgnat_21_mask12_nomul_frag_src, "imgnat_21_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMGNAT_22_MASK12_NOMUL, imgnat_22_mask12_nomul_vert_src, imgnat_22_mask12_nomul_frag_src, "imgnat_22_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM12, 0, 1, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK12_NOMUL, imgnat_12_bgra_mask12_nomul_vert_src, imgnat_12_bgra_mask12_nomul_frag_src, "imgnat_12_bgra_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK12_NOMUL, imgnat_21_bgra_mask12_nomul_vert_src, imgnat_21_bgra_mask12_nomul_frag_src, "imgnat_21_bgra_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK12_NOMUL, imgnat_22_bgra_mask12_nomul_vert_src, imgnat_22_bgra_mask12_nomul_frag_src, "imgnat_22_bgra_mask12_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM12, 1, 1, 1, 0 }, - { SHADER_IMGNAT_MASK21, imgnat_mask21_vert_src, imgnat_mask21_frag_src, "imgnat_mask21", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMGNAT_BGRA_MASK21, imgnat_bgra_mask21_vert_src, imgnat_bgra_mask21_frag_src, "imgnat_bgra_mask21", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMGNAT_12_MASK21, imgnat_12_mask21_vert_src, imgnat_12_mask21_frag_src, "imgnat_12_mask21", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMGNAT_21_MASK21, imgnat_21_mask21_vert_src, imgnat_21_mask21_frag_src, "imgnat_21_mask21", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMGNAT_22_MASK21, imgnat_22_mask21_vert_src, imgnat_22_mask21_frag_src, "imgnat_22_mask21", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM21, 0, 1, 0, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK21, imgnat_12_bgra_mask21_vert_src, imgnat_12_bgra_mask21_frag_src, "imgnat_12_bgra_mask21", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK21, imgnat_21_bgra_mask21_vert_src, imgnat_21_bgra_mask21_frag_src, "imgnat_21_bgra_mask21", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK21, imgnat_22_bgra_mask21_vert_src, imgnat_22_bgra_mask21_frag_src, "imgnat_22_bgra_mask21", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM21, 1, 1, 0, 0 }, - { SHADER_IMGNAT_MASK21_NOMUL, imgnat_mask21_nomul_vert_src, imgnat_mask21_nomul_frag_src, "imgnat_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMGNAT_BGRA_MASK21_NOMUL, imgnat_bgra_mask21_nomul_vert_src, imgnat_bgra_mask21_nomul_frag_src, "imgnat_bgra_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMGNAT_12_MASK21_NOMUL, imgnat_12_mask21_nomul_vert_src, imgnat_12_mask21_nomul_frag_src, "imgnat_12_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMGNAT_21_MASK21_NOMUL, imgnat_21_mask21_nomul_vert_src, imgnat_21_mask21_nomul_frag_src, "imgnat_21_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMGNAT_22_MASK21_NOMUL, imgnat_22_mask21_nomul_vert_src, imgnat_22_mask21_nomul_frag_src, "imgnat_22_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM21, 0, 1, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK21_NOMUL, imgnat_12_bgra_mask21_nomul_vert_src, imgnat_12_bgra_mask21_nomul_frag_src, "imgnat_12_bgra_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK21_NOMUL, imgnat_21_bgra_mask21_nomul_vert_src, imgnat_21_bgra_mask21_nomul_frag_src, "imgnat_21_bgra_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK21_NOMUL, imgnat_22_bgra_mask21_nomul_vert_src, imgnat_22_bgra_mask21_nomul_frag_src, "imgnat_22_bgra_mask21_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM21, 1, 1, 1, 0 }, - { SHADER_IMGNAT_MASK22, imgnat_mask22_vert_src, imgnat_mask22_frag_src, "imgnat_mask22", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMGNAT_BGRA_MASK22, imgnat_bgra_mask22_vert_src, imgnat_bgra_mask22_frag_src, "imgnat_bgra_mask22", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMGNAT_12_MASK22, imgnat_12_mask22_vert_src, imgnat_12_mask22_frag_src, "imgnat_12_mask22", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMGNAT_21_MASK22, imgnat_21_mask22_vert_src, imgnat_21_mask22_frag_src, "imgnat_21_mask22", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMGNAT_22_MASK22, imgnat_22_mask22_vert_src, imgnat_22_mask22_frag_src, "imgnat_22_mask22", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM22, 0, 1, 0, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK22, imgnat_12_bgra_mask22_vert_src, imgnat_12_bgra_mask22_frag_src, "imgnat_12_bgra_mask22", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK22, imgnat_21_bgra_mask22_vert_src, imgnat_21_bgra_mask22_frag_src, "imgnat_21_bgra_mask22", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK22, imgnat_22_bgra_mask22_vert_src, imgnat_22_bgra_mask22_frag_src, "imgnat_22_bgra_mask22", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM22, 1, 1, 0, 0 }, - { SHADER_IMGNAT_MASK22_NOMUL, imgnat_mask22_nomul_vert_src, imgnat_mask22_nomul_frag_src, "imgnat_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMGNAT_BGRA_MASK22_NOMUL, imgnat_bgra_mask22_nomul_vert_src, imgnat_bgra_mask22_nomul_frag_src, "imgnat_bgra_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMGNAT_12_MASK22_NOMUL, imgnat_12_mask22_nomul_vert_src, imgnat_12_mask22_nomul_frag_src, "imgnat_12_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMGNAT_21_MASK22_NOMUL, imgnat_21_mask22_nomul_vert_src, imgnat_21_mask22_nomul_frag_src, "imgnat_21_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMGNAT_22_MASK22_NOMUL, imgnat_22_mask22_nomul_vert_src, imgnat_22_mask22_nomul_frag_src, "imgnat_22_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM22, 0, 1, 1, 0 }, - { SHADER_IMGNAT_12_BGRA_MASK22_NOMUL, imgnat_12_bgra_mask22_nomul_vert_src, imgnat_12_bgra_mask22_nomul_frag_src, "imgnat_12_bgra_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMGNAT_21_BGRA_MASK22_NOMUL, imgnat_21_bgra_mask22_nomul_vert_src, imgnat_21_bgra_mask22_nomul_frag_src, "imgnat_21_bgra_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMGNAT_22_BGRA_MASK22_NOMUL, imgnat_22_bgra_mask22_nomul_vert_src, imgnat_22_bgra_mask22_nomul_frag_src, "imgnat_22_bgra_mask22_nomul", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM22, 1, 1, 1, 0 }, - { SHADER_IMGNAT_AFILL, imgnat_afill_vert_src, imgnat_afill_frag_src, "imgnat_afill", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMGNAT_BGRA_AFILL, imgnat_bgra_afill_vert_src, imgnat_bgra_afill_frag_src, "imgnat_bgra_afill", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMGNAT_NOMUL_AFILL, imgnat_nomul_afill_vert_src, imgnat_nomul_afill_frag_src, "imgnat_nomul_afill", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMGNAT_BGRA_NOMUL_AFILL, imgnat_bgra_nomul_afill_vert_src, imgnat_bgra_nomul_afill_frag_src, "imgnat_bgra_nomul_afill", SHD_IMAGENATIVE, SHD_SAM11, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMGNAT_12_AFILL, imgnat_12_afill_vert_src, imgnat_12_afill_frag_src, "imgnat_12_afill", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMGNAT_21_AFILL, imgnat_21_afill_vert_src, imgnat_21_afill_frag_src, "imgnat_21_afill", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMGNAT_22_AFILL, imgnat_22_afill_vert_src, imgnat_22_afill_frag_src, "imgnat_22_afill", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_IMGNAT_12_BGRA_AFILL, imgnat_12_bgra_afill_vert_src, imgnat_12_bgra_afill_frag_src, "imgnat_12_bgra_afill", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMGNAT_21_BGRA_AFILL, imgnat_21_bgra_afill_vert_src, imgnat_21_bgra_afill_frag_src, "imgnat_21_bgra_afill", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMGNAT_22_BGRA_AFILL, imgnat_22_bgra_afill_vert_src, imgnat_22_bgra_afill_frag_src, "imgnat_22_bgra_afill", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 0, 0, 1 }, - { SHADER_IMGNAT_12_NOMUL_AFILL, imgnat_12_nomul_afill_vert_src, imgnat_12_nomul_afill_frag_src, "imgnat_12_nomul_afill", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMGNAT_21_NOMUL_AFILL, imgnat_21_nomul_afill_vert_src, imgnat_21_nomul_afill_frag_src, "imgnat_21_nomul_afill", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMGNAT_22_NOMUL_AFILL, imgnat_22_nomul_afill_vert_src, imgnat_22_nomul_afill_frag_src, "imgnat_22_nomul_afill", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_IMGNAT_12_BGRA_NOMUL_AFILL, imgnat_12_bgra_nomul_afill_vert_src, imgnat_12_bgra_nomul_afill_frag_src, "imgnat_12_bgra_nomul_afill", SHD_IMAGENATIVE, SHD_SAM12, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMGNAT_21_BGRA_NOMUL_AFILL, imgnat_21_bgra_nomul_afill_vert_src, imgnat_21_bgra_nomul_afill_frag_src, "imgnat_21_bgra_nomul_afill", SHD_IMAGENATIVE, SHD_SAM21, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_IMGNAT_22_BGRA_NOMUL_AFILL, imgnat_22_bgra_nomul_afill_vert_src, imgnat_22_bgra_nomul_afill_frag_src, "imgnat_22_bgra_nomul_afill", SHD_IMAGENATIVE, SHD_SAM22, SHD_SAM11, 1, 0, 1, 1 }, - { SHADER_RGB_A_PAIR, rgb_a_pair_vert_src, rgb_a_pair_frag_src, "rgb_a_pair", SHD_RGB_A_PAIR, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_RGB_A_PAIR_MASK, rgb_a_pair_mask_vert_src, rgb_a_pair_mask_frag_src, "rgb_a_pair_mask", SHD_RGB_A_PAIR, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_RGB_A_PAIR_NOMUL, rgb_a_pair_nomul_vert_src, rgb_a_pair_nomul_frag_src, "rgb_a_pair_nomul", SHD_RGB_A_PAIR, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_RGB_A_PAIR_MASK_NOMUL, rgb_a_pair_mask_nomul_vert_src, rgb_a_pair_mask_nomul_frag_src, "rgb_a_pair_mask_nomul", SHD_RGB_A_PAIR, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_TEX_EXTERNAL, tex_external_vert_src, tex_external_frag_src, "tex_external", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_TEX_EXTERNAL_AFILL, tex_external_afill_vert_src, tex_external_afill_frag_src, "tex_external_afill", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 0, 0, 1 }, - { SHADER_TEX_EXTERNAL_NOMUL, tex_external_nomul_vert_src, tex_external_nomul_frag_src, "tex_external_nomul", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_TEX_EXTERNAL_NOMUL_AFILL, tex_external_nomul_afill_vert_src, tex_external_nomul_afill_frag_src, "tex_external_nomul_afill", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 0, 1, 1 }, - { SHADER_TEX_EXTERNAL_MASK, tex_external_mask_vert_src, tex_external_mask_frag_src, "tex_external_mask", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_TEX_EXTERNAL_MASK_NOMUL, tex_external_mask_nomul_vert_src, tex_external_mask_nomul_frag_src, "tex_external_mask_nomul", SHD_TEX_EXTERNAL, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_YUV, yuv_vert_src, yuv_frag_src, "yuv", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_YUV_NOMUL, yuv_nomul_vert_src, yuv_nomul_frag_src, "yuv_nomul", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_YUV_MASK, yuv_mask_vert_src, yuv_mask_frag_src, "yuv_mask", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_YUV_MASK_NOMUL, yuv_mask_nomul_vert_src, yuv_mask_nomul_frag_src, "yuv_mask_nomul", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_YUY2, yuy2_vert_src, yuy2_frag_src, "yuy2", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_YUY2_NOMUL, yuy2_nomul_vert_src, yuy2_nomul_frag_src, "yuy2_nomul", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_YUY2_MASK, yuy2_mask_vert_src, yuy2_mask_frag_src, "yuy2_mask", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_YUY2_MASK_NOMUL, yuy2_mask_nomul_vert_src, yuy2_mask_nomul_frag_src, "yuy2_mask_nomul", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_NV12, nv12_vert_src, nv12_frag_src, "nv12", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_NV12_NOMUL, nv12_nomul_vert_src, nv12_nomul_frag_src, "nv12_nomul", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_NV12_MASK, nv12_mask_vert_src, nv12_mask_frag_src, "nv12_mask", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_NV12_MASK_NOMUL, nv12_mask_nomul_vert_src, nv12_mask_nomul_frag_src, "nv12_mask_nomul", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_YUV_709, yuv_709_vert_src, yuv_709_frag_src, "yuv_709", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_YUV_709_NOMUL, yuv_709_nomul_vert_src, yuv_709_nomul_frag_src, "yuv_709_nomul", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_YUV_709_MASK, yuv_709_mask_vert_src, yuv_709_mask_frag_src, "yuv_709_mask", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_YUV_709_MASK_NOMUL, yuv_709_mask_nomul_vert_src, yuv_709_mask_nomul_frag_src, "yuv_709_mask_nomul", SHD_YUV, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_YUY2_709, yuy2_709_vert_src, yuy2_709_frag_src, "yuy2_709", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_YUY2_709_NOMUL, yuy2_709_nomul_vert_src, yuy2_709_nomul_frag_src, "yuy2_709_nomul", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_YUY2_709_MASK, yuy2_709_mask_vert_src, yuy2_709_mask_frag_src, "yuy2_709_mask", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_YUY2_709_MASK_NOMUL, yuy2_709_mask_nomul_vert_src, yuy2_709_mask_nomul_frag_src, "yuy2_709_mask_nomul", SHD_YUY2, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, - { SHADER_NV12_709, nv12_709_vert_src, nv12_709_frag_src, "nv12_709", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 0, 0, 0 }, - { SHADER_NV12_709_NOMUL, nv12_709_nomul_vert_src, nv12_709_nomul_frag_src, "nv12_709_nomul", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 0, 1, 0 }, - { SHADER_NV12_709_MASK, nv12_709_mask_vert_src, nv12_709_mask_frag_src, "nv12_709_mask", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 1, 0, 0 }, - { SHADER_NV12_709_MASK_NOMUL, nv12_709_mask_nomul_vert_src, nv12_709_mask_nomul_frag_src, "nv12_709_mask_nomul", SHD_NV12, SHD_SAM11, SHD_SAM11, 0, 1, 1, 0 }, -}; - diff --git a/src/modules/evas/engines/gl_common/shader/fragment.glsl b/src/modules/evas/engines/gl_common/shader/fragment.glsl index 6d524bdf44..3dce873f40 100644 --- a/src/modules/evas/engines/gl_common/shader/fragment.glsl +++ b/src/modules/evas/engines/gl_common/shader/fragment.glsl @@ -4,13 +4,7 @@ * through cpp first (in which case the precision must be manually added). */ -#ifdef GL_ES -#ifdef GL_FRAGMENT_PRECISION_HIGH -precision highp float; -#else -precision mediump float; -#endif -#endif +FRAGMENT_SHADER #ifndef SHD_NOMUL varying vec4 col; diff --git a/src/modules/evas/engines/gl_common/shader/gen_shaders.sh b/src/modules/evas/engines/gl_common/shader/gen_shaders.sh index 24212c5694..60bb25a2bf 100755 --- a/src/modules/evas/engines/gl_common/shader/gen_shaders.sh +++ b/src/modules/evas/engines/gl_common/shader/gen_shaders.sh @@ -1,203 +1,38 @@ #!/bin/bash -set -e +# This script will generate a C file containing all the shaders used by Evas -ENDIAN="$1" DIR=`dirname $0` -OUTPUT=${DIR}/evas_gl_shaders"$1".x -OUTPUT_ENUM=${DIR}/evas_gl_enum.x -CPP="cpp -P" -VTX_HEADER="#ifdef GL_ES -precision highp float; -#endif -" - -FGM_HEADER="#ifdef GL_ES -#ifdef GL_FRAGMENT_PRECISION_HIGH -precision highp float; -#else -precision mediump float; -#endif -#endif -" - -# Hack -FGM_HEADER_OES="#ifdef GL_ES -# extension GL_OES_EGL_image_external : require -# ifdef GL_FRAGMENT_PRECISION_HIGH -precision highp float; -# else -precision mediump float; -# endif -# define SAMPLER_EXTERNAL_OES samplerExternalOES -#else -# define SAMPLER_EXTERNAL_OES sampler2D -#endif -" +OUTPUT=${DIR}/evas_gl_shaders.x # Skip generation if there is no diff (or no git) if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi if git diff --quiet --exit-code -- "$DIR" then - touch "${OUTPUT}" "${OUTPUT_ENUM}" + touch "${OUTPUT}" exit 0 fi -function upper() { - echo $@ |tr '[:lower:]' '[:upper:]' -} - -function run() { - [ "$V" = "1" ] && echo "$@" - "$@" -} - -# Urgh -OIFS=$IFS -IFS=$'\n' SHADERS=(`cat ${DIR}/shaders.txt`) -IFS=$OIFS +exec 1<&- +exec 1>${OUTPUT} # Write header -printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */\n" > ${OUTPUT} -printf "/* IF IT IS CHANGED PLEASE COMMIT THE CHANGES */\n\n" >> ${OUTPUT} +printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */\n" +printf "/* IF IT IS CHANGED PLEASE COMMIT THE CHANGES */\n\n" -# Including private for hilights and stuff :) -printf "#include \"../evas_gl_private.h\"\n\n" >> ${OUTPUT} +for shd in fragment vertex ; do + m4 ${DIR}/include.glsl ${DIR}/${shd}.glsl > ${shd}.tmp -# Prepare list of shaders: -shaders_source="" -shaders_enum="" -shaders_type=(frag vert) -shaders_textures="" - -# Generate SHD files -LIST="" -for (( i = 0; i < ${#SHADERS[@]} ; i++ )) ; do - s=${SHADERS[$i]} - if [[ $s == \#* ]] ; then continue ; fi - - name=`echo $s |cut -d ':' -f 1` - opts=`echo $s |cut -d ':' -f 2 |tr ',' '\n'` - - echo " SHADER $name" - UNAME=`echo ${name} |tr "[:lower:]" "[:upper:]"` - OPTS="" - if [[ "$1" == "_bigendian" ]] ; then OPTS="-DBIGENDIAN"; fi - FGM=${FGM_HEADER} - TYPE=`echo ${name} |cut -d '_' -f 1 |tr '[:lower:]' '[:upper:]'` - bgra=0 - mask=0 - nomul=0 - afill=0 - sam="SAM11" - masksam="SAM11" - tex="" - - # Urgh. Some fixups - case $TYPE in - IMG) TYPE="IMAGE";; - IMGNAT) TYPE="IMAGENATIVE";; - RGB) TYPE="RGB_A_PAIR";; - TEX) TYPE="TEX_EXTERNAL";; - esac - - for opt in $opts ; do - UP=`upper $opt` - OPTS="$OPTS -DSHD_${UP}" - case $opt in - tex) tex="${tex}tex ";; - mask) tex="${tex}texm " ; mask=1;; - texa) tex="${tex}texa ";; - yuv) tex="${tex}texu texv ";; - nv12) tex="${tex}texuv ";; - yuy2) tex="${tex}texuv ";; - bgra) bgra=1;; - nomul) nomul=1;; - afill) afill=1;; - external) FGM=${FGM_HEADER_OES};; - sam12) sam="SAM12";; - sam21) sam="SAM21";; - sam22) sam="SAM22";; - masksam12) masksam="SAM12";; - masksam21) masksam="SAM21";; - masksam22) masksam="SAM22";; - esac + OIFS=$IFS + IFS=$'\n' + printf "static const char ${shd}_glsl[] =" + for line in `cat ${shd}.tmp` ; do + printf "\n \"${line}\\\n\"" done + printf ";\n\n" + IFS=${OIFS} - # vertex shader - filev=${DIR}/${name}_vert.shd - printf "${VTX_HEADER}" >| ${filev} - run $CPP $OPTS ${DIR}/vertex.glsl >> ${filev} - - # fragment shader - filef=${DIR}/${name}_frag.shd - printf "${FGM}" >| ${filef} - run $CPP $OPTS ${DIR}/fragment.glsl >> ${filef} - - k=0 - for shd in ${filef} ${filev} ; do - shdname=${name}_${shaders_type[$k]} - k=$(($k + 1)) - - OIFS=$IFS - IFS=$'\n' - printf "static const char ${shdname}_src[] =" >> ${OUTPUT} - for line in `cat ${shd}` ; do - printf "\n \"${line}\\\n\"" >> ${OUTPUT} - done - printf ";\n\n" >> ${OUTPUT} - IFS=${OIFS} - done - - shaders_source="${shaders_source} { SHADER_${UNAME}, ${name}_vert_src, ${name}_frag_src, \"${name}\", SHD_${TYPE}, SHD_${sam}, SHD_${masksam}, ${bgra}, ${mask}, ${nomul}, ${afill} },\n" - shaders_enum="${shaders_enum} SHADER_${UNAME},\n" - - # Bind textures to the programs. Only if there is more than 1 texture. - textures=(${tex}) - if [ ${#textures[@]} -ge 2 ] ; then - for tname in ${tex} ; do - shaders_textures="${shaders_textures} { SHADER_${UNAME}, \"${tname}\" },\n" - done - fi + rm ${shd}.tmp done -printf " -static const struct { - Evas_GL_Shader id; - const char *vert; - const char *frag; - const char *name; - Shader_Type type; - Shader_Sampling sam; - Shader_Sampling masksam; - Eina_Bool bgra : 1; - Eina_Bool mask : 1; - Eina_Bool nomul : 1; - Eina_Bool afill : 1; -} _shaders_source[] = {\n" >> ${OUTPUT} - -printf "${shaders_source}};\n\n" >> ${OUTPUT} - -printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */ -/* IF IT IS CHANGED PLEASE COMMIT THE CHANGES */ - -typedef enum { -${shaders_enum} SHADER_LAST -} Evas_GL_Shader; - -#ifdef _EVAS_GL_CONTEXT_C - -static struct { - Evas_GL_Shader id; - const char *tname; -} _shaders_textures[] = { -${shaders_textures} { SHADER_LAST, NULL } -}; - -#endif // _EVAS_GL_CONTEXT_C -" >| ${OUTPUT_ENUM} - -# You can remove the files now -#rm -f ${LIST} - diff --git a/src/modules/evas/engines/gl_common/shader/include.glsl b/src/modules/evas/engines/gl_common/shader/include.glsl new file mode 100644 index 0000000000..b8f8ac115e --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/include.glsl @@ -0,0 +1,22 @@ +define(`FRAGMENT_SHADER',` +#ifdef GL_ES +# ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +# else +precision mediump float; +# endif +# ifdef SHD_EXTERNAL +extension GL_OES_EGL_image_external : require +# define SAMPLER_EXTERNAL_OES samplerExternalOES +# endif +#else +# define SAMPLER_EXTERNAL_OES sampler2D +#endif +') + +define(`VERTEX_SHADER',` +#ifdef GL_ES +precision highp float; +#endif +') + diff --git a/src/modules/evas/engines/gl_common/shader/shaders.txt b/src/modules/evas/engines/gl_common/shader/shaders.txt deleted file mode 100644 index 2340489aa9..0000000000 --- a/src/modules/evas/engines/gl_common/shader/shaders.txt +++ /dev/null @@ -1,302 +0,0 @@ -# All supported shaders, format is (no spaces allowed): -# name:opt1,opt2,opt3 - -# Convention for names: -# type[_SAM[_bgra[_mask[_nomul[_afill]]]]] - - -# Rectangles, lines & polygons -rect: -rect_mask:mask -rect_mask12:mask,masksam12 -rect_mask21:mask,masksam21 -rect_mask22:mask,masksam22 - - -# Fonts (alpha only) -font:tex,alpha -font_mask:tex,mask,alpha -font_mask12:tex,mask,masksam12,alpha -font_mask21:tex,mask,masksam21,alpha -font_mask22:tex,mask,masksam22,alpha - - -# Images: color version -img:tex,img -img_bgra:tex,img,bgra -img_12:tex,img,sam12 -img_21:tex,img,sam21 -img_22:tex,img,sam22 -img_12_bgra:tex,img,sam12,bgra -img_21_bgra:tex,img,sam21,bgra -img_22_bgra:tex,img,sam22,bgra - -img_mask:tex,img,mask -img_bgra_mask:tex,img,mask,bgra -img_12_mask:tex,img,mask,sam12 -img_21_mask:tex,img,mask,sam21 -img_22_mask:tex,img,mask,sam22 -img_12_bgra_mask:tex,img,mask,sam12,bgra -img_21_bgra_mask:tex,img,mask,sam21,bgra -img_22_bgra_mask:tex,img,mask,sam22,bgra - - -# Images: nomul version (copy above with extra nomul flag) -img_nomul:tex,img,nomul -img_bgra_nomul:tex,img,nomul,bgra -img_12_nomul:tex,img,sam12,nomul -img_21_nomul:tex,img,sam21,nomul -img_22_nomul:tex,img,sam22,nomul -img_12_bgra_nomul:tex,img,sam12,bgra,nomul -img_21_bgra_nomul:tex,img,sam21,bgra,nomul -img_22_bgra_nomul:tex,img,sam22,bgra,nomul - -img_mask_nomul:tex,img,mask,nomul -img_bgra_mask_nomul:tex,img,mask,nomul,bgra -img_12_mask_nomul:tex,img,mask,sam12,nomul -img_21_mask_nomul:tex,img,mask,sam21,nomul -img_22_mask_nomul:tex,img,mask,sam22,nomul -img_12_bgra_mask_nomul:tex,img,mask,sam12,bgra,nomul -img_21_bgra_mask_nomul:tex,img,mask,sam21,bgra,nomul -img_22_bgra_mask_nomul:tex,img,mask,sam22,bgra,nomul - - -# Now the same as above but with MASKSAM -img_mask12:tex,img,mask,masksam12 -img_bgra_mask12:tex,img,mask,masksam12,bgra -img_12_mask12:tex,img,mask,masksam12,sam12 -img_21_mask12:tex,img,mask,masksam12,sam21 -img_22_mask12:tex,img,mask,masksam12,sam22 -img_12_bgra_mask12:tex,img,mask,masksam12,sam12,bgra -img_21_bgra_mask12:tex,img,mask,masksam12,sam21,bgra -img_22_bgra_mask12:tex,img,mask,masksam12,sam22,bgra -img_mask12_nomul:tex,img,mask,masksam12,nomul -img_bgra_mask12_nomul:tex,img,mask,masksam12,nomul,bgra -img_12_mask12_nomul:tex,img,mask,masksam12,sam12,nomul -img_21_mask12_nomul:tex,img,mask,masksam12,sam21,nomul -img_22_mask12_nomul:tex,img,mask,masksam12,sam22,nomul -img_12_bgra_mask12_nomul:tex,img,mask,masksam12,sam12,bgra,nomul -img_21_bgra_mask12_nomul:tex,img,mask,masksam12,sam21,bgra,nomul -img_22_bgra_mask12_nomul:tex,img,mask,masksam12,sam22,bgra,nomul - -img_mask21:tex,img,mask,masksam21 -img_bgra_mask21:tex,img,mask,masksam21,bgra -img_12_mask21:tex,img,mask,masksam21,sam12 -img_21_mask21:tex,img,mask,masksam21,sam21 -img_22_mask21:tex,img,mask,masksam21,sam22 -img_12_bgra_mask21:tex,img,mask,masksam21,sam12,bgra -img_21_bgra_mask21:tex,img,mask,masksam21,sam21,bgra -img_22_bgra_mask21:tex,img,mask,masksam21,sam22,bgra -img_mask21_nomul:tex,img,mask,masksam21,nomul -img_bgra_mask21_nomul:tex,img,mask,masksam21,nomul,bgra -img_12_mask21_nomul:tex,img,mask,masksam21,sam12,nomul -img_21_mask21_nomul:tex,img,mask,masksam21,sam21,nomul -img_22_mask21_nomul:tex,img,mask,masksam21,sam22,nomul -img_12_bgra_mask21_nomul:tex,img,mask,masksam21,sam12,bgra,nomul -img_21_bgra_mask21_nomul:tex,img,mask,masksam21,sam21,bgra,nomul -img_22_bgra_mask21_nomul:tex,img,mask,masksam21,sam22,bgra,nomul - -img_mask22:tex,img,mask,masksam22 -img_bgra_mask22:tex,img,mask,masksam22,bgra -img_12_mask22:tex,img,mask,masksam22,sam12 -img_21_mask22:tex,img,mask,masksam22,sam21 -img_22_mask22:tex,img,mask,masksam22,sam22 -img_12_bgra_mask22:tex,img,mask,masksam22,sam12,bgra -img_21_bgra_mask22:tex,img,mask,masksam22,sam21,bgra -img_22_bgra_mask22:tex,img,mask,masksam22,sam22,bgra -img_mask22_nomul:tex,img,mask,masksam22,nomul -img_bgra_mask22_nomul:tex,img,mask,masksam22,nomul,bgra -img_12_mask22_nomul:tex,img,mask,masksam22,sam12,nomul -img_21_mask22_nomul:tex,img,mask,masksam22,sam21,nomul -img_22_mask22_nomul:tex,img,mask,masksam22,sam22,nomul -img_12_bgra_mask22_nomul:tex,img,mask,masksam22,sam12,bgra,nomul -img_21_bgra_mask22_nomul:tex,img,mask,masksam22,sam21,bgra,nomul -img_22_bgra_mask22_nomul:tex,img,mask,masksam22,sam22,bgra,nomul - - -# Some AFILL versions -img_afill:tex,img,afill -img_bgra_afill:tex,img,afill,bgra -img_nomul_afill:tex,img,nomul,afill -img_bgra_nomul_afill:tex,img,nomul,afill,bgra -img_12_afill:tex,img,sam12,afill -img_21_afill:tex,img,sam21,afill -img_22_afill:tex,img,sam22,afill -img_12_bgra_afill:tex,img,sam12,bgra,afill -img_21_bgra_afill:tex,img,sam21,bgra,afill -img_22_bgra_afill:tex,img,sam22,bgra,afill -img_12_nomul_afill:tex,img,sam12,nomul,afill -img_21_nomul_afill:tex,img,sam21,nomul,afill -img_22_nomul_afill:tex,img,sam22,nomul,afill -img_12_bgra_nomul_afill:tex,img,sam12,bgra,nomul,afill -img_21_bgra_nomul_afill:tex,img,sam21,bgra,nomul,afill -img_22_bgra_nomul_afill:tex,img,sam22,bgra,nomul,afill - - - - - - -# Images: color version -imgnat:tex -imgnat_bgra:tex,bgra -imgnat_12:tex,sam12 -imgnat_21:tex,sam21 -imgnat_22:tex,sam22 -imgnat_12_bgra:tex,sam12,bgra -imgnat_21_bgra:tex,sam21,bgra -imgnat_22_bgra:tex,sam22,bgra - -imgnat_mask:tex,mask -imgnat_bgra_mask:tex,mask,bgra -imgnat_12_mask:tex,mask,sam12 -imgnat_21_mask:tex,mask,sam21 -imgnat_22_mask:tex,mask,sam22 -imgnat_12_bgra_mask:tex,mask,sam12,bgra -imgnat_21_bgra_mask:tex,mask,sam21,bgra -imgnat_22_bgra_mask:tex,mask,sam22,bgra - - -# Images: nomul version (copy above with extra nomul flag) -imgnat_nomul:tex,nomul -imgnat_bgra_nomul:tex,nomul,bgra -imgnat_12_nomul:tex,sam12,nomul -imgnat_21_nomul:tex,sam21,nomul -imgnat_22_nomul:tex,sam22,nomul -imgnat_12_bgra_nomul:tex,sam12,bgra,nomul -imgnat_21_bgra_nomul:tex,sam21,bgra,nomul -imgnat_22_bgra_nomul:tex,sam22,bgra,nomul - -imgnat_mask_nomul:tex,mask,nomul -imgnat_bgra_mask_nomul:tex,mask,nomul,bgra -imgnat_12_mask_nomul:tex,mask,sam12,nomul -imgnat_21_mask_nomul:tex,mask,sam21,nomul -imgnat_22_mask_nomul:tex,mask,sam22,nomul -imgnat_12_bgra_mask_nomul:tex,mask,sam12,bgra,nomul -imgnat_21_bgra_mask_nomul:tex,mask,sam21,bgra,nomul -imgnat_22_bgra_mask_nomul:tex,mask,sam22,bgra,nomul - - -# Now the same as above but with MASKSAM -imgnat_mask12:tex,mask,masksam12 -imgnat_bgra_mask12:tex,mask,masksam12,bgra -imgnat_12_mask12:tex,mask,masksam12,sam12 -imgnat_21_mask12:tex,mask,masksam12,sam21 -imgnat_22_mask12:tex,mask,masksam12,sam22 -imgnat_12_bgra_mask12:tex,mask,masksam12,sam12,bgra -imgnat_21_bgra_mask12:tex,mask,masksam12,sam21,bgra -imgnat_22_bgra_mask12:tex,mask,masksam12,sam22,bgra -imgnat_mask12_nomul:tex,mask,masksam12,nomul -imgnat_bgra_mask12_nomul:tex,mask,masksam12,nomul,bgra -imgnat_12_mask12_nomul:tex,mask,masksam12,sam12,nomul -imgnat_21_mask12_nomul:tex,mask,masksam12,sam21,nomul -imgnat_22_mask12_nomul:tex,mask,masksam12,sam22,nomul -imgnat_12_bgra_mask12_nomul:tex,mask,masksam12,sam12,bgra,nomul -imgnat_21_bgra_mask12_nomul:tex,mask,masksam12,sam21,bgra,nomul -imgnat_22_bgra_mask12_nomul:tex,mask,masksam12,sam22,bgra,nomul - -imgnat_mask21:tex,mask,masksam21 -imgnat_bgra_mask21:tex,mask,masksam21,bgra -imgnat_12_mask21:tex,mask,masksam21,sam12 -imgnat_21_mask21:tex,mask,masksam21,sam21 -imgnat_22_mask21:tex,mask,masksam21,sam22 -imgnat_12_bgra_mask21:tex,mask,masksam21,sam12,bgra -imgnat_21_bgra_mask21:tex,mask,masksam21,sam21,bgra -imgnat_22_bgra_mask21:tex,mask,masksam21,sam22,bgra -imgnat_mask21_nomul:tex,mask,masksam21,nomul -imgnat_bgra_mask21_nomul:tex,mask,masksam21,nomul,bgra -imgnat_12_mask21_nomul:tex,mask,masksam21,sam12,nomul -imgnat_21_mask21_nomul:tex,mask,masksam21,sam21,nomul -imgnat_22_mask21_nomul:tex,mask,masksam21,sam22,nomul -imgnat_12_bgra_mask21_nomul:tex,mask,masksam21,sam12,bgra,nomul -imgnat_21_bgra_mask21_nomul:tex,mask,masksam21,sam21,bgra,nomul -imgnat_22_bgra_mask21_nomul:tex,mask,masksam21,sam22,bgra,nomul - -imgnat_mask22:tex,mask,masksam22 -imgnat_bgra_mask22:tex,mask,masksam22,bgra -imgnat_12_mask22:tex,mask,masksam22,sam12 -imgnat_21_mask22:tex,mask,masksam22,sam21 -imgnat_22_mask22:tex,mask,masksam22,sam22 -imgnat_12_bgra_mask22:tex,mask,masksam22,sam12,bgra -imgnat_21_bgra_mask22:tex,mask,masksam22,sam21,bgra -imgnat_22_bgra_mask22:tex,mask,masksam22,sam22,bgra -imgnat_mask22_nomul:tex,mask,masksam22,nomul -imgnat_bgra_mask22_nomul:tex,mask,masksam22,nomul,bgra -imgnat_12_mask22_nomul:tex,mask,masksam22,sam12,nomul -imgnat_21_mask22_nomul:tex,mask,masksam22,sam21,nomul -imgnat_22_mask22_nomul:tex,mask,masksam22,sam22,nomul -imgnat_12_bgra_mask22_nomul:tex,mask,masksam22,sam12,bgra,nomul -imgnat_21_bgra_mask22_nomul:tex,mask,masksam22,sam21,bgra,nomul -imgnat_22_bgra_mask22_nomul:tex,mask,masksam22,sam22,bgra,nomul - - -# Some AFILL versions -imgnat_afill:tex,afill -imgnat_bgra_afill:tex,afill,bgra -imgnat_nomul_afill:tex,nomul,afill -imgnat_bgra_nomul_afill:tex,nomul,afill,bgra -imgnat_12_afill:tex,sam12,afill -imgnat_21_afill:tex,sam21,afill -imgnat_22_afill:tex,sam22,afill -imgnat_12_bgra_afill:tex,sam12,bgra,afill -imgnat_21_bgra_afill:tex,sam21,bgra,afill -imgnat_22_bgra_afill:tex,sam22,bgra,afill -imgnat_12_nomul_afill:tex,sam12,nomul,afill -imgnat_21_nomul_afill:tex,sam21,nomul,afill -imgnat_22_nomul_afill:tex,sam22,nomul,afill -imgnat_12_bgra_nomul_afill:tex,sam12,bgra,nomul,afill -imgnat_21_bgra_nomul_afill:tex,sam21,bgra,nomul,afill -imgnat_22_bgra_nomul_afill:tex,sam22,bgra,nomul,afill - - - -# RGB+A. We can add more! -rgb_a_pair:tex,texa -rgb_a_pair_mask:tex,texa,mask -rgb_a_pair_nomul:tex,texa,nomul -rgb_a_pair_mask_nomul:tex,texa,mask,nomul -#rgb_a_pair_afill:tex,texa,afill -#rgb_a_pair_nomul_afill:tex,texa,nomul,afill - - - -# External texture (GLES, OES) -tex_external:external -tex_external_afill:external,afill -tex_external_nomul:external,nomul -tex_external_nomul_afill:external,nomul,afill -tex_external_mask:external,mask -tex_external_mask_nomul:external,mask,nomul - - -# YUV stuff (no need for AFILL) -yuv:tex,yuv -yuv_nomul:tex,yuv,nomul -yuv_mask:tex,yuv,mask -yuv_mask_nomul:tex,yuv,mask,nomul - -yuy2:tex,yuy2 -yuy2_nomul:tex,yuy2,nomul -yuy2_mask:tex,yuy2,mask -yuy2_mask_nomul:tex,yuy2,mask,nomul - -nv12:tex,nv12 -nv12_nomul:tex,nv12,nomul -nv12_mask:tex,nv12,mask -nv12_mask_nomul:tex,nv12,mask,nomul - -yuv_709:tex,yuv,yuv_709 -yuv_709_nomul:tex,yuv,yuv_709,nomul -yuv_709_mask:tex,yuv,yuv_709,mask -yuv_709_mask_nomul:tex,yuv,yuv_709,mask,nomul - -yuy2_709:tex,yuy2,yuv_709 -yuy2_709_nomul:tex,yuy2,yuv_709,nomul -yuy2_709_mask:tex,yuy2,yuv_709,mask -yuy2_709_mask_nomul:tex,yuy2,yuv_709,mask,nomul - -nv12_709:tex,nv12,yuv_709 -nv12_709_nomul:tex,nv12,yuv_709,nomul -nv12_709_mask:tex,nv12,yuv_709,mask -nv12_709_mask_nomul:tex,nv12,yuv_709,mask,nomul - diff --git a/src/modules/evas/engines/gl_common/shader/vertex.glsl b/src/modules/evas/engines/gl_common/shader/vertex.glsl index 8056188dce..d67eb0684e 100644 --- a/src/modules/evas/engines/gl_common/shader/vertex.glsl +++ b/src/modules/evas/engines/gl_common/shader/vertex.glsl @@ -4,14 +4,11 @@ * through cpp first (in which case the precision must be manually added). */ -#ifdef GL_ES -precision highp float; -#endif +VERTEX_SHADER attribute vec4 vertex; uniform mat4 mvp; - /* All except nomul */ #ifndef SHD_NOMUL attribute vec4 color;