forked from enlightenment/efl
Evas GL common: Factorize shader generation code
Remove all individual shaders, factorize everything into one vertex and one fragment shader. All previous functionality has been kept as is[*]. Some new features have been added (new shader types). This is a first step in simplifying and improving the shaders system. Next: simplify shader selection [*] Yeah, that's quite a bold statement here. Maybe I broke everything.
This commit is contained in:
parent
8586b75a2a
commit
a3de2ee3fd
|
@ -618,135 +618,18 @@ modules/evas/engines/gl_common/evas_gl_3d_renderer.c \
|
|||
modules/evas/engines/gl_common/evas_gl_3d_shader.c
|
||||
|
||||
GL_SHADERS_GEN = \
|
||||
modules/evas/engines/gl_common/shader/font_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/font_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/font_mask_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/font_mask_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_12_bgra_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_12_bgra_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_12_bgra_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_12_bgra_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_12_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_12_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_12_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_12_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_21_bgra_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_21_bgra_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_21_bgra_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_21_bgra_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_21_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_21_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_21_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_21_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_22_bgra_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_22_bgra_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_22_bgra_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_22_bgra_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_22_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_22_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_22_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_22_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_bgra_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_bgra_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_bgra_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_bgra_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/nv12_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/nv12_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/nv12_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/nv12_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/rect_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/rect_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/rgb_a_pair_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/rgb_a_pair_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/rgb_a_pair_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/rgb_a_pair_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_12_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_12_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_12_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_12_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_21_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_21_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_21_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_21_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_22_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_22_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_22_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_22_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_22_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_22_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_21_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_21_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_12_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_12_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/yuv_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/yuv_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/yuv_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/yuv_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/yuy2_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/yuy2_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/yuy2_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/yuy2_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_mask_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_mask_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_mask_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_mask_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_mask_bgra_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_mask_bgra_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/img_mask_bgra_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/img_mask_bgra_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/yuv_mask_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/yuv_mask_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/nv12_mask_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/nv12_mask_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/yuy2_mask_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/yuy2_mask_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/rgb_a_pair_mask_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/rgb_a_pair_mask_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/rect_mask_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/rect_mask_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/map_mask_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/map_mask_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/map_mask_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/map_mask_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/map_mask_bgra_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/map_mask_bgra_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/map_mask_bgra_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/map_mask_bgra_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_external_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_external_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_external_nomul_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_external_nomul_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_external_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_external_afill_vert.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_external_nomul_afill_frag.shd \
|
||||
modules/evas/engines/gl_common/shader/tex_external_nomul_afill_vert.shd \
|
||||
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 \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST += \
|
||||
modules/evas/engines/gl_common/shader/gen_shaders.sh \
|
||||
$(GL_SHADERS_GEN)
|
||||
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: modules/evas/engines/gl_common/shader/gen_shaders.sh $(GL_SHADERS_GEN)
|
||||
modules/evas/engines/gl_common/shader/evas_gl_shaders.x: $(GL_SHADERS_GEN)
|
||||
@echo " SHADERS $@"
|
||||
@$^
|
||||
@$(builddir)/modules/evas/engines/gl_common/shader/gen_shaders.sh
|
||||
|
||||
modules/evas/engines/gl_common/shader/evas_gl_enum.x: modules/evas/engines/gl_common/shader/evas_gl_shaders.x
|
||||
|
||||
|
|
|
@ -425,6 +425,8 @@ struct _Evas_GL_Shared
|
|||
#define RTYPE_YUY2 6
|
||||
#define RTYPE_NV12 7
|
||||
#define RTYPE_LINE 8
|
||||
#define RTYPE_RGB_A_PAIR 9
|
||||
#define RTYPE_TEX_EXTERNAL 10
|
||||
#define ARRAY_BUFFER_USE 500
|
||||
#define ARRAY_BUFFER_USE_SHIFT 100
|
||||
|
||||
|
|
|
@ -933,10 +933,10 @@ evas_gl_common_context_new(void)
|
|||
SHADER_TEXTURE_ADD(shared, IMG_MASK_NOMUL, tex);
|
||||
SHADER_TEXTURE_ADD(shared, IMG_MASK_NOMUL, texm);
|
||||
|
||||
SHADER_TEXTURE_ADD(shared, IMG_MASK_BGRA, tex);
|
||||
SHADER_TEXTURE_ADD(shared, IMG_MASK_BGRA, texm);
|
||||
SHADER_TEXTURE_ADD(shared, IMG_MASK_BGRA_NOMUL, tex);
|
||||
SHADER_TEXTURE_ADD(shared, IMG_MASK_BGRA_NOMUL, texm);
|
||||
SHADER_TEXTURE_ADD(shared, IMG_BGRA_MASK, tex);
|
||||
SHADER_TEXTURE_ADD(shared, IMG_BGRA_MASK, texm);
|
||||
SHADER_TEXTURE_ADD(shared, IMG_BGRA_MASK_NOMUL, tex);
|
||||
SHADER_TEXTURE_ADD(shared, IMG_BGRA_MASK_NOMUL, texm);
|
||||
|
||||
SHADER_TEXTURE_ADD(shared, FONT_MASK, tex);
|
||||
SHADER_TEXTURE_ADD(shared, FONT_MASK, texm);
|
||||
|
@ -1896,28 +1896,28 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
|
|||
{
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_22_BGRA_NOMUL, SHADER_IMG_22_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_22_BGRA_MASK_NOMUL, SHADER_IMG_22_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else if ((smooth) && (sw >= (w * 2)))
|
||||
{
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_21_BGRA_NOMUL, SHADER_IMG_21_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else if ((smooth) && (sh >= (h * 2)))
|
||||
{
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_12_BGRA_NOMUL, SHADER_IMG_12_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
}
|
||||
}
|
||||
#ifdef GL_GLES
|
||||
|
@ -1926,11 +1926,11 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
|
|||
if ((!tex->alpha) && (tex->pt->native))
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_EXTERNAL_NOMUL_AFILL, SHADER_TEX_EXTERNAL_AFILL,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_TEX_EXTERNAL_MASK_NOMUL, SHADER_TEX_EXTERNAL_MASK);
|
||||
else
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_EXTERNAL_NOMUL, SHADER_TEX_EXTERNAL,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_TEX_EXTERNAL_MASK_NOMUL, SHADER_TEX_EXTERNAL_MASK);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
|
@ -1939,48 +1939,48 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
|
|||
{
|
||||
if ((!tex->alpha) && (tex->pt->native))
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_22_NOMUL_AFILL, SHADER_TEX_22_AFILL,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_IMG_22_BGRA_NOMUL_AFILL, SHADER_IMG_22_BGRA_AFILL,
|
||||
SHADER_IMG_22_BGRA_MASK_NOMUL, SHADER_IMG_22_BGRA_MASK);
|
||||
else
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_22_NOMUL, SHADER_TEX_22,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_IMG_22_BGRA_NOMUL, SHADER_IMG_22_BGRA,
|
||||
SHADER_IMG_22_BGRA_MASK_NOMUL, SHADER_IMG_22_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else if ((smooth) && (sw >= (w * 2)))
|
||||
{
|
||||
if ((!tex->alpha) && (tex->pt->native))
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_21_NOMUL_AFILL, SHADER_TEX_21_AFILL,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_IMG_21_BGRA_NOMUL_AFILL, SHADER_IMG_21_BGRA_AFILL,
|
||||
SHADER_IMG_21_BGRA_MASK_NOMUL, SHADER_IMG_21_BGRA_MASK);
|
||||
else
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_21_NOMUL, SHADER_TEX_21,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_IMG_21_BGRA_NOMUL, SHADER_IMG_21_BGRA,
|
||||
SHADER_IMG_21_BGRA_MASK_NOMUL, SHADER_IMG_21_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else if ((smooth) && (sh >= (h * 2)))
|
||||
{
|
||||
if ((!tex->alpha) && (tex->pt->native))
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_12_NOMUL_AFILL, SHADER_TEX_12_AFILL,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_IMG_12_BGRA_NOMUL_AFILL, SHADER_IMG_12_BGRA_AFILL,
|
||||
SHADER_IMG_12_BGRA_MASK_NOMUL, SHADER_IMG_12_BGRA_MASK);
|
||||
else
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_12_NOMUL, SHADER_TEX_12,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_IMG_12_BGRA_NOMUL, SHADER_IMG_12_BGRA,
|
||||
SHADER_IMG_12_BGRA_MASK_NOMUL, SHADER_IMG_12_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((!tex->alpha) && (tex->pt->native))
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_NOMUL_AFILL, SHADER_TEX_AFILL,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_IMG_BGRA_NOMUL_AFILL, SHADER_IMG_BGRA_AFILL,
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
else
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_NOMUL, SHADER_TEX,
|
||||
SHADER_IMG_MASK_NOMUL, SHADER_IMG_MASK);
|
||||
SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1992,28 +1992,28 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
|
|||
{
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_22_BGRA_NOMUL, SHADER_IMG_22_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else if ((smooth) && (sw >= (w * 2)))
|
||||
{
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_21_BGRA_NOMUL, SHADER_IMG_21_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else if ((smooth) && (sh >= (h * 2)))
|
||||
{
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_12_BGRA_NOMUL, SHADER_IMG_12_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
sam = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
shader = evas_gl_common_shader_choice(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2474,7 +2474,7 @@ evas_gl_common_context_rgb_a_pair_push(Evas_Engine_GL_Context *gc,
|
|||
shader = evas_gl_common_shader_choice
|
||||
(0, NULL, r, g, b, a, !!mtex,
|
||||
SHADER_RGB_A_PAIR_NOMUL, SHADER_RGB_A_PAIR,
|
||||
SHADER_RGB_A_PAIR_MASK, SHADER_RGB_A_PAIR_MASK);
|
||||
SHADER_RGB_A_PAIR_MASK_NOMUL, SHADER_RGB_A_PAIR_MASK);
|
||||
prog = gc->shared->shader[shader].prog;
|
||||
|
||||
pn = _evas_gl_common_context_push(RTYPE_IMAGE,
|
||||
|
@ -2579,20 +2579,20 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
|
|||
case EVAS_COLORSPACE_YCBCR422P709_PL:
|
||||
shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
|
||||
SHADER_YUV_NOMUL, SHADER_YUV,
|
||||
SHADER_YUV_MASK, SHADER_YUV_MASK);
|
||||
SHADER_YUV_MASK_NOMUL, SHADER_YUV_MASK);
|
||||
utexture = EINA_TRUE;
|
||||
break;
|
||||
case EVAS_COLORSPACE_YCBCR422601_PL:
|
||||
shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
|
||||
SHADER_YUY2_NOMUL, SHADER_YUY2,
|
||||
SHADER_YUY2_MASK, SHADER_YUY2_MASK);
|
||||
SHADER_YUY2_MASK_NOMUL, SHADER_YUY2_MASK);
|
||||
uvtexture = EINA_TRUE;
|
||||
break;
|
||||
case EVAS_COLORSPACE_YCBCR420NV12601_PL:
|
||||
case EVAS_COLORSPACE_YCBCR420TM12601_PL:
|
||||
shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
|
||||
SHADER_NV12_NOMUL, SHADER_NV12,
|
||||
SHADER_NV12_MASK, SHADER_NV12_MASK);
|
||||
SHADER_NV12_MASK_NOMUL, SHADER_NV12_MASK);
|
||||
uvtexture = EINA_TRUE;
|
||||
break;
|
||||
|
||||
|
@ -2603,13 +2603,13 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
|
|||
{
|
||||
shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
}
|
||||
else
|
||||
{
|
||||
shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
|
||||
SHADER_TEX_NOMUL, SHADER_TEX,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2618,7 +2618,7 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
|
|||
{
|
||||
shader = evas_gl_common_shader_choice(npoints, p, r, g, b, a, !!mtex,
|
||||
SHADER_IMG_BGRA_NOMUL, SHADER_IMG_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL, SHADER_IMG_MASK_BGRA);
|
||||
SHADER_IMG_BGRA_MASK_NOMUL, SHADER_IMG_BGRA_MASK);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3424,7 +3424,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
|
|||
if (dbgflushnum == 1)
|
||||
{
|
||||
const char *types[] =
|
||||
{ "----", "RECT", "IMAG", "FONT", "YUV-", "MAP-", "YUY2", "NV12", "LINE" };
|
||||
{ "----", "RECT", "IMAG", "FONT", "YUV-", "MAP-", "YUY2", "NV12", "LINE", "PAIR", "EXTR" };
|
||||
printf(" DRAW#%3i %4i -> %p[%4ix%4i] @ %4ix%4i -{ tex %4i type %s }-\n",
|
||||
i,
|
||||
gc->pipe[i].array.num / 6,
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
*.shd
|
|
@ -1,66 +1,80 @@
|
|||
/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED
|
||||
* See: modules/evas/engines/gl_common/shader/gen_shaders.sh */
|
||||
* See: ./modules/evas/engines/gl_common/shader/gen_shaders.sh */
|
||||
|
||||
typedef enum {
|
||||
SHADER_RECT,
|
||||
SHADER_RECT_MASK,
|
||||
SHADER_FONT,
|
||||
SHADER_FONT_MASK,
|
||||
SHADER_IMG_12_BGRA_NOMUL,
|
||||
SHADER_IMG_12_BGRA,
|
||||
SHADER_IMG_12_NOMUL,
|
||||
SHADER_IMG_12,
|
||||
SHADER_IMG_21_BGRA_NOMUL,
|
||||
SHADER_IMG_21_BGRA,
|
||||
SHADER_IMG_21_NOMUL,
|
||||
SHADER_IMG_21,
|
||||
SHADER_IMG_22_BGRA_NOMUL,
|
||||
SHADER_IMG_22_BGRA,
|
||||
SHADER_IMG_22_NOMUL,
|
||||
SHADER_IMG_22,
|
||||
SHADER_IMG_BGRA_NOMUL,
|
||||
SHADER_IMG_BGRA,
|
||||
SHADER_IMG_NOMUL,
|
||||
SHADER_IMG,
|
||||
SHADER_NV12_NOMUL,
|
||||
SHADER_NV12,
|
||||
SHADER_RECT,
|
||||
SHADER_RGB_A_PAIR_NOMUL,
|
||||
SHADER_RGB_A_PAIR,
|
||||
SHADER_TEX_12,
|
||||
SHADER_TEX_12_NOMUL,
|
||||
SHADER_TEX_21,
|
||||
SHADER_TEX_21_NOMUL,
|
||||
SHADER_TEX_22,
|
||||
SHADER_TEX_22_NOMUL,
|
||||
SHADER_TEX,
|
||||
SHADER_TEX_NOMUL,
|
||||
SHADER_TEX_AFILL,
|
||||
SHADER_TEX_22_AFILL,
|
||||
SHADER_TEX_21_AFILL,
|
||||
SHADER_TEX_12_AFILL,
|
||||
SHADER_TEX_22_NOMUL_AFILL,
|
||||
SHADER_TEX_21_NOMUL_AFILL,
|
||||
SHADER_TEX_12_NOMUL_AFILL,
|
||||
SHADER_TEX_NOMUL_AFILL,
|
||||
SHADER_YUV_NOMUL,
|
||||
SHADER_YUV,
|
||||
SHADER_YUY2_NOMUL,
|
||||
SHADER_YUY2,
|
||||
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_MASK_BGRA,
|
||||
SHADER_IMG_MASK_BGRA_NOMUL,
|
||||
SHADER_YUV_MASK,
|
||||
SHADER_NV12_MASK,
|
||||
SHADER_YUY2_MASK,
|
||||
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_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_RGB_A_PAIR,
|
||||
SHADER_RGB_A_PAIR_MASK,
|
||||
SHADER_RECT_MASK,
|
||||
SHADER_MAP_MASK,
|
||||
SHADER_MAP_MASK_NOMUL,
|
||||
SHADER_MAP_MASK_BGRA,
|
||||
SHADER_MAP_MASK_BGRA_NOMUL,
|
||||
SHADER_RGB_A_PAIR_NOMUL,
|
||||
SHADER_RGB_A_PAIR_MASK_NOMUL,
|
||||
SHADER_TEX_EXTERNAL,
|
||||
SHADER_TEX_EXTERNAL_NOMUL,
|
||||
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_LAST
|
||||
} Evas_GL_Shader;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,14 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_c.xy).aaaa * col;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D texm;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_c.xy).aaaa * texture2D(texm, tex_m.xy).aaaa * col;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec4 mask_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
/* General-purpose fragment shader for all operations in Evas.
|
||||
* This file can either be used directly by evas at runtime to
|
||||
* generate its shaders with the appropriate #defines, or passed
|
||||
* 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
|
||||
|
||||
#ifndef SHD_NOMUL
|
||||
varying vec4 col;
|
||||
#endif
|
||||
|
||||
#ifdef SHD_TEX
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
#endif
|
||||
|
||||
#if defined(SHD_NV12) || defined(SHD_YUY2)
|
||||
uniform sampler2D texuv;
|
||||
varying vec2 tex_c2;
|
||||
#endif
|
||||
|
||||
#if defined(SHD_YUV)
|
||||
uniform sampler2D texu;
|
||||
uniform sampler2D texv;
|
||||
varying vec2 tex_c2;
|
||||
varying vec2 tex_c3;
|
||||
#endif
|
||||
|
||||
#ifdef SHD_TEXA
|
||||
uniform sampler2D texa;
|
||||
varying vec2 tex_a;
|
||||
#endif
|
||||
|
||||
#if defined(SHD_SAM12) || defined(SHD_SAM21) || defined(SHD_SAM22)
|
||||
varying vec4 div_s;
|
||||
# if defined(SHD_SAM12) || defined(SHD_SAM21)
|
||||
varying vec2 tex_s[2];
|
||||
# else
|
||||
varying vec2 tex_s[4];
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef SHD_MASK
|
||||
uniform sampler2D texm;
|
||||
varying vec2 tex_m;
|
||||
#endif
|
||||
|
||||
#ifdef SHD_EXTERNAL
|
||||
# define SHD_TEX
|
||||
// uniform samplerExternalOES tex;
|
||||
varying vec2 tex_c;
|
||||
#endif
|
||||
|
||||
#ifdef SHD_ALPHA
|
||||
# define SWZ aaaa
|
||||
#else
|
||||
# ifndef SHD_BGRA
|
||||
# define SWZ bgra
|
||||
# else
|
||||
# define SWZ rgba
|
||||
# endif
|
||||
#endif
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 c;
|
||||
|
||||
#if defined(SHD_YUV)
|
||||
float r, g, b, y, u, v;
|
||||
y = texture2D(tex, tex_c).r;
|
||||
u = texture2D(texu, tex_c2).r;
|
||||
v = texture2D(texv, tex_c3).r;
|
||||
y = (y - 0.0625) * 1.164;
|
||||
u = u - 0.5;
|
||||
v = v - 0.5;
|
||||
r = y + (1.402 * v);
|
||||
g = y - (0.34414 * u) - (0.71414 * v);
|
||||
b = y + (1.772 * u);
|
||||
c = vec4(r, g, b, 1.0);
|
||||
|
||||
#elif defined(SHD_NV12) || defined(SHD_YUY2)
|
||||
float y, u, v, vmu, r, g, b;
|
||||
y = texture2D(tex, tex_c).g;
|
||||
u = texture2D(texuv, tex_c2).g;
|
||||
v = texture2D(texuv, tex_c2).a;
|
||||
u = u - 0.5;
|
||||
v = v - 0.5;
|
||||
vmu = v * 0.813 + u * 0.391;
|
||||
u = u * 2.018;
|
||||
v = v * 1.596;
|
||||
# ifdef SHD_NV12
|
||||
y = (y - 0.062) * 1.164;
|
||||
# endif
|
||||
r = y + v;
|
||||
g = y - vmu;
|
||||
b = y + u;
|
||||
c = vec4(r, g, b, 1.0);
|
||||
|
||||
#elif defined(SHD_SAM12) || defined(SHD_SAM21)
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]).SWZ;
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]).SWZ;
|
||||
c = (col00 + col01) / div_s;
|
||||
|
||||
#elif defined(SHD_SAM22)
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]).SWZ;
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]).SWZ;
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]).SWZ;
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]).SWZ;
|
||||
c = (col00 + col01 + col10 + col11) / div_s;
|
||||
|
||||
#elif defined(SHD_TEX)
|
||||
c = texture2D(tex, tex_c).SWZ;
|
||||
|
||||
#else
|
||||
c = vec4(1, 1, 1, 1);
|
||||
#endif
|
||||
|
||||
gl_FragColor =
|
||||
c
|
||||
#ifndef SHD_NOMUL
|
||||
* col
|
||||
#endif
|
||||
#ifdef SHD_MASK
|
||||
* texture2D(texm, tex_m).a
|
||||
#endif
|
||||
#ifdef SHD_TEXA
|
||||
* texture2D(texa, tex_a).r
|
||||
#endif
|
||||
;
|
||||
|
||||
#ifdef SHD_AFILL
|
||||
gl_FragColor.a = 1.0;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,68 +1,161 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script will generate a C file containing all the shaders used by Evas.
|
||||
# This C file should be checked-in Git and not modified.
|
||||
set -e
|
||||
|
||||
DIR=`dirname $0`
|
||||
|
||||
OUTPUT=${DIR}/evas_gl_shaders.x
|
||||
OUTPUT_ENUM=${DIR}/evas_gl_enum.x
|
||||
CPP="cpp -P"
|
||||
|
||||
#SHADERS=${DIR}/*.shd
|
||||
SHADERS="$@"
|
||||
VTX_HEADER="#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
"
|
||||
|
||||
# Redirect output to ${OUTPUT}
|
||||
exec 1<&-
|
||||
exec 1>${OUTPUT}
|
||||
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
|
||||
uniform samplerExternalOES tex;
|
||||
#else
|
||||
uniform sampler2D tex;
|
||||
#endif
|
||||
"
|
||||
|
||||
function upper() {
|
||||
echo $@ |tr '[:lower:]' '[:upper:]'
|
||||
}
|
||||
|
||||
function run() {
|
||||
[ "$V" = "1" ] && echo "$@"
|
||||
"$@"
|
||||
}
|
||||
|
||||
# Urgh
|
||||
OIFS=$IFS
|
||||
IFS=$'\n' SHADERS=(`cat ${DIR}/shaders.txt`)
|
||||
IFS=$OIFS
|
||||
|
||||
# Write header
|
||||
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */\n\n"
|
||||
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */\n\n" > ${OUTPUT}
|
||||
|
||||
# Including private for hilights and stuff :)
|
||||
printf "#include \"../evas_gl_private.h\"\n\n"
|
||||
printf "#include \"../evas_gl_private.h\"\n\n" >> ${OUTPUT}
|
||||
|
||||
# Prepare list of shaders:
|
||||
shaders_source=""
|
||||
shaders_enum=""
|
||||
shaders_type=(frag vert)
|
||||
|
||||
# Reading with the following code breaks indents:
|
||||
# while read -r line ; do
|
||||
# done < ${shd}
|
||||
# So we use some cat & IFS hack instead.
|
||||
# Generate SHD files
|
||||
LIST=""
|
||||
for (( i = 0; i < ${#SHADERS[@]} ; i++ )) ; do
|
||||
s=${SHADERS[$i]}
|
||||
if [[ $s == \#* ]] ; then continue ; fi
|
||||
|
||||
for shd in ${SHADERS} ; do
|
||||
lname=`basename ${shd} .shd`
|
||||
UNAME=`echo ${lname} |tr "[:lower:]" "[:upper:]"`
|
||||
name=`echo $s |cut -d ':' -f 1`
|
||||
opts=`echo $s |cut -d ':' -f 2 |tr ',' '\n'`
|
||||
|
||||
printf "/* Source: $shd */\n"
|
||||
echo " SHADER $name"
|
||||
UNAME=`echo ${name} |tr "[:lower:]" "[:upper:]"`
|
||||
OPTS=""
|
||||
FGM=${FGM_HEADER}
|
||||
TYPE=`echo ${name} |cut -d '_' -f 1 |tr '[:lower:]' '[:upper:]'`
|
||||
bgra=0
|
||||
mask=0
|
||||
nomul=0
|
||||
afill=0
|
||||
sam="SAM11"
|
||||
|
||||
OIFS=$IFS
|
||||
IFS=$'\n'
|
||||
printf "static const char const ${lname}_glsl[] ="
|
||||
for line in `cat ${shd}` ; do
|
||||
printf "\n \"${line}\\\n\""
|
||||
# Urgh. Some fixups
|
||||
case $TYPE in
|
||||
IMG) TYPE="IMAGE";;
|
||||
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
|
||||
bgra) bgra=1;;
|
||||
mask) mask=1;;
|
||||
nomul) nomul=1;;
|
||||
afill) afill=1;;
|
||||
external) FGM=${FGM_HEADER_OES};;
|
||||
sam12) sam="SAM12";;
|
||||
sam21) sam="SAM21";;
|
||||
sam22) sam="SAM22";;
|
||||
esac
|
||||
done
|
||||
printf ";\n"
|
||||
IFS=${OIFS}
|
||||
|
||||
printf "Evas_GL_Program_Source shader_${lname}_src =\n{\n ${lname}_glsl,\n NULL, 0\n};\n\n"
|
||||
# vertex shader
|
||||
filev=${DIR}/${name}_vert.shd
|
||||
printf "${VTX_HEADER}" >| ${filev}
|
||||
run $CPP $OPTS ${DIR}/vertex.glsl >> ${filev}
|
||||
|
||||
if echo ${lname} |grep vert 2>&1 >> /dev/null ; then
|
||||
name=`echo ${lname} |sed -e 's/_vert//'`
|
||||
SHADER=`echo ${UNAME} |sed -e 's/_VERT//'`
|
||||
shaders_source="${shaders_source} { SHADER_${SHADER}, &(shader_${name}_vert_src), &(shader_${name}_frag_src), \"${name}\" },\n"
|
||||
shaders_enum="${shaders_enum} SHADER_${SHADER},\n"
|
||||
fi
|
||||
# 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 const ${shdname}_glsl[] =" >> ${OUTPUT}
|
||||
for line in `cat ${shd}` ; do
|
||||
printf "\n \"${line}\\\n\"" >> ${OUTPUT}
|
||||
done
|
||||
printf ";\n" >> ${OUTPUT}
|
||||
IFS=${OIFS}
|
||||
|
||||
printf "Evas_GL_Program_Source shader_${shdname}_src =\n{\n ${shdname}_glsl,\n NULL, 0\n};\n\n" >> ${OUTPUT}
|
||||
done
|
||||
|
||||
shaders_source="${shaders_source} { SHADER_${UNAME}, &(shader_${name}_vert_src), &(shader_${name}_frag_src), \"${name}\", RTYPE_${TYPE}, SHADER_${sam}, ${bgra}, ${mask}, ${nomul}, ${afill} },\n"
|
||||
shaders_enum="${shaders_enum} SHADER_${UNAME},\n"
|
||||
done
|
||||
|
||||
printf "static const struct {
|
||||
printf "
|
||||
typedef enum _Shader_Sampling Shader_Sampling;
|
||||
enum _Shader_Sampling {
|
||||
SHADER_SAM11,
|
||||
SHADER_SAM12,
|
||||
SHADER_SAM21,
|
||||
SHADER_SAM22
|
||||
};
|
||||
|
||||
static const struct {
|
||||
Evas_GL_Shader id;
|
||||
Evas_GL_Program_Source *vert;
|
||||
Evas_GL_Program_Source *frag;
|
||||
const char *name;
|
||||
} _shaders_source[] = {\n"
|
||||
unsigned char type; // RTYPE
|
||||
Shader_Sampling sam;
|
||||
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"
|
||||
printf "${shaders_source}};\n\n" >> ${OUTPUT}
|
||||
|
||||
printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */
|
||||
|
||||
|
@ -71,3 +164,6 @@ ${shaders_enum} SHADER_LAST
|
|||
} Evas_GL_Shader;
|
||||
" >| ${OUTPUT_ENUM}
|
||||
|
||||
# You can remove the files now
|
||||
#rm -f ${LIST}
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
gl_FragColor = ((col00 + col01) / div_s) * col;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
gl_FragColor = (col00 + col01) / div_s;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(0, -tex_sample.y);
|
||||
tex_s[1] = vec2(0, tex_sample.y);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(0, -tex_sample.y);
|
||||
tex_s[1] = vec2(0, tex_sample.y);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;
|
||||
gl_FragColor = ((col00 + col01) / div_s) * col;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;
|
||||
gl_FragColor = (col00 + col01) / div_s;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(0, -tex_sample.y);
|
||||
tex_s[1] = vec2(0, tex_sample.y);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(0, -tex_sample.y);
|
||||
tex_s[1] = vec2(0, tex_sample.y);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
gl_FragColor = ((col00 + col01) / div_s) * col;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
gl_FragColor = (col00 + col01) / div_s;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, 0);
|
||||
tex_s[1] = vec2( tex_sample.x, 0);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, 0);
|
||||
tex_s[1] = vec2( tex_sample.x, 0);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;
|
||||
gl_FragColor = ((col00 + col01) / div_s) * col;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;
|
||||
gl_FragColor = (col00 + col01) / div_s;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, 0);
|
||||
tex_s[1] = vec2( tex_sample.x, 0);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, 0);
|
||||
tex_s[1] = vec2( tex_sample.x, 0);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]);
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]);
|
||||
gl_FragColor = ((col00 + col01 + col10 + col11) / div_s) * col;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]);
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]);
|
||||
gl_FragColor = (col00 + col01 + col10 + col11) / div_s;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
|
||||
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
|
||||
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
|
||||
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
|
||||
div_s = vec4(4, 4, 4, 4);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
|
||||
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
|
||||
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
|
||||
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
|
||||
div_s = vec4(4, 4, 4, 4);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;
|
||||
gl_FragColor = ((col00 + col01 + col10 + col11) / div_s) * col;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]).bgra;
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]).bgra;
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]).bgra;
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]).bgra;
|
||||
gl_FragColor = (col00 + col01 + col10 + col11) / div_s;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
|
||||
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
|
||||
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
|
||||
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
|
||||
div_s = vec4(4, 4, 4, 4);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
|
||||
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
|
||||
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
|
||||
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
|
||||
div_s = vec4(4, 4, 4, 4);
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_c.xy) * col;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_c.xy);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_c.xy).bgra * col;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D texm;
|
||||
varying vec4 col;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(texm, tex_m.xy).a * texture2D(tex, coord_c.xy) * col;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D texm;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(texm, tex_m.xy).a * texture2D(tex, coord_c.xy);
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec4 mask_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
coord_c = tex_coord;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec4 mask_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
coord_c = tex_coord;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D texm;
|
||||
varying vec4 col;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(texm, tex_m.xy).a * texture2D(tex, coord_c.xy).bgra * col;
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D texm;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, coord_c.xy) * texture2D(texm, tex_m).a;
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec4 mask_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
coord_c = tex_coord;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec4 mask_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
coord_c = tex_coord;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_c.xy).bgra;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex, texm;
|
||||
varying vec2 tex_c, tex_m;
|
||||
varying vec4 col;
|
||||
void main()
|
||||
{
|
||||
// FIXME: Fix Mach band effect using proper 4-point color interpolation
|
||||
gl_FragColor = texture2D(tex, tex_c) * texture2D(texm, tex_m).a * col;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex, texm;
|
||||
varying vec2 tex_c, tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_c) * texture2D(texm, tex_m).a;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex, mask_coord;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c, tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex, color, mask_coord;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c, tex_m;
|
||||
varying vec4 col;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
col = color;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex, texm;
|
||||
varying vec2 tex_c, tex_m;
|
||||
varying vec4 col;
|
||||
void main()
|
||||
{
|
||||
// FIXME: Fix Mach band effect using proper 4-point color interpolation
|
||||
gl_FragColor = texture2D(tex, tex_c).bgra * texture2D(texm, tex_m).a * col;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex, texm;
|
||||
varying vec2 tex_c, tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_c).bgra * texture2D(texm, tex_m).a;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex, mask_coord;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c, tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex, color, mask_coord;
|
||||
attribute vec2 tex_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c, tex_m;
|
||||
varying vec4 col;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
col = color;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex, texuv;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c, tex_cuv;
|
||||
void main()
|
||||
{
|
||||
float y,u,v,vmu,r,g,b;
|
||||
y=texture2D(tex,tex_c).g;
|
||||
u=texture2D(texuv,tex_cuv).g;
|
||||
v=texture2D(texuv,tex_cuv).a;
|
||||
|
||||
u=u-0.5;
|
||||
v=v-0.5;
|
||||
vmu=v*0.813+u*0.391;
|
||||
u=u*2.018;
|
||||
v=v*1.596;
|
||||
y=(y-0.062)*1.164;
|
||||
|
||||
r=y+v;
|
||||
g=y-vmu;
|
||||
b=y+u;
|
||||
|
||||
gl_FragColor=vec4(r,g,b,1.0) * col;
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex, texuv, texm;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c, tex_cuv, tex_m;
|
||||
void main()
|
||||
{
|
||||
float y,u,v,vmu,r,g,b;
|
||||
y=texture2D(tex,tex_c).g;
|
||||
u=texture2D(texuv,tex_cuv).g;
|
||||
v=texture2D(texuv,tex_cuv).a;
|
||||
|
||||
u=u-0.5;
|
||||
v=v-0.5;
|
||||
vmu=v*0.813+u*0.391;
|
||||
u=u*2.018;
|
||||
v=v*1.596;
|
||||
y=(y-0.062)*1.164;
|
||||
|
||||
r=y+v;
|
||||
g=y-vmu;
|
||||
b=y+u;
|
||||
|
||||
gl_FragColor = vec4(r,g,b,1.0) * texture2D(tex, tex_m.xy).a * col;
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec4 mask_coord;
|
||||
attribute vec2 tex_coord, tex_coord2;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c, tex_cuv, tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_cuv = tex_coord2 * 0.5;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex, texuv;
|
||||
varying vec2 tex_c, tex_cuv;
|
||||
void main()
|
||||
{
|
||||
float y,u,v,vmu,r,g,b;
|
||||
y=texture2D(tex,tex_c).g;
|
||||
u=texture2D(texuv,tex_cuv).g;
|
||||
v=texture2D(texuv,tex_cuv).a;
|
||||
|
||||
u=u-0.5;
|
||||
v=v-0.5;
|
||||
vmu=v*0.813+u*0.391;
|
||||
u=u*2.018;
|
||||
v=v*1.596;
|
||||
y=(y-0.062)*1.164;
|
||||
|
||||
r=y+v;
|
||||
g=y-vmu;
|
||||
b=y+u;
|
||||
|
||||
gl_FragColor=vec4(r,g,b,1.0);
|
||||
}
|
||||
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord, tex_coord2;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c, tex_cuv;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_cuv = tex_coord2 * 0.5;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord, tex_coord2;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c, tex_cuv;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_cuv = tex_coord2 * 0.5;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = col;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D texm;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(texm, tex_m.xy).a * col;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec4 mask_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D texa;
|
||||
varying vec4 col;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 coord_a;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor.rgb = texture2D(tex, coord_c.xy).rgb * col.rgb * texture2D(texa, coord_a).g;
|
||||
gl_FragColor.a = col.a * texture2D(texa, coord_a).g;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D texa;
|
||||
uniform sampler2D texm;
|
||||
varying vec4 col;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 coord_a;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor.rgb = texture2D(tex, coord_c.xy).rgb * col.rgb * texture2D(texa, coord_a).g * texture2D(texm, tex_m.xy).a;
|
||||
gl_FragColor.a = col.a * texture2D(texa, coord_a).g * texture2D(texm, tex_m.xy).a;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_coorda;
|
||||
attribute vec4 mask_coord;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 coord_a;
|
||||
varying vec2 tex_m;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
coord_c = tex_coord;
|
||||
coord_a = tex_coorda;
|
||||
|
||||
// mask_coord.w contains the Y-invert flag
|
||||
// position on screen in [0..1] range of current pixel
|
||||
vec4 mask_Position = mvp * vertex * vec4(0.5, sign(mask_coord.w) * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
|
||||
tex_m = mask_Position.xy * abs(mask_coord.zw) + mask_coord.xy;
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D texa;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 coord_a;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor.rgb = texture2D(tex, coord_c.xy).rgb * texture2D(texa, coord_a).g;
|
||||
gl_FragColor.a = texture2D(texa, coord_a).g;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_coorda;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 coord_a;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
coord_c = tex_coord;
|
||||
coord_a = tex_coorda;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_coorda;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 coord_c;
|
||||
varying vec2 coord_a;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
coord_c = tex_coord;
|
||||
coord_a = tex_coorda;
|
||||
}
|
|
@ -0,0 +1,113 @@
|
|||
# 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
|
||||
|
||||
|
||||
# Fonts (alpha only)
|
||||
font:tex,alpha
|
||||
font_mask:tex,mask,alpha
|
||||
|
||||
|
||||
# Images: color version
|
||||
img:tex
|
||||
img_bgra:tex,bgra
|
||||
img_12:tex,sam12
|
||||
img_21:tex,sam21
|
||||
img_22:tex,sam22
|
||||
img_12_bgra:tex,sam12,bgra
|
||||
img_21_bgra:tex,sam21,bgra
|
||||
img_22_bgra:tex,sam22,bgra
|
||||
|
||||
img_mask:tex,mask
|
||||
img_bgra_mask:tex,mask,bgra
|
||||
img_12_mask:tex,mask,sam12
|
||||
img_21_mask:tex,mask,sam21
|
||||
img_22_mask:tex,mask,sam22
|
||||
img_12_bgra_mask:tex,mask,sam12,bgra
|
||||
img_21_bgra_mask:tex,mask,sam21,bgra
|
||||
img_22_bgra_mask:tex,mask,sam22,bgra
|
||||
|
||||
|
||||
# Images: nomul version (copy above with extra nomul flag)
|
||||
img_nomul:tex,nomul
|
||||
img_bgra_nomul:tex,nomul,bgra
|
||||
img_12_nomul:tex,sam12,nomul
|
||||
img_21_nomul:tex,sam21,nomul
|
||||
img_22_nomul:tex,sam22,nomul
|
||||
img_12_bgra_nomul:tex,sam12,bgra,nomul
|
||||
img_21_bgra_nomul:tex,sam21,bgra,nomul
|
||||
img_22_bgra_nomul:tex,sam22,bgra,nomul
|
||||
|
||||
img_mask_nomul:tex,mask,nomul
|
||||
img_bgra_mask_nomul:tex,mask,nomul,bgra
|
||||
img_12_mask_nomul:tex,mask,sam12,nomul
|
||||
img_21_mask_nomul:tex,mask,sam21,nomul
|
||||
img_22_mask_nomul:tex,mask,sam22,nomul
|
||||
img_12_bgra_mask_nomul:tex,mask,sam12,bgra,nomul
|
||||
img_21_bgra_mask_nomul:tex,mask,sam21,bgra,nomul
|
||||
img_22_bgra_mask_nomul:tex,mask,sam22,bgra,nomul
|
||||
|
||||
|
||||
|
||||
# Some AFILL versions
|
||||
img_afill:tex,afill
|
||||
img_bgra_afill:tex,afill,bgra
|
||||
img_nomul_afill:tex,nomul,afill
|
||||
img_bgra_nomul_afill:tex,nomul,afill,bgra
|
||||
img_12_afill:tex,sam12,afill
|
||||
img_21_afill:tex,sam21,afill
|
||||
img_22_afill:tex,sam22,afill
|
||||
img_12_bgra_afill:tex,sam12,bgra,afill
|
||||
img_21_bgra_afill:tex,sam21,bgra,afill
|
||||
img_22_bgra_afill:tex,sam22,bgra,afill
|
||||
img_12_nomul_afill:tex,sam12,nomul,afill
|
||||
img_21_nomul_afill:tex,sam21,nomul,afill
|
||||
img_22_nomul_afill:tex,sam22,nomul,afill
|
||||
img_12_bgra_nomul_afill:tex,sam12,bgra,nomul,afill
|
||||
img_21_bgra_nomul_afill:tex,sam21,bgra,nomul,afill
|
||||
img_22_bgra_nomul_afill:tex,sam22,bgra,nomul,afill
|
||||
|
||||
|
||||
|
||||
# RGB+A. We can add more!
|
||||
rgb_a_pair:texa
|
||||
rgb_a_pair_mask:texa,mask
|
||||
rgb_a_pair_nomul:texa,nomul
|
||||
rgb_a_pair_mask_nomul:texa,mask,nomul
|
||||
#rgb_a_pair_afill:texa,afill
|
||||
#rgb_a_pair_nomul_afill: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
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 c = (col00 + col01) / div_s;
|
||||
gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(0, -tex_sample.y);
|
||||
tex_s[1] = vec2(0, tex_sample.y);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
gl_FragColor = ((col00 + col01) / div_s) * col;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 c = (col00 + col01) / div_s;
|
||||
gl_FragColor = vec4(c.r, c.g, c.b, 1);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(0, -tex_sample.y);
|
||||
tex_s[1] = vec2(0, tex_sample.y);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
gl_FragColor = (col00 + col01) / div_s;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(0, -tex_sample.y);
|
||||
tex_s[1] = vec2(0, tex_sample.y);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(0, -tex_sample.y);
|
||||
tex_s[1] = vec2(0, tex_sample.y);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 c = (col00 + col01) / div_s;
|
||||
gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, 0);
|
||||
tex_s[1] = vec2( tex_sample.x, 0);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
gl_FragColor = ((col00 + col01) / div_s) * col;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 c = (col00 + col01) / div_s;
|
||||
gl_FragColor = vec4(c.r, c.g, c.b, 1);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, 0);
|
||||
tex_s[1] = vec2( tex_sample.x, 0);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
gl_FragColor = (col00 + col01) / div_s;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, 0);
|
||||
tex_s[1] = vec2( tex_sample.x, 0);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[2];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, 0);
|
||||
tex_s[1] = vec2( tex_sample.x, 0);
|
||||
div_s = vec4(2, 2, 2, 2);
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]);
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]);
|
||||
vec4 c = (col00 + col01 + col10 + col11) / div_s;
|
||||
gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec4 color;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
col = color;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
|
||||
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
|
||||
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
|
||||
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
|
||||
div_s = vec4(4, 4, 4, 4);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec4 col;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]);
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]);
|
||||
gl_FragColor = ((col00 + col01 + col10 + col11) / div_s) * col;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]);
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]);
|
||||
vec4 c = (col00 + col01 + col10 + col11) / div_s;
|
||||
gl_FragColor = vec4(c.r, c.g, c.b, 1);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
|
||||
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
|
||||
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
|
||||
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
|
||||
div_s = vec4(4, 4, 4, 4);
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#endif
|
||||
uniform sampler2D tex;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
vec4 col00 = texture2D(tex, tex_c + tex_s[0]);
|
||||
vec4 col01 = texture2D(tex, tex_c + tex_s[1]);
|
||||
vec4 col10 = texture2D(tex, tex_c + tex_s[2]);
|
||||
vec4 col11 = texture2D(tex, tex_c + tex_s[3]);
|
||||
gl_FragColor = (col00 + col01 + col10 + col11) / div_s;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
attribute vec4 vertex;
|
||||
attribute vec2 tex_coord;
|
||||
attribute vec2 tex_sample;
|
||||
uniform mat4 mvp;
|
||||
varying vec2 tex_c;
|
||||
varying vec2 tex_s[4];
|
||||
varying vec4 div_s;
|
||||
void main()
|
||||
{
|
||||
gl_Position = mvp * vertex;
|
||||
tex_c = tex_coord;
|
||||
tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);
|
||||
tex_s[1] = vec2( tex_sample.x, -tex_sample.y);
|
||||
tex_s[2] = vec2( tex_sample.x, tex_sample.y);
|
||||
tex_s[3] = vec2(-tex_sample.x, tex_sample.y);
|
||||
div_s = vec4(4, 4, 4, 4);
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue