forked from enlightenment/efl
evas: use Evas_GL_image for generate texture unit for Evas_3D_Texture.
Summary: Used engine function for load image/data and use texture unit through Evas_GL_Image object Used Evas_ColorSpace format instead Evas_3D_Color/Pixel format Added transformation matrix for adjusting texture unit coordinates in shader Added property in Evas_3D_Texture for mark possibility get texture without atlas (see https://phab.enlightenment.org/conpherence/54/, I suppose it will done after this patch) Reviewers: Hermet, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2371 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
parent
0f6d101ad5
commit
d88ccf06a5
|
@ -697,44 +697,6 @@ typedef enum _Evas_3D_Comparison
|
|||
EVAS_3D_COMPARISON_ALWAYS,
|
||||
} Evas_3D_Comparison;
|
||||
|
||||
/**
|
||||
* Color formats of pixel data
|
||||
*
|
||||
* @since 1.10
|
||||
* @ingroup Evas_3D_Types
|
||||
*/
|
||||
typedef enum _Evas_3D_Color_Format
|
||||
{
|
||||
/**< Color contains full components, red, green, blue and alpha */
|
||||
EVAS_3D_COLOR_FORMAT_RGBA = 0,
|
||||
/**< Color contains only red, green and blue components */
|
||||
EVAS_3D_COLOR_FORMAT_RGB,
|
||||
/**< Color contains only alpha component */
|
||||
EVAS_3D_COLOR_FORMAT_ALPHA
|
||||
} Evas_3D_Color_Format;
|
||||
|
||||
/**
|
||||
* Pixel formats
|
||||
*
|
||||
* @since 1.10
|
||||
* @ingroup Evas_3D_Types
|
||||
*/
|
||||
typedef enum _Evas_3D_Pixel_Format
|
||||
{
|
||||
/**< 8-bit pixel with single component */
|
||||
EVAS_3D_PIXEL_FORMAT_8 = 0,
|
||||
/**< 16-bit pixel with three components (5-6-5 bit) */
|
||||
EVAS_3D_PIXEL_FORMAT_565,
|
||||
/**< 24-bit pixel with three 8-bit components */
|
||||
EVAS_3D_PIXEL_FORMAT_888,
|
||||
/**< 32-bit pixel with four 8-bit components */
|
||||
EVAS_3D_PIXEL_FORMAT_8888,
|
||||
/**< 16-bit pixel with four 4-bit components */
|
||||
EVAS_3D_PIXEL_FORMAT_4444,
|
||||
/**< 16-bit pixel with four components (5-5-5-1 bit) */
|
||||
EVAS_3D_PIXEL_FORMAT_5551
|
||||
} Evas_3D_Pixel_Format;
|
||||
|
||||
/**
|
||||
* Wrap modes
|
||||
*
|
||||
|
|
|
@ -234,7 +234,7 @@ _evas_3d_texture_evas_3d_object_update_notify(Eo *obj, Evas_3D_Texture_Data *pd)
|
|||
if (e->engine.func->texture_new)
|
||||
{
|
||||
pd->engine_data =
|
||||
e->engine.func->texture_new(e->engine.data.output);
|
||||
e->engine.func->texture_new(e->engine.data.output, pd->atlas_enable);
|
||||
}
|
||||
|
||||
if (pd->engine_data == NULL)
|
||||
|
@ -308,7 +308,6 @@ evas_3d_texture_material_del(Evas_3D_Texture *texture, Evas_3D_Material *materia
|
|||
eina_hash_set(pd->materials, &material, (const void *)(uintptr_t)(count - 1));
|
||||
}
|
||||
|
||||
|
||||
EAPI Evas_3D_Texture *
|
||||
evas_3d_texture_add(Evas *e)
|
||||
{
|
||||
|
@ -324,6 +323,8 @@ EOLIAN static void
|
|||
_evas_3d_texture_eo_base_constructor(Eo *obj, Evas_3D_Texture_Data *pd EINA_UNUSED)
|
||||
{
|
||||
eo_do_super(obj, MY_CLASS, eo_constructor());
|
||||
pd->atlas_enable = EINA_TRUE;
|
||||
|
||||
eo_do(obj, evas_3d_object_type_set(EVAS_3D_OBJECT_TYPE_TEXTURE));
|
||||
}
|
||||
|
||||
|
@ -335,37 +336,68 @@ _evas_3d_texture_eo_base_destructor(Eo *obj, Evas_3D_Texture_Data *pd EINA_UNUS
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_evas_3d_texture_data_set(Eo *obj EINA_UNUSED, Evas_3D_Texture_Data *pd, Evas_3D_Color_Format color_format,
|
||||
Evas_3D_Pixel_Format pixel_format, int w, int h, const void *data)
|
||||
_evas_3d_texture_data_set(Eo *obj, Evas_3D_Texture_Data *pd,
|
||||
Evas_Colorspace color_format,
|
||||
int w, int h, const void *data)
|
||||
{
|
||||
Eo *evas = NULL;
|
||||
void *image = NULL;
|
||||
eo_do(obj, evas = evas_common_evas_get());
|
||||
Evas_Public_Data *e = eo_data_scope_get(evas, EVAS_CANVAS_CLASS);
|
||||
|
||||
if (!pd->engine_data && e->engine.func->texture_new)
|
||||
pd->engine_data = e->engine.func->texture_new(e->engine.data.output);
|
||||
pd->engine_data = e->engine.func->texture_new(e->engine.data.output, pd->atlas_enable);
|
||||
if (!data)
|
||||
{
|
||||
ERR("Failure, image data is empty");
|
||||
return;
|
||||
}
|
||||
|
||||
if (e->engine.func->texture_data_set)
|
||||
e->engine.func->texture_data_set(e->engine.data.output, pd->engine_data,
|
||||
color_format, pixel_format, w, h, data);
|
||||
image = e->engine.func->image_new_from_data(e->engine.data.output, w, h, (DATA32 *)data, EINA_TRUE, color_format);
|
||||
if (!image)
|
||||
{
|
||||
ERR("Can't load image from data");
|
||||
return;
|
||||
}
|
||||
|
||||
if (e->engine.func->texture_image_set)
|
||||
e->engine.func->texture_image_set(e->engine.data.output,
|
||||
pd->engine_data,
|
||||
image);
|
||||
e->engine.func->image_free(e->engine.data.output, image);
|
||||
eo_do(obj, evas_3d_object_change(EVAS_3D_STATE_TEXTURE_DATA, NULL));
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_evas_3d_texture_file_set(Eo *obj, Evas_3D_Texture_Data *pd, const char *file, const char *key)
|
||||
{
|
||||
|
||||
Evas_Image_Load_Opts lo;
|
||||
int load_error;
|
||||
Eo *evas = NULL;
|
||||
void *image;
|
||||
|
||||
eo_do(obj, evas = evas_common_evas_get());
|
||||
Evas_Public_Data *e = eo_data_scope_get(evas, EVAS_CANVAS_CLASS);
|
||||
|
||||
if (!pd->engine_data && e->engine.func->texture_new)
|
||||
pd->engine_data = e->engine.func->texture_new(e->engine.data.output);
|
||||
pd->engine_data = e->engine.func->texture_new(e->engine.data.output, pd->atlas_enable);
|
||||
|
||||
if (e->engine.func->texture_file_set)
|
||||
e->engine.func->texture_file_set(e->engine.data.output, pd->engine_data,
|
||||
file, key);
|
||||
memset(&lo, 0x0, sizeof(Evas_Image_Load_Opts));
|
||||
image = e->engine.func->image_load(e->engine.data.output,
|
||||
file, key, &load_error, &lo);
|
||||
if (!image)
|
||||
{
|
||||
ERR("Can't load image from file");
|
||||
return;
|
||||
}
|
||||
|
||||
if (e->engine.func->texture_image_set)
|
||||
e->engine.func->texture_image_set(e->engine.data.output,
|
||||
pd->engine_data,
|
||||
image);
|
||||
|
||||
e->engine.func->image_free(e->engine.data.output, image);
|
||||
eo_do(obj, evas_3d_object_change(EVAS_3D_STATE_TEXTURE_DATA, NULL));
|
||||
}
|
||||
|
||||
|
@ -374,6 +406,7 @@ _evas_3d_texture_source_set(Eo *obj , Evas_3D_Texture_Data *pd, Evas_Object *sou
|
|||
{
|
||||
Eo *evas = NULL;
|
||||
eo_do(obj, evas = evas_common_evas_get());
|
||||
Evas_Public_Data *e = eo_data_scope_get(evas, EVAS_CANVAS_CLASS);
|
||||
Evas_Object_Protected_Data *src;
|
||||
|
||||
if (source == pd->source)
|
||||
|
@ -403,6 +436,8 @@ _evas_3d_texture_source_set(Eo *obj , Evas_3D_Texture_Data *pd, Evas_Object *sou
|
|||
ERR("No evas surface associated with the source object.");
|
||||
return;
|
||||
}
|
||||
if (!pd->engine_data && e->engine.func->texture_new)
|
||||
pd->engine_data = e->engine.func->texture_new(e->engine.data.output, pd->atlas_enable);
|
||||
|
||||
_texture_proxy_set(obj, source, src);
|
||||
eo_do(obj, evas_3d_object_change(EVAS_3D_STATE_TEXTURE_DATA, NULL));
|
||||
|
@ -442,19 +477,21 @@ _evas_3d_texture_source_visible_get(Eo *obj EINA_UNUSED, Evas_3D_Texture_Data *p
|
|||
return !src_obj->proxy->src_invisible;
|
||||
}
|
||||
|
||||
EOLIAN static Evas_3D_Color_Format
|
||||
EOLIAN static Evas_Colorspace
|
||||
_evas_3d_texture_color_format_get(Eo *obj EINA_UNUSED, Evas_3D_Texture_Data *pd)
|
||||
{
|
||||
// FIXME: we need an unknown color format and unify that with Evas color space to
|
||||
Evas_3D_Color_Format format = -1;
|
||||
Evas_Colorspace format = -1;
|
||||
Eo *evas = NULL;
|
||||
eo_do(obj, evas = evas_common_evas_get());
|
||||
Evas_Public_Data *e = eo_data_scope_get(evas, EVAS_CANVAS_CLASS);
|
||||
|
||||
if (e->engine.func->texture_color_format_get)
|
||||
if (e->engine.func->image_colorspace_get &&
|
||||
e->engine.func->texture_image_get)
|
||||
{
|
||||
e->engine.func->texture_color_format_get(e->engine.data.output,
|
||||
pd->engine_data, &format);
|
||||
void *image;
|
||||
|
||||
image = e->engine.func->texture_image_get(e->engine.data.output, pd->engine_data);
|
||||
format = e->engine.func->image_colorspace_get(e->engine.data.output, image);
|
||||
}
|
||||
|
||||
return format;
|
||||
|
@ -527,4 +564,15 @@ _evas_3d_texture_filter_get(Eo *obj EINA_UNUSED, Evas_3D_Texture_Data *pd, Evas_
|
|||
}
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_evas_3d_texture_atlas_enable_set(Eo *obj EINA_UNUSED, Evas_3D_Texture_Data *pd, Eina_Bool use_atlas)
|
||||
{
|
||||
if (pd->atlas_enable != use_atlas) pd->atlas_enable = use_atlas;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_evas_3d_texture_atlas_enable_get(Eo *obj EINA_UNUSED, Evas_3D_Texture_Data *pd)
|
||||
{
|
||||
return pd->atlas_enable;
|
||||
}
|
||||
#include "canvas/evas_3d_texture.eo.c"
|
||||
|
|
|
@ -31,6 +31,29 @@ class Evas_3D_Texture (Evas_3D_Object, Evas.Common_Interface)
|
|||
bool visible; /*@ @c EINA_TRUE for visible, @c EINA_FALSE for invisible.*/
|
||||
}
|
||||
}
|
||||
atlas_enable {
|
||||
set {
|
||||
/*
|
||||
Set enable flag to generation texture unit with support atlas.
|
||||
|
||||
Use this flag only in case not normalize texture coordinates.
|
||||
|
||||
By default, is enabled.
|
||||
|
||||
@ingroup Evas_3D_Texture
|
||||
*/
|
||||
}
|
||||
get {
|
||||
/*
|
||||
Get enable flag of generation texture unit with support atlas.
|
||||
|
||||
@ingroup Evas_3D_Texture
|
||||
*/
|
||||
}
|
||||
values {
|
||||
bool use_atlas; /*@ @c EINA_TRUE for enable, @c EINA_FALSE for disable.*/
|
||||
}
|
||||
}
|
||||
}
|
||||
methods {
|
||||
data_set {
|
||||
|
@ -43,8 +66,7 @@ class Evas_3D_Texture (Evas_3D_Object, Evas.Common_Interface)
|
|||
*/
|
||||
|
||||
params {
|
||||
@in Evas_3D_Color_Format color_format; /*@ Color format of the texture. */
|
||||
@in Evas_3D_Pixel_Format pixel_format; /*@ Pixel format of the data. */
|
||||
@in Evas_Colorspace color_format; /*@ Color format of the texture. */
|
||||
@in int w; /*@ Width of the data. */
|
||||
@in int h; /*@ Height of the data. */
|
||||
@in const(void)* data; /*@ Pointer to the data. */
|
||||
|
@ -55,8 +77,6 @@ class Evas_3D_Texture (Evas_3D_Object, Evas.Common_Interface)
|
|||
/*
|
||||
Set the data of the given texture from file.
|
||||
|
||||
Only PNG format is supported.
|
||||
|
||||
@ingroup Evas_3D_Texture
|
||||
*/
|
||||
|
||||
|
@ -96,7 +116,7 @@ class Evas_3D_Texture (Evas_3D_Object, Evas.Common_Interface)
|
|||
|
||||
@ingroup Evas_3D_Texture
|
||||
*/
|
||||
return: Evas_3D_Color_Format;
|
||||
return: Evas_Colorspace;
|
||||
}
|
||||
|
||||
size_get @const {
|
||||
|
|
|
@ -1150,6 +1150,36 @@ evas_mat3_invserse(Evas_Mat3 *out, const Evas_Mat3 *mat)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
evas_mat3_set_position_transform(Evas_Mat3 *out, const Evas_Real p_x, const Evas_Real p_y)
|
||||
{
|
||||
Evas_Real *d = &out->m[0];
|
||||
memset(d, 0x00, sizeof(Evas_Mat3));
|
||||
d[0] = 1;
|
||||
d[2] = p_x;
|
||||
d[4] = 1;
|
||||
d[5] = p_y;
|
||||
d[8] = 1;
|
||||
if (p_x || p_y)
|
||||
out->flags = 0;
|
||||
else
|
||||
out->flags = EVAS_MATRIX_IS_IDENTITY;
|
||||
}
|
||||
|
||||
static inline void
|
||||
evas_mat3_set_scale_transform(Evas_Mat3 *out, Evas_Real s_x, Evas_Real s_y)
|
||||
{
|
||||
Evas_Real *d = &out->m[0];
|
||||
memset(d, 0x00, sizeof(Evas_Mat3));
|
||||
d[0] = s_x;
|
||||
d[4] = s_y;
|
||||
d[8] = 1;
|
||||
if (s_x != 1.0 || s_y != 1.0)
|
||||
out->flags = 0;
|
||||
else
|
||||
out->flags = EVAS_MATRIX_IS_IDENTITY;
|
||||
}
|
||||
|
||||
/* 2x2 matrix */
|
||||
static inline void
|
||||
evas_mat2_identity_set(Evas_Mat2 *m)
|
||||
|
|
|
@ -369,9 +369,11 @@ struct _Evas_3D_Texture
|
|||
Evas_Object *source;
|
||||
Eina_Bool proxy_rendering;
|
||||
void *proxy_surface;
|
||||
|
||||
/* Engine-side object. */
|
||||
void *engine_data;
|
||||
|
||||
/*Use atlases, @EINA_TRUE by default*/
|
||||
Eina_Bool atlas_enable :1;
|
||||
};
|
||||
|
||||
struct _Evas_3D_Material
|
||||
|
@ -389,7 +391,7 @@ struct _Evas_3D_Material
|
|||
|
||||
struct _Evas_3D_Scene_Public_Data
|
||||
{
|
||||
Evas_Color bg_color;
|
||||
Evas_Color bg_color;
|
||||
Evas_3D_Node *camera_node;
|
||||
Eina_List *light_nodes;
|
||||
Eina_List *mesh_nodes;
|
||||
|
@ -1360,17 +1362,15 @@ struct _Evas_Func
|
|||
int (*drawable_texture_color_pick_id_get) (void *drawable);
|
||||
double (*drawable_texture_pixel_color_get) (unsigned int tex EINA_UNUSED, int x, int y, void *drawable);
|
||||
|
||||
void *(*texture_new) (void *data);
|
||||
void *(*texture_new) (void *data, Eina_Bool use_atlas);
|
||||
void (*texture_free) (void *data, void *texture);
|
||||
void (*texture_data_set) (void *data, void *texture, Evas_3D_Color_Format format, Evas_3D_Pixel_Format pixel_format, int w, int h, const void *pixels);
|
||||
void (*texture_file_set) (void *data, void *texture, const char *file, const char *key);
|
||||
void (*texture_color_format_get) (void *data, void *texture, Evas_3D_Color_Format *format);
|
||||
void (*texture_size_get) (void *data, void *texture, int *w, int *h);
|
||||
void (*texture_wrap_set) (void *data, void *texture, Evas_3D_Wrap_Mode s, Evas_3D_Wrap_Mode t);
|
||||
void (*texture_wrap_get) (void *data, void *texture, Evas_3D_Wrap_Mode *s, Evas_3D_Wrap_Mode *t);
|
||||
void (*texture_filter_set) (void *data, void *texture, Evas_3D_Texture_Filter min, Evas_3D_Texture_Filter mag);
|
||||
void (*texture_filter_get) (void *data, void *texture, Evas_3D_Texture_Filter *min, Evas_3D_Texture_Filter *mag);
|
||||
void (*texture_image_set) (void *data, void *texture, void *image);
|
||||
void *(*texture_image_get) (void *data, void *texture);
|
||||
|
||||
Ector_Surface *(*ector_get) (void *data);
|
||||
void (*ector_begin) (void *data, void *context, void *surface, int x, int y, Eina_Bool do_async);
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
void
|
||||
e3d_texture_param_update(E3D_Texture *texture)
|
||||
{
|
||||
if (texture->is_imported)
|
||||
return;
|
||||
|
||||
if (texture->wrap_dirty)
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture->wrap_s);
|
||||
|
@ -40,7 +37,7 @@ e3d_texture_param_update(E3D_Texture *texture)
|
|||
}
|
||||
|
||||
E3D_Texture *
|
||||
e3d_texture_new(void)
|
||||
e3d_texture_new(Eina_Bool use_atlas)
|
||||
{
|
||||
E3D_Texture *texture = NULL;
|
||||
|
||||
|
@ -52,12 +49,14 @@ e3d_texture_new(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
evas_mat3_identity_set(&texture->trans);
|
||||
|
||||
texture->w = 0;
|
||||
texture->h = 0;
|
||||
texture->x = 0;
|
||||
texture->y = 0;
|
||||
|
||||
texture->is_imported = EINA_FALSE;
|
||||
texture->tex = 0;
|
||||
texture->format = GL_RGBA;
|
||||
|
||||
texture->wrap_dirty = EINA_TRUE;
|
||||
texture->wrap_s = GL_CLAMP_TO_EDGE;
|
||||
|
@ -67,192 +66,63 @@ e3d_texture_new(void)
|
|||
texture->filter_min = GL_NEAREST;
|
||||
texture->filter_mag = GL_NEAREST;
|
||||
|
||||
texture->atlas_enable = use_atlas;
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
void
|
||||
e3d_texture_free(E3D_Texture *texture)
|
||||
{
|
||||
if (texture->tex && !texture->is_imported)
|
||||
glDeleteTextures(1, &texture->tex);
|
||||
|
||||
if (texture)
|
||||
{
|
||||
if (texture->surface)
|
||||
evas_gl_common_image_unref(texture->surface);
|
||||
}
|
||||
free(texture);
|
||||
}
|
||||
|
||||
void
|
||||
e3d_texture_data_set(E3D_Texture *texture,
|
||||
Evas_3D_Color_Format color_format, Evas_3D_Pixel_Format pixel_format,
|
||||
int w, int h, const void *data)
|
||||
{
|
||||
GLenum format;
|
||||
GLenum iformat;
|
||||
GLenum type;
|
||||
|
||||
if (color_format == EVAS_3D_COLOR_FORMAT_RGBA)
|
||||
{
|
||||
format = GL_RGBA;
|
||||
iformat = GL_BGRA;
|
||||
|
||||
if (pixel_format == EVAS_3D_PIXEL_FORMAT_8888)
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
else if (pixel_format == EVAS_3D_PIXEL_FORMAT_4444)
|
||||
type = GL_UNSIGNED_SHORT_4_4_4_4;
|
||||
else if (pixel_format == EVAS_3D_PIXEL_FORMAT_5551)
|
||||
type = GL_UNSIGNED_SHORT_5_5_5_1;
|
||||
else
|
||||
{
|
||||
ERR("Texture data format mismatch.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (color_format == EVAS_3D_COLOR_FORMAT_RGB)
|
||||
{
|
||||
format = GL_RGB;
|
||||
iformat = GL_BGR;
|
||||
|
||||
if (pixel_format == EVAS_3D_PIXEL_FORMAT_565)
|
||||
type = GL_UNSIGNED_SHORT_5_6_5;
|
||||
else if (pixel_format == EVAS_3D_PIXEL_FORMAT_888)
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
else
|
||||
{
|
||||
ERR("Texture data format mismatch.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (color_format == EVAS_3D_COLOR_FORMAT_ALPHA)
|
||||
{
|
||||
format = GL_LUMINANCE;
|
||||
iformat = GL_LUMINANCE;
|
||||
|
||||
if (pixel_format == EVAS_3D_PIXEL_FORMAT_8)
|
||||
type = GL_UNSIGNED_BYTE;
|
||||
else
|
||||
{
|
||||
ERR("Texture data format mismatch.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("Invalid texture color format");
|
||||
return;
|
||||
}
|
||||
|
||||
if (texture->tex == 0 || texture->is_imported)
|
||||
{
|
||||
glGenTextures(1, &texture->tex);
|
||||
texture->wrap_dirty = EINA_TRUE;
|
||||
texture->filter_dirty = EINA_TRUE;
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, texture->tex);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0, iformat, type, data);
|
||||
|
||||
if (texture->wrap_dirty)
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture->wrap_s);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texture->wrap_t);
|
||||
texture->wrap_dirty = EINA_FALSE;
|
||||
}
|
||||
|
||||
if (texture->filter_dirty)
|
||||
{
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texture->filter_min);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texture->filter_mag);
|
||||
texture->filter_dirty = EINA_FALSE;
|
||||
}
|
||||
|
||||
texture->is_imported = EINA_FALSE;
|
||||
texture->format = format;
|
||||
}
|
||||
|
||||
void
|
||||
e3d_texture_file_set(E3D_Texture *texture, const char *file, const char *key)
|
||||
{
|
||||
Evas_Image_Load_Opts lo;
|
||||
int error;
|
||||
Evas_3D_Color_Format color_format;
|
||||
Evas_3D_Pixel_Format pixel_format;
|
||||
|
||||
memset(&lo, 0x0, sizeof(Evas_Image_Load_Opts));
|
||||
RGBA_Image *im = evas_common_load_image_from_file(file, key, &lo, &error);
|
||||
if (!im) return;
|
||||
|
||||
error = evas_cache_image_load_data(&im->cache_entry);
|
||||
|
||||
switch(im->cache_entry.space)
|
||||
{
|
||||
case EVAS_COLORSPACE_ARGB8888:
|
||||
pixel_format = EVAS_3D_PIXEL_FORMAT_8888;
|
||||
color_format = EVAS_3D_COLOR_FORMAT_RGBA;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
e3d_texture_data_set(texture, color_format, pixel_format, im->cache_entry.w,
|
||||
im->cache_entry.h, im->image.data);
|
||||
evas_cache_image_unload_data(&im->cache_entry);
|
||||
}
|
||||
|
||||
Evas_3D_Color_Format
|
||||
e3d_texture_color_format_get(E3D_Texture *texture)
|
||||
{
|
||||
if (texture->is_imported)
|
||||
{
|
||||
ERR("Cannot get the size of an imported texture.");
|
||||
return EVAS_3D_COLOR_FORMAT_RGBA;
|
||||
}
|
||||
|
||||
switch (texture->format)
|
||||
{
|
||||
case GL_RGBA:
|
||||
return EVAS_3D_COLOR_FORMAT_RGBA;
|
||||
case GL_RGB:
|
||||
return EVAS_3D_COLOR_FORMAT_RGB;
|
||||
case GL_ALPHA:
|
||||
return EVAS_3D_COLOR_FORMAT_ALPHA;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ERR("Invalid texture format.");
|
||||
return EVAS_3D_COLOR_FORMAT_RGBA;
|
||||
}
|
||||
|
||||
void
|
||||
e3d_texture_size_get(const E3D_Texture *texture, int *w, int *h)
|
||||
{
|
||||
if (texture->is_imported)
|
||||
{
|
||||
ERR("Invalid operation on an imported texture resource.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (w) *w = texture->w;
|
||||
if (h) *h = texture->h;
|
||||
}
|
||||
|
||||
void
|
||||
e3d_texture_import(E3D_Texture *texture, GLuint tex)
|
||||
e3d_texture_set(Evas_Engine_GL_Context *gc,
|
||||
E3D_Texture *texture,
|
||||
Evas_GL_Image *im)
|
||||
{
|
||||
if (tex == 0)
|
||||
{
|
||||
ERR("Cannot import an invalid texture ID.");
|
||||
return;
|
||||
}
|
||||
Evas_Mat3 pt,st;
|
||||
Evas_Real pt_x, pt_y, st_x, st_y;
|
||||
|
||||
if (texture->tex && !texture->is_imported)
|
||||
glDeleteTextures(1, &texture->tex);
|
||||
texture->surface = im;
|
||||
evas_gl_common_image_ref(im);
|
||||
|
||||
texture->tex = tex;
|
||||
texture->is_imported = EINA_TRUE;
|
||||
evas_gl_common_image_update(gc, im);
|
||||
|
||||
texture->tex = im->tex->pt->texture;
|
||||
texture->w = im->w;
|
||||
texture->h = im->h;
|
||||
texture->x = im->tex->x;
|
||||
texture->y = im->tex->y;
|
||||
|
||||
pt_x = im->tex->pt->w ? (im->tex->x/(Evas_Real)im->tex->pt->w) : 0;
|
||||
pt_y = im->tex->pt->h ? (im->tex->y/(Evas_Real)im->tex->pt->h) : 0;
|
||||
|
||||
st_x = im->tex->pt->w ? (im->w/(Evas_Real)im->tex->pt->w) : 1.0;
|
||||
st_y = im->tex->pt->h ? (im->h/(Evas_Real)im->tex->pt->h) : 1.0;
|
||||
/*Build adjusting matrix for texture unit coordinates*/
|
||||
evas_mat3_set_position_transform(&pt, pt_x, pt_y);
|
||||
evas_mat3_set_scale_transform(&st, st_x, st_y);
|
||||
evas_mat3_multiply(&texture->trans, &st, &pt);
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
e3d_texture_is_imported_get(const E3D_Texture *texture)
|
||||
Evas_GL_Image *
|
||||
e3d_texture_get(E3D_Texture *texture)
|
||||
{
|
||||
return texture->is_imported;
|
||||
return texture ? texture->surface : NULL;
|
||||
}
|
||||
|
||||
static inline GLenum
|
||||
|
@ -348,12 +218,6 @@ e3d_texture_wrap_set(E3D_Texture *texture, Evas_3D_Wrap_Mode s, Evas_3D_Wrap_Mod
|
|||
{
|
||||
GLenum gl_s, gl_t;
|
||||
|
||||
if (texture->is_imported)
|
||||
{
|
||||
ERR("Invalid operation on an imported texture resource.");
|
||||
return;
|
||||
}
|
||||
|
||||
gl_s = _to_gl_texture_wrap(s);
|
||||
gl_t = _to_gl_texture_wrap(t);
|
||||
|
||||
|
@ -368,12 +232,6 @@ e3d_texture_wrap_set(E3D_Texture *texture, Evas_3D_Wrap_Mode s, Evas_3D_Wrap_Mod
|
|||
void
|
||||
e3d_texture_wrap_get(const E3D_Texture *texture, Evas_3D_Wrap_Mode *s, Evas_3D_Wrap_Mode *t)
|
||||
{
|
||||
if (texture->is_imported)
|
||||
{
|
||||
ERR("Invalid operation on an imported texture resource.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (s)
|
||||
*s = _to_e3d_texture_wrap(texture->wrap_s);
|
||||
|
||||
|
@ -386,12 +244,6 @@ e3d_texture_filter_set(E3D_Texture *texture, Evas_3D_Texture_Filter min, Evas_3D
|
|||
{
|
||||
GLenum gl_min, gl_mag;
|
||||
|
||||
if (texture->is_imported)
|
||||
{
|
||||
ERR("Invalid operation on an imported texture resource.");
|
||||
return;
|
||||
}
|
||||
|
||||
gl_min = _to_gl_texture_filter(min);
|
||||
gl_mag = _to_gl_texture_filter(mag);
|
||||
|
||||
|
@ -407,12 +259,6 @@ void
|
|||
e3d_texture_filter_get(const E3D_Texture *texture,
|
||||
Evas_3D_Texture_Filter *min, Evas_3D_Texture_Filter *mag)
|
||||
{
|
||||
if (texture->is_imported)
|
||||
{
|
||||
ERR("Invalid operation on an imported texture resource.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (min)
|
||||
*min = _to_e3d_texture_filter(texture->filter_min);
|
||||
|
||||
|
|
|
@ -7,13 +7,12 @@ typedef struct _E3D_Drawable E3D_Drawable;
|
|||
typedef struct _E3D_Renderer E3D_Renderer;
|
||||
|
||||
/* Texture */
|
||||
E3D_Texture *e3d_texture_new(void);
|
||||
E3D_Texture *e3d_texture_new(Eina_Bool use_atlas);
|
||||
void e3d_texture_free(E3D_Texture *texture);
|
||||
|
||||
void e3d_texture_data_set(E3D_Texture *texture, Evas_3D_Color_Format format, Evas_3D_Pixel_Format pixel_format, int w, int h, const void *data);
|
||||
void e3d_texture_file_set(E3D_Texture *texture, const char *file, const char *key);
|
||||
Evas_3D_Color_Format e3d_texture_color_format_get(E3D_Texture *texture);
|
||||
void e3d_texture_size_get(const E3D_Texture *texture, int *w, int *h);
|
||||
void e3d_texture_set(Evas_Engine_GL_Context *gc, E3D_Texture *texture, Evas_GL_Image *im);
|
||||
Evas_GL_Image *e3d_texture_get(E3D_Texture *texture);
|
||||
|
||||
void e3d_texture_import(E3D_Texture *texture, GLuint tex);
|
||||
Eina_Bool e3d_texture_is_imported_get(const E3D_Texture *texture);
|
||||
|
|
|
@ -111,19 +111,25 @@ struct _E3D_Draw_Data
|
|||
|
||||
struct _E3D_Texture
|
||||
{
|
||||
int w, h;
|
||||
/*Offset for atlasses*/
|
||||
int x, y;
|
||||
int w, h;
|
||||
|
||||
Eina_Bool is_imported;
|
||||
GLuint tex;
|
||||
GLenum format;
|
||||
Evas_GL_Image *surface;
|
||||
/*Tranformation matrix, use it for adjusting texture unit coordinates*/
|
||||
Evas_Mat3 trans;
|
||||
|
||||
Eina_Bool wrap_dirty;
|
||||
GLenum wrap_s;
|
||||
GLenum wrap_t;
|
||||
GLuint tex;
|
||||
|
||||
Eina_Bool filter_dirty;
|
||||
GLenum filter_min;
|
||||
GLenum filter_mag;
|
||||
Eina_Bool wrap_dirty;
|
||||
GLenum wrap_s;
|
||||
GLenum wrap_t;
|
||||
|
||||
Eina_Bool filter_dirty;
|
||||
GLenum filter_min;
|
||||
GLenum filter_mag;
|
||||
/*Use atlas for generation texture unit, @EINA_TRUE by default*/
|
||||
Eina_Bool atlas_enable;
|
||||
};
|
||||
|
||||
struct _E3D_Drawable
|
||||
|
|
|
@ -32,6 +32,18 @@ typedef enum _E3D_Uniform
|
|||
E3D_UNIFORM_TEXTURE_EMISSION1,
|
||||
E3D_UNIFORM_TEXTURE_NORMAL1,
|
||||
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT0,
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_DIFFUSE0,
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_SPECULAR0,
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_EMISSION0,
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_NORMAL0,
|
||||
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT1,
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_DIFFUSE1,
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_SPECULAR1,
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_EMISSION1,
|
||||
E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_NORMAL1,
|
||||
|
||||
E3D_UNIFORM_SHADOWMAP,
|
||||
|
||||
E3D_UNIFORM_LIGHT_POSITION,
|
||||
|
@ -312,6 +324,16 @@ static const char *uniform_names[] =
|
|||
"uTextureSpecular1",
|
||||
"uTextureEmission1",
|
||||
"uTextureNormal1",
|
||||
"uTextureMatrixTransformAmbient0",
|
||||
"uTextureMatrixTransformDiffuse0",
|
||||
"uTextureMatrixTransformSpecular0",
|
||||
"uTextureMatrixTransformEmission0",
|
||||
"uTextureMatrixTransformNormal0",
|
||||
"uTextureMatrixTransformAmbient1",
|
||||
"uTextureMatrixTransformDiffuse1",
|
||||
"uTextureMatrixTransformSpecular1",
|
||||
"uTextureMatrixTransformEmission1",
|
||||
"uTextureMatrixTransformNormal1",
|
||||
"uShadowMap",
|
||||
"uLightPosition",
|
||||
"uLightSpotDir",
|
||||
|
@ -344,6 +366,15 @@ _program_uniform_init(E3D_Program *program)
|
|||
static inline void
|
||||
_uniform_upload(E3D_Uniform u, GLint loc, const E3D_Draw_Data *data)
|
||||
{
|
||||
#define SET_TEX_COORD_TRANSFORM_MATRIX(attrib, tn) \
|
||||
if (data->materials[attrib].tex##tn) \
|
||||
{ \
|
||||
float m[9]; \
|
||||
for(int i = 0 ; i < 9 ; i++) \
|
||||
m[i] = data->materials[attrib].tex##tn->trans.m[i]; \
|
||||
glUniformMatrix3fv(loc, 1, EINA_FALSE, &m[0]); \
|
||||
}
|
||||
|
||||
switch (u)
|
||||
{
|
||||
case E3D_UNIFORM_MATRIX_MVP: {
|
||||
|
@ -434,6 +465,46 @@ _uniform_upload(E3D_Uniform u, GLint loc, const E3D_Draw_Data *data)
|
|||
case E3D_UNIFORM_TEXTURE_NORMAL1:
|
||||
glUniform1i(loc, data->materials[EVAS_3D_MATERIAL_NORMAL].sampler1);
|
||||
break;
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT0: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_AMBIENT, 0)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_DIFFUSE0: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_DIFFUSE, 0)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_SPECULAR0: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_SPECULAR, 0)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_EMISSION0: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_EMISSION, 0)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_NORMAL0: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_NORMAL, 0)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT1: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_AMBIENT, 1)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_DIFFUSE1: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_DIFFUSE, 1)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_SPECULAR1: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_SPECULAR, 1)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_EMISSION1: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_EMISSION, 1)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_NORMAL1: {
|
||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_3D_MATERIAL_NORMAL, 1)
|
||||
break;
|
||||
}
|
||||
case E3D_UNIFORM_SHADOWMAP:
|
||||
glUniform1i(loc, data->smap_sampler);
|
||||
break;
|
||||
|
@ -512,6 +583,7 @@ _uniform_upload(E3D_Uniform u, GLint loc, const E3D_Draw_Data *data)
|
|||
ERR("Invalid uniform ID.");
|
||||
break;
|
||||
}
|
||||
#undef SET_TEX_SHIFT
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -129,22 +129,28 @@ static const char diffuse_frag_glsl[] =
|
|||
"uniform vec4 uLightDiffuse;\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
"uniform sampler2D uTextureDiffuse0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse0;\n"
|
||||
"vec3 Tex0CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse0;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureDiffuse1;\n"
|
||||
"uniform float uTextureDiffuseWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse1;\n"
|
||||
"vec3 Tex1CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse1;\n"
|
||||
"#endif //DIFFUSE_TEXTURE_BLEND\n"
|
||||
"#endif //DIFFUSE\n"
|
||||
"void main() {\n"
|
||||
" vec4 color;\n"
|
||||
" \n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureDiffuse1, vTexCoord),\n"
|
||||
" texture2D(uTextureDiffuse0, vTexCoord), uTextureDiffuseWeight);\n"
|
||||
" color = mix(texture2D(uTextureDiffuse1, vec2(Tex1CoordDiffuse)),\n"
|
||||
" texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)), uTextureDiffuseWeight);\n"
|
||||
" color *= uMaterialDiffuse;\n"
|
||||
"#else\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
" color = texture2D(uTextureDiffuse0, vTexCoord) * uMaterialDiffuse;\n"
|
||||
" color = texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)) * uMaterialDiffuse;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialDiffuse;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
|
@ -309,7 +315,7 @@ static const char flat_frag_glsl[] =
|
|||
" shadow = 0.0;\n"
|
||||
" for (i = -4.0; i < 4.0; i++)\n"
|
||||
" for (j = -4.0; j < 4.0; j++)\n"
|
||||
" shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0)*size).x);\n"
|
||||
" shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0) * size).x);\n"
|
||||
" return shadow / 64.0;\n"
|
||||
"}\n"
|
||||
"#endif //SHADOWED\n"
|
||||
|
@ -318,10 +324,16 @@ static const char flat_frag_glsl[] =
|
|||
"uniform vec4 uLightDiffuse;\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
"uniform sampler2D uTextureDiffuse0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse0;\n"
|
||||
"vec3 Tex0CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse0;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureDiffuse1;\n"
|
||||
"uniform float uTextureDiffuseWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse1;\n"
|
||||
"vec3 Tex1CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse1;\n"
|
||||
"#endif //DIFFUSE_TEXTURE_BLEND\n"
|
||||
"#endif //DIFFUSE\n"
|
||||
"#ifdef SPECULAR\n"
|
||||
|
@ -330,10 +342,16 @@ static const char flat_frag_glsl[] =
|
|||
"uniform vec4 uMaterialSpecular;\n"
|
||||
"#ifdef SPECULAR_TEXTURE\n"
|
||||
"uniform sampler2D uTextureSpecular0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformSpecular0;\n"
|
||||
"vec3 Tex0CoordSpecular = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformSpecular0;\n"
|
||||
"#endif //SPECULAR_TEXTURE\n"
|
||||
"#ifdef SPECULAR_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureSpecular1;\n"
|
||||
"uniform float uTextureSpecularWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformSpecular1;\n"
|
||||
"vec3 Tex1CoordSpecular = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformSpecular1;\n"
|
||||
"#endif //SPECULAR_TEXTURE_BLEND\n"
|
||||
"#endif //SPECULAR\n"
|
||||
"#ifdef AMBIENT\n"
|
||||
|
@ -341,20 +359,32 @@ static const char flat_frag_glsl[] =
|
|||
"uniform vec4 uLightAmbient;\n"
|
||||
"#ifdef AMBIENT_TEXTURE\n"
|
||||
"uniform sampler2D uTextureAmbient0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformAmbient0;\n"
|
||||
"vec3 Tex0CoordAmbient = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformAmbient0;\n"
|
||||
"#endif //AMBIENT_TEXTURE\n"
|
||||
"#ifdef AMBIENT_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureAmbient1;\n"
|
||||
"uniform float uTextureAmbientWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformAmbient1;\n"
|
||||
"vec3 Tex1CoordAmbient = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformAmbient1;\n"
|
||||
"#endif //AMBIENT_TEXTURE_BLEND\n"
|
||||
"#endif //AMBIENT\n"
|
||||
"#ifdef EMISSION\n"
|
||||
"uniform vec4 uMaterialEmission;\n"
|
||||
"#ifdef EMISSION_TEXTURE\n"
|
||||
"uniform sampler2D uTextureEmission0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformEmission0;\n"
|
||||
"vec3 Tex0CoordEmission = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformEmission0;\n"
|
||||
"#endif //EMISSION_TEXTURE\n"
|
||||
"#ifdef EMISSION_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureEmission1;\n"
|
||||
"uniform float uTextureEmissionWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformEmission1;\n"
|
||||
"vec3 Tex1CoordEmission = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformEmission1;\n"
|
||||
"#endif //EMISSION_TEXTURE_BLEND\n"
|
||||
"#endif //EMISSION\n"
|
||||
"void fragmentFlat()\n"
|
||||
|
@ -363,12 +393,12 @@ static const char flat_frag_glsl[] =
|
|||
"#ifdef DIFFUSE\n"
|
||||
" \n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureDiffuse1, vTexCoord),\n"
|
||||
" texture2D(uTextureDiffuse0, vTexCoord), uTextureDiffuseWeight);\n"
|
||||
" color = mix(texture2D(uTextureDiffuse1, vec2(Tex1CoordDiffuse)),\n"
|
||||
" texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)), uTextureDiffuseWeight);\n"
|
||||
" color *= uMaterialDiffuse;\n"
|
||||
"#else\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
" color = texture2D(uTextureDiffuse0, vTexCoord) * uMaterialDiffuse;\n"
|
||||
" color = texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)) * uMaterialDiffuse;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialDiffuse;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
|
@ -380,12 +410,12 @@ static const char flat_frag_glsl[] =
|
|||
"#ifdef SPECULAR\n"
|
||||
" \n"
|
||||
"#ifdef SPECULAR_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureSpecular1, vTexCoord),\n"
|
||||
" texture2D(uTextureSpecular0, vTexCoord), uTextureSpecularWeight);\n"
|
||||
" color = mix(texture2D(uTextureSpecular1, vec2(Tex1CoordSpecular)),\n"
|
||||
" texture2D(uTextureSpecular0, vec2(Tex0CoordSpecular)), uTextureSpecularWeight);\n"
|
||||
" color *= uMaterialSpecular;\n"
|
||||
"#else\n"
|
||||
"#ifdef SPECULAR_TEXTURE\n"
|
||||
" color = texture2D(uTextureSpecular0, vTexCoord) * uMaterialSpecular;\n"
|
||||
" color = texture2D(uTextureSpecular0, vec2(Tex0CoordSpecular)) * uMaterialSpecular;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialSpecular;\n"
|
||||
"#endif //SPECULAR_TEXTURE\n"
|
||||
|
@ -398,12 +428,12 @@ static const char flat_frag_glsl[] =
|
|||
"#ifdef AMBIENT\n"
|
||||
" \n"
|
||||
"#ifdef AMBIENT_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureAmbient1, vTexCoord),\n"
|
||||
" texture2D(uTextureAmbient0, vTexCoord), uTextureAmbientWeight);\n"
|
||||
" color = mix(texture2D(uTextureAmbient1, vec2(Tex1CoordAmbient)),\n"
|
||||
" texture2D(uTextureAmbient0, vec2(Tex0CoordAmbient)), uTextureAmbientWeight);\n"
|
||||
" color *= uMaterialAmbient;\n"
|
||||
"#else\n"
|
||||
"#ifdef AMBIENT_TEXTURE\n"
|
||||
" color = texture2D(uTextureAmbient0, vTexCoord) * uMaterialAmbient;\n"
|
||||
" color = texture2D(uTextureAmbient0, vec2(Tex0CoordAmbient)) * uMaterialAmbient;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialAmbient;\n"
|
||||
"#endif //AMBIENT_TEXTURE\n"
|
||||
|
@ -413,12 +443,12 @@ static const char flat_frag_glsl[] =
|
|||
"#ifdef EMISSION\n"
|
||||
" \n"
|
||||
"#ifdef EMISSION_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureEmission1, vTexCoord),\n"
|
||||
" texture2D(uTextureEmission0, vTexCoord), uTextureEmissionWeight);\n"
|
||||
" color = mix(texture2D(uTextureEmission1, vec2(Tex1CoordEmission)),\n"
|
||||
" texture2D(uTextureEmission0, vec2(Tex0CoordEmission)), uTextureEmissionWeight);\n"
|
||||
" color *= uMaterialEmission;\n"
|
||||
"#else\n"
|
||||
"#ifdef EMISSION_TEXTURE\n"
|
||||
" color = texture2D(uTextureEmission0, vTexCoord) * uMaterialEmission;\n"
|
||||
" color = texture2D(uTextureEmission0, vec2(Tex0CoordEmission)) * uMaterialEmission;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialEmission;\n"
|
||||
"#endif //EMISSION_TEXTURE\n"
|
||||
|
@ -560,7 +590,7 @@ static const char phong_frag_glsl[] =
|
|||
" shadow = 0.0;\n"
|
||||
" for (i = -4.0; i < 4.0; i++)\n"
|
||||
" for (j = -4.0; j < 4.0; j++)\n"
|
||||
" shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0)*size).x);\n"
|
||||
" shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0) * size).x);\n"
|
||||
" return shadow / 64.0;\n"
|
||||
"}\n"
|
||||
"#endif //SHADOWED\n"
|
||||
|
@ -569,10 +599,16 @@ static const char phong_frag_glsl[] =
|
|||
"uniform vec4 uLightDiffuse;\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
"uniform sampler2D uTextureDiffuse0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse0;\n"
|
||||
"vec3 Tex0CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse0;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureDiffuse1;\n"
|
||||
"uniform float uTextureDiffuseWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse1;\n"
|
||||
"vec3 Tex1CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse1;\n"
|
||||
"#endif //DIFFUSE_TEXTURE_BLEND\n"
|
||||
"#endif //DIFFUSE\n"
|
||||
"#ifdef SPECULAR\n"
|
||||
|
@ -581,10 +617,16 @@ static const char phong_frag_glsl[] =
|
|||
"uniform vec4 uMaterialSpecular;\n"
|
||||
"#ifdef SPECULAR_TEXTURE\n"
|
||||
"uniform sampler2D uTextureSpecular0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformSpecular0;\n"
|
||||
"vec3 Tex0CoordSpecular = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformSpecular0;\n"
|
||||
"#endif //SPECULAR_TEXTURE\n"
|
||||
"#ifdef SPECULAR_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureSpecular1;\n"
|
||||
"uniform float uTextureSpecularWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformSpecular1;\n"
|
||||
"vec3 Tex1CoordSpecular = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformSpecular1;\n"
|
||||
"#endif //SPECULAR_TEXTURE_BLEND\n"
|
||||
"#endif //SPECULAR\n"
|
||||
"#ifdef AMBIENT\n"
|
||||
|
@ -592,20 +634,32 @@ static const char phong_frag_glsl[] =
|
|||
"uniform vec4 uLightAmbient;\n"
|
||||
"#ifdef AMBIENT_TEXTURE\n"
|
||||
"uniform sampler2D uTextureAmbient0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformAmbient0;\n"
|
||||
"vec3 Tex0CoordAmbient = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformAmbient0;\n"
|
||||
"#endif //AMBIENT_TEXTURE\n"
|
||||
"#ifdef AMBIENT_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureAmbient1;\n"
|
||||
"uniform float uTextureAmbientWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformAmbient1;\n"
|
||||
"vec3 Tex1CoordAmbient = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformAmbient1;\n"
|
||||
"#endif //AMBIENT_TEXTURE_BLEND\n"
|
||||
"#endif //AMBIENT\n"
|
||||
"#ifdef EMISSION\n"
|
||||
"uniform vec4 uMaterialEmission;\n"
|
||||
"#ifdef EMISSION_TEXTURE\n"
|
||||
"uniform sampler2D uTextureEmission0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformEmission0;\n"
|
||||
"vec3 Tex0CoordEmission = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformEmission0;\n"
|
||||
"#endif //EMISSION_TEXTURE\n"
|
||||
"#ifdef EMISSION_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureEmission1;\n"
|
||||
"uniform float uTextureEmissionWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformEmission1;\n"
|
||||
"vec3 Tex1CoordEmission = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformEmission1;\n"
|
||||
"#endif //EMISSION_TEXTURE_BLEND\n"
|
||||
"#endif //EMISSION\n"
|
||||
"#ifdef LIGHT_SPOT\n"
|
||||
|
@ -635,12 +689,12 @@ static const char phong_frag_glsl[] =
|
|||
"#ifdef DIFFUSE\n"
|
||||
" \n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureDiffuse1, vTexCoord),\n"
|
||||
" texture2D(uTextureDiffuse0, vTexCoord), uTextureDiffuseWeight);\n"
|
||||
" color = mix(texture2D(uTextureDiffuse1, vec2(Tex1CoordDiffuse)),\n"
|
||||
" texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)), uTextureDiffuseWeight);\n"
|
||||
" color *= uMaterialDiffuse;\n"
|
||||
"#else\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
" color = texture2D(uTextureDiffuse0, vTexCoord) * uMaterialDiffuse;\n"
|
||||
" color = texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)) * uMaterialDiffuse;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialDiffuse;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
|
@ -657,12 +711,12 @@ static const char phong_frag_glsl[] =
|
|||
" factor = pow(factor, uMaterialShininess);\n"
|
||||
" \n"
|
||||
"#ifdef SPECULAR_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureSpecular1, vTexCoord),\n"
|
||||
" texture2D(uTextureSpecular0, vTexCoord), uTextureSpecularWeight);\n"
|
||||
" color = mix(texture2D(uTextureSpecular1, vec2(Tex1CoordSpecular)),\n"
|
||||
" texture2D(uTextureSpecular0, vec2(Tex0CoordSpecular)), uTextureSpecularWeight);\n"
|
||||
" color *= uMaterialSpecular;\n"
|
||||
"#else\n"
|
||||
"#ifdef SPECULAR_TEXTURE\n"
|
||||
" color = texture2D(uTextureSpecular0, vTexCoord) * uMaterialSpecular;\n"
|
||||
" color = texture2D(uTextureSpecular0, vec2(Tex0CoordSpecular)) * uMaterialSpecular;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialSpecular;\n"
|
||||
"#endif //SPECULAR_TEXTURE\n"
|
||||
|
@ -679,12 +733,12 @@ static const char phong_frag_glsl[] =
|
|||
"#ifdef AMBIENT\n"
|
||||
" \n"
|
||||
"#ifdef AMBIENT_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureAmbient1, vTexCoord),\n"
|
||||
" texture2D(uTextureAmbient0, vTexCoord), uTextureAmbientWeight);\n"
|
||||
" color = mix(texture2D(uTextureAmbient1, vec2(Tex1CoordAmbient)),\n"
|
||||
" texture2D(uTextureAmbient0, vec2(Tex0CoordAmbient)), uTextureAmbientWeight);\n"
|
||||
" color *= uMaterialAmbient;\n"
|
||||
"#else\n"
|
||||
"#ifdef AMBIENT_TEXTURE\n"
|
||||
" color = texture2D(uTextureAmbient0, vTexCoord) * uMaterialAmbient;\n"
|
||||
" color = texture2D(uTextureAmbient0, vec2(Tex0CoordAmbient)) * uMaterialAmbient;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialAmbient;\n"
|
||||
"#endif //AMBIENT_TEXTURE\n"
|
||||
|
@ -699,12 +753,12 @@ static const char phong_frag_glsl[] =
|
|||
"#ifdef EMISSION\n"
|
||||
" \n"
|
||||
"#ifdef EMISSION_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureEmission1, vTexCoord),\n"
|
||||
" texture2D(uTextureEmission0, vTexCoord), uTextureEmissionWeight);\n"
|
||||
" color = mix(texture2D(uTextureEmission1, vec2(Tex1CoordEmission)),\n"
|
||||
" texture2D(uTextureEmission0, vec2(Tex0CoordEmission)), uTextureEmissionWeight);\n"
|
||||
" color *= uMaterialEmission;\n"
|
||||
"#else\n"
|
||||
"#ifdef EMISSION_TEXTURE\n"
|
||||
" color = texture2D(uTextureEmission0, vTexCoord) * uMaterialEmission;\n"
|
||||
" color = texture2D(uTextureEmission0, vec2(Tex0CoordEmission)) * uMaterialEmission;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialEmission;\n"
|
||||
"#endif //EMISSION_TEXTURE\n"
|
||||
|
@ -905,7 +959,7 @@ static const char normal_map_frag_glsl[] =
|
|||
" shadow = 0.0;\n"
|
||||
" for (i = -4.0; i < 4.0; i++)\n"
|
||||
" for (j = -4.0; j < 4.0; j++)\n"
|
||||
" shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0)*size).x);\n"
|
||||
" shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0) * size).x);\n"
|
||||
" return shadow / 64.0;\n"
|
||||
"}\n"
|
||||
"#endif //SHADOWED\n"
|
||||
|
@ -921,10 +975,16 @@ static const char normal_map_frag_glsl[] =
|
|||
"uniform vec4 uLightDiffuse;\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
"uniform sampler2D uTextureDiffuse0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse0;\n"
|
||||
"vec3 Tex0CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse0;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureDiffuse1;\n"
|
||||
"uniform float uTextureDiffuseWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse1;\n"
|
||||
"vec3 Tex1CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse1;\n"
|
||||
"#endif //DIFFUSE_TEXTURE_BLEND\n"
|
||||
"#endif //DIFFUSE\n"
|
||||
"#ifdef SPECULAR\n"
|
||||
|
@ -933,10 +993,16 @@ static const char normal_map_frag_glsl[] =
|
|||
"uniform vec4 uMaterialSpecular;\n"
|
||||
"#ifdef SPECULAR_TEXTURE\n"
|
||||
"uniform sampler2D uTextureSpecular0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformSpecular0;\n"
|
||||
"vec3 Tex0CoordSpecular = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformSpecular0;\n"
|
||||
"#endif //SPECULAR_TEXTURE\n"
|
||||
"#ifdef SPECULAR_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureSpecular1;\n"
|
||||
"uniform float uTextureSpecularWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformSpecular1;\n"
|
||||
"vec3 Tex1CoordSpecular = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformSpecular1;\n"
|
||||
"#endif //SPECULAR_TEXTURE_BLEND\n"
|
||||
"#endif //SPECULAR\n"
|
||||
"#ifdef AMBIENT\n"
|
||||
|
@ -944,20 +1010,32 @@ static const char normal_map_frag_glsl[] =
|
|||
"uniform vec4 uLightAmbient;\n"
|
||||
"#ifdef AMBIENT_TEXTURE\n"
|
||||
"uniform sampler2D uTextureAmbient0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformAmbient0;\n"
|
||||
"vec3 Tex0CoordAmbient = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformAmbient0;\n"
|
||||
"#endif //AMBIENT_TEXTURE\n"
|
||||
"#ifdef AMBIENT_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureAmbient1;\n"
|
||||
"uniform float uTextureAmbientWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformAmbient1;\n"
|
||||
"vec3 Tex1CoordAmbient = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformAmbient1;\n"
|
||||
"#endif //AMBIENT_TEXTURE_BLEND\n"
|
||||
"#endif //AMBIENT\n"
|
||||
"#ifdef EMISSION\n"
|
||||
"uniform vec4 uMaterialEmission;\n"
|
||||
"#ifdef EMISSION_TEXTURE\n"
|
||||
"uniform sampler2D uTextureEmission0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformEmission0;\n"
|
||||
"vec3 Tex0CoordEmission = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformEmission0;\n"
|
||||
"#endif //EMISSION_TEXTURE\n"
|
||||
"#ifdef EMISSION_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureEmission1;\n"
|
||||
"uniform float uTextureEmissionWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformEmission1;\n"
|
||||
"vec3 Tex1CoordEmission = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformEmission1;\n"
|
||||
"#endif //EMISSION_TEXTURE_BLEND\n"
|
||||
"#endif //EMISSION\n"
|
||||
"#ifdef LIGHT_SPOT\n"
|
||||
|
@ -1019,12 +1097,12 @@ static const char normal_map_frag_glsl[] =
|
|||
"#ifdef DIFFUSE\n"
|
||||
" \n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureDiffuse1, vTexCoord),\n"
|
||||
" texture2D(uTextureDiffuse0, vTexCoord), uTextureDiffuseWeight);\n"
|
||||
" color = mix(texture2D(uTextureDiffuse1, vec2(Tex1CoordDiffuse)),\n"
|
||||
" texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)), uTextureDiffuseWeight);\n"
|
||||
" color *= uMaterialDiffuse;\n"
|
||||
"#else\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
" color = texture2D(uTextureDiffuse0, vTexCoord) * uMaterialDiffuse;\n"
|
||||
" color = texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)) * uMaterialDiffuse;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialDiffuse;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
|
@ -1040,12 +1118,12 @@ static const char normal_map_frag_glsl[] =
|
|||
" factor = pow(factor, uMaterialShininess);\n"
|
||||
" \n"
|
||||
"#ifdef SPECULAR_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureSpecular1, vTexCoord),\n"
|
||||
" texture2D(uTextureSpecular0, vTexCoord), uTextureSpecularWeight);\n"
|
||||
" color = mix(texture2D(uTextureSpecular1, vec2(Tex1CoordSpecular)),\n"
|
||||
" texture2D(uTextureSpecular0, vec2(Tex0CoordSpecular)), uTextureSpecularWeight);\n"
|
||||
" color *= uMaterialSpecular;\n"
|
||||
"#else\n"
|
||||
"#ifdef SPECULAR_TEXTURE\n"
|
||||
" color = texture2D(uTextureSpecular0, vTexCoord) * uMaterialSpecular;\n"
|
||||
" color = texture2D(uTextureSpecular0, vec2(Tex0CoordSpecular)) * uMaterialSpecular;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialSpecular;\n"
|
||||
"#endif //SPECULAR_TEXTURE\n"
|
||||
|
@ -1062,12 +1140,12 @@ static const char normal_map_frag_glsl[] =
|
|||
"#ifdef AMBIENT\n"
|
||||
" \n"
|
||||
"#ifdef AMBIENT_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureAmbient1, vTexCoord),\n"
|
||||
" texture2D(uTextureAmbient0, vTexCoord), uTextureAmbientWeight);\n"
|
||||
" color = mix(texture2D(uTextureAmbient1, vec2(Tex1CoordAmbient)),\n"
|
||||
" texture2D(uTextureAmbient0, vec2(Tex0CoordAmbient)), uTextureAmbientWeight);\n"
|
||||
" color *= uMaterialAmbient;\n"
|
||||
"#else\n"
|
||||
"#ifdef AMBIENT_TEXTURE\n"
|
||||
" color = texture2D(uTextureAmbient0, vTexCoord) * uMaterialAmbient;\n"
|
||||
" color = texture2D(uTextureAmbient0, vec2(Tex0CoordAmbient)) * uMaterialAmbient;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialAmbient;\n"
|
||||
"#endif //AMBIENT_TEXTURE\n"
|
||||
|
@ -1080,12 +1158,12 @@ static const char normal_map_frag_glsl[] =
|
|||
"#ifdef EMISSION\n"
|
||||
" \n"
|
||||
"#ifdef EMISSION_TEXTURE_BLEND\n"
|
||||
" color = mix(texture2D(uTextureEmission1, vTexCoord),\n"
|
||||
" texture2D(uTextureEmission0, vTexCoord), uTextureEmissionWeight);\n"
|
||||
" color = mix(texture2D(uTextureEmission1, vec2(Tex1CoordEmission)),\n"
|
||||
" texture2D(uTextureEmission0, vec2(Tex0CoordEmission)), uTextureEmissionWeight);\n"
|
||||
" color *= uMaterialEmission;\n"
|
||||
"#else\n"
|
||||
"#ifdef EMISSION_TEXTURE\n"
|
||||
" color = texture2D(uTextureEmission0, vTexCoord) * uMaterialEmission;\n"
|
||||
" color = texture2D(uTextureEmission0, vec2(Tex0CoordEmission)) * uMaterialEmission;\n"
|
||||
"#else\n"
|
||||
" color = uMaterialEmission;\n"
|
||||
"#endif //EMISSION_TEXTURE\n"
|
||||
|
@ -1167,10 +1245,16 @@ static const char shadow_map_frag_glsl[] =
|
|||
"#ifdef DIFFUSE\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
"uniform sampler2D uTextureDiffuse0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse0;\n"
|
||||
"vec3 Tex0CoordDiffuse =\n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse0;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureDiffuse1;\n"
|
||||
"uniform float uTextureDiffuseWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse1;\n"
|
||||
"vec3 Tex1CoordDiffuse =\n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse1;\n"
|
||||
"#endif //DIFFUSE_TEXTURE_BLEND\n"
|
||||
"#endif //DIFFUSE\n"
|
||||
"#endif //ALPHA_TEST_ENABLED\n"
|
||||
|
@ -1180,12 +1264,12 @@ static const char shadow_map_frag_glsl[] =
|
|||
"#endif\n"
|
||||
"#ifdef ALPHA_TEST_ENABLED\n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
" gl_FragColor = (texture2D(uTextureDiffuse0, vTexCoord) *\n"
|
||||
" uTextureDiffuseWeight + texture2D(uTextureDiffuse1, vTexCoord) *\n"
|
||||
" gl_FragColor = (texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)) *\n"
|
||||
" uTextureDiffuseWeight + texture2D(uTextureDiffuse1, vec2(Tex1CoordDiffuse)) *\n"
|
||||
" (1.0 - uTextureDiffuseWeight));\n"
|
||||
"#else\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
" gl_FragColor = texture2D(uTextureDiffuse0, vTexCoord) ;\n"
|
||||
" gl_FragColor = texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)) ;\n"
|
||||
"#else\n"
|
||||
" gl_FragColor = vec4(1);\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
|
@ -1361,10 +1445,13 @@ static const char parallax_occlusion_frag_glsl[] =
|
|||
"#endif\n"
|
||||
"varying vec3 vLightVector;\n"
|
||||
"varying vec3 vLightHalfVector;\n"
|
||||
"uniform sampler2D uTextureNormal0;\n"
|
||||
"varying vec3 vEyeVector;\n"
|
||||
"uniform sampler2D uTextureNormal0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformNormal0;\n"
|
||||
"#ifdef NEED_TEX_COORD\n"
|
||||
"varying vec2 vTexCoord;\n"
|
||||
"vec3 Tex0CoordNormal = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformNormal0;\n"
|
||||
"#endif //TEX_COORD\n"
|
||||
"#ifdef FOG_ENABLED\n"
|
||||
"uniform float uFogFactor;\n"
|
||||
|
@ -1381,23 +1468,32 @@ static const char parallax_occlusion_frag_glsl[] =
|
|||
" shadow = 0.0;\n"
|
||||
" for (i = -4.0; i < 4.0; i++)\n"
|
||||
" for (j = -4.0; j < 4.0; j++)\n"
|
||||
" shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0)*size).x);\n"
|
||||
" shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0) * size).x);\n"
|
||||
" return shadow / 64.0;\n"
|
||||
"}\n"
|
||||
"#endif //SHADOWED\n"
|
||||
"#ifdef NORMAL_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureNormal1;\n"
|
||||
"uniform float uTextureNormalWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformNormal1;\n"
|
||||
"vec3 Tex1CoordNormal = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformNormal1;\n"
|
||||
"#endif //NORMAL_TEXTURE_BLEND\n"
|
||||
"#ifdef DIFFUSE\n"
|
||||
"uniform vec4 uMaterialDiffuse;\n"
|
||||
"uniform vec4 uLightDiffuse;\n"
|
||||
"#ifdef DIFFUSE_TEXTURE\n"
|
||||
"uniform sampler2D uTextureDiffuse0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse0;\n"
|
||||
"vec3 Tex0CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse0;\n"
|
||||
"#endif //DIFFUSE_TEXTURE\n"
|
||||
"#ifdef DIFFUSE_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureDiffuse1;\n"
|
||||
"uniform float uTextureDiffuseWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformDiffuse1;\n"
|
||||
"vec3 Tex1CoordDiffuse = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse1;\n"
|
||||
"#endif //DIFFUSE_TEXTURE_BLEND\n"
|
||||
"#endif //DIFFUSE\n"
|
||||
"#ifdef SPECULAR\n"
|
||||
|
@ -1406,10 +1502,16 @@ static const char parallax_occlusion_frag_glsl[] =
|
|||
"uniform vec4 uMaterialSpecular;\n"
|
||||
"#ifdef SPECULAR_TEXTURE\n"
|
||||
"uniform sampler2D uTextureSpecular0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformSpecular0;\n"
|
||||
"vec3 Tex0CoordSpecular = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformSpecular0;\n"
|
||||
"#endif //SPECULAR_TEXTURE\n"
|
||||
"#ifdef SPECULAR_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureSpecular1;\n"
|
||||
"uniform float uTextureSpecularWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformSpecular1;\n"
|
||||
"vec3 Tex1CoordSpecular = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformSpecular1;\n"
|
||||
"#endif //SPECULAR_TEXTURE_BLEND\n"
|
||||
"#endif //SPECULAR\n"
|
||||
"#ifdef AMBIENT\n"
|
||||
|
@ -1417,20 +1519,32 @@ static const char parallax_occlusion_frag_glsl[] =
|
|||
"uniform vec4 uLightAmbient;\n"
|
||||
"#ifdef AMBIENT_TEXTURE\n"
|
||||
"uniform sampler2D uTextureAmbient0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformAmbient0;\n"
|
||||
"vec3 Tex0CoordAmbient = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformAmbient0;\n"
|
||||
"#endif //AMBIENT_TEXTURE\n"
|
||||
"#ifdef AMBIENT_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureAmbient1;\n"
|
||||
"uniform float uTextureAmbientWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformAmbient1;\n"
|
||||
"vec3 Tex1CoordAmbient = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformAmbient1;\n"
|
||||
"#endif //AMBIENT_TEXTURE_BLEND\n"
|
||||
"#endif //AMBIENT\n"
|
||||
"#ifdef EMISSION\n"
|
||||
"uniform vec4 uMaterialEmission;\n"
|
||||
"#ifdef EMISSION_TEXTURE\n"
|
||||
"uniform sampler2D uTextureEmission0;\n"
|
||||
"uniform mat3 uTextureMatrixTransformEmission0;\n"
|
||||
"vec3 Tex0CoordEmission = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformEmission0;\n"
|
||||
"#endif //EMISSION_TEXTURE\n"
|
||||
"#ifdef EMISSION_TEXTURE_BLEND\n"
|
||||
"uniform sampler2D uTextureEmission1;\n"
|
||||
"uniform float uTextureEmissionWeight;\n"
|
||||
"uniform mat3 uTextureMatrixTransformEmission1;\n"
|
||||
"vec3 Tex1CoordEmission = \n"
|
||||
" vec3(vTexCoord, 1.0) * uTextureMatrixTransformEmission1;\n"
|
||||
"#endif //EMISSION_TEXTURE_BLEND\n"
|
||||
"#endif //EMISSION\n"
|
||||
"#ifdef LIGHT_SPOT\n"
|
||||
|
@ -1451,8 +1565,8 @@ static const char parallax_occlusion_frag_glsl[] =
|
|||
" vec2 dtex = parallaxScale * view.xy / view.z / numLayers;\n"
|
||||
" vec2 currentTextureCoords = tex;\n"
|
||||
"#ifdef NORMAL_TEXTURE_BLEND\n"
|
||||
" float heightFromTexture = (1.0 - texture2D(uTextureNormal0, currentTextureCoords).a) * uTextureNormalWeight;\n"
|
||||
" heightFromTexture += (1.0 - texture2D(uTextureNormal1, currentTextureCoords).a) *\n"
|
||||
" float heightFromTexture = (1.0 - texture2D(uTextureNormal0, vec2(Tex0CoordNormal)).a) * uTextureNormalWeight;\n"
|
||||
" heightFromTexture += (1.0 - texture2D(uTextureNormal1, vec2(Tex1CoordNormal)).a) *\n"
|
||||
" (1.0 - uTextureNormalWeight);\n"
|
||||
"#else\n"
|
||||
" float heightFromTexture = 1.0 - texture2D(uTextureNormal0, currentTextureCoords).a;\n"
|
||||
|
@ -1491,7 +1605,7 @@ static const char parallax_occlusion_frag_glsl[] =
|
|||
" vec3 normal;\n"
|
||||
" vec4 color;\n"
|
||||
" float parallaxHeight;\n"
|
||||
" vec2 tex = parallaxMapping(vEyeVector, vTexCoord, parallaxHeight);\n"
|
||||
" vec2 tex = parallaxMapping(vEyeVector, vec2(Tex0CoordNormal), parallaxHeight);\n"
|
||||
" vec3 lv = normalize(vLightVector);\n"
|
||||
"#ifdef NORMAL_TEXTURE_BLEND\n"
|
||||
" normal = texture2D(uTextureNormal0, tex).rgb * uTextureNormalWeight / texture2D(uTextureNormal0, tex).a;\n"
|
||||
|
|
|
@ -12,10 +12,16 @@ varying vec2 vTexCoord;
|
|||
define(`FRAGMENT_SHADER_USE_TEXTURE', `
|
||||
#ifdef $1_TEXTURE
|
||||
uniform sampler2D uTexture$2`0';
|
||||
uniform mat3 uTextureMatrixTransform$2`0';
|
||||
vec3 Tex0Coord$2 =
|
||||
vec3(vTexCoord, 1.0) * uTextureMatrixTransform$2`0';
|
||||
#endif //$1_TEXTURE
|
||||
#ifdef $1_TEXTURE_BLEND
|
||||
uniform sampler2D uTexture$2`1';
|
||||
uniform float uTexture$2Weight;
|
||||
uniform mat3 uTextureMatrixTransform$2`1';
|
||||
vec3 Tex1Coord$2 =
|
||||
vec3(vTexCoord, 1.0) * uTextureMatrixTransform$2`1';
|
||||
#endif //$1_TEXTURE_BLEND')
|
||||
|
||||
define(`FRAGMENT_SHADER_USE_FOG', `
|
||||
|
@ -36,7 +42,7 @@ float pcf(vec4 lpos, float size)
|
|||
shadow = 0.0;
|
||||
for (i = -4.0; i < 4.0; i++)
|
||||
for (j = -4.0; j < 4.0; j++)
|
||||
shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0)*size).x);
|
||||
shadow += float(smcoord.z <= texture2D(uShadowMap, smcoord.xy + vec2(i / 8.0, j / 8.0) * size).x);
|
||||
return shadow / 64.0;
|
||||
}
|
||||
#endif //SHADOWED')
|
||||
|
@ -61,12 +67,12 @@ varying float vLightDist;
|
|||
|
||||
define(`FRAGMENT_SHADER_TEXTURE_BLEND', `
|
||||
#ifdef $1_TEXTURE_BLEND
|
||||
color = mix(texture2D(uTexture$2`1', vTexCoord),
|
||||
texture2D(uTexture$2`0', vTexCoord), uTexture$2Weight);
|
||||
color = mix(texture2D(uTexture$2`1', vec2(Tex1Coord$2)),
|
||||
texture2D(uTexture$2`0', vec2(Tex0Coord$2)), uTexture$2Weight);
|
||||
color *= uMaterial$2;
|
||||
#else
|
||||
#ifdef $1_TEXTURE
|
||||
color = texture2D(uTexture$2`0', vTexCoord) * uMaterial$2;
|
||||
color = texture2D(uTexture$2`0', vec2(Tex0Coord$2)) * uMaterial$2;
|
||||
#else
|
||||
color = uMaterial$2;
|
||||
#endif //$1_TEXTURE
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
varying vec3 vLightVector;
|
||||
varying vec3 vLightHalfVector;
|
||||
uniform sampler2D uTextureNormal0;
|
||||
varying vec3 vEyeVector;
|
||||
uniform sampler2D uTextureNormal0;
|
||||
uniform mat3 uTextureMatrixTransformNormal0;
|
||||
|
||||
#ifdef NEED_TEX_COORD
|
||||
varying vec2 vTexCoord;
|
||||
vec3 Tex0CoordNormal =
|
||||
vec3(vTexCoord, 1.0) * uTextureMatrixTransformNormal0;
|
||||
#endif //TEX_COORD
|
||||
|
||||
FRAGMENT_SHADER_USE_FOG
|
||||
|
@ -13,6 +16,9 @@ FRAGMENT_SHADER_USE_SHADOWS
|
|||
#ifdef NORMAL_TEXTURE_BLEND
|
||||
uniform sampler2D uTextureNormal1;
|
||||
uniform float uTextureNormalWeight;
|
||||
uniform mat3 uTextureMatrixTransformNormal1;
|
||||
vec3 Tex1CoordNormal =
|
||||
vec3(vTexCoord, 1.0) * uTextureMatrixTransformNormal1;
|
||||
#endif //NORMAL_TEXTURE_BLEND
|
||||
|
||||
FRAGMENT_SHADER_USE_DIFFUSE_TERM
|
||||
|
@ -35,8 +41,8 @@ vec2 parallaxMapping(in vec3 view, in vec2 tex, out float parallaxHeight)
|
|||
vec2 currentTextureCoords = tex;
|
||||
|
||||
#ifdef NORMAL_TEXTURE_BLEND
|
||||
float heightFromTexture = (1.0 - texture2D(uTextureNormal0, currentTextureCoords).a) * uTextureNormalWeight;
|
||||
heightFromTexture += (1.0 - texture2D(uTextureNormal1, currentTextureCoords).a) *
|
||||
float heightFromTexture = (1.0 - texture2D(uTextureNormal0, vec2(Tex0CoordNormal)).a) * uTextureNormalWeight;
|
||||
heightFromTexture += (1.0 - texture2D(uTextureNormal1, vec2(Tex1CoordNormal)).a) *
|
||||
(1.0 - uTextureNormalWeight);
|
||||
#else
|
||||
float heightFromTexture = 1.0 - texture2D(uTextureNormal0, currentTextureCoords).a;
|
||||
|
@ -83,7 +89,7 @@ void fragmentParallaxMap()
|
|||
vec4 color;
|
||||
|
||||
float parallaxHeight;
|
||||
vec2 tex = parallaxMapping(vEyeVector, vTexCoord, parallaxHeight);
|
||||
vec2 tex = parallaxMapping(vEyeVector, vec2(Tex0CoordNormal), parallaxHeight);
|
||||
|
||||
vec3 lv = normalize(vLightVector);
|
||||
|
||||
|
|
|
@ -5,11 +5,17 @@ FRAGMENT_SHADER_USE_TEX_COORD
|
|||
|
||||
#ifdef DIFFUSE_TEXTURE
|
||||
uniform sampler2D uTextureDiffuse0;
|
||||
uniform mat3 uTextureMatrixTransformDiffuse0;
|
||||
vec3 Tex0CoordDiffuse =
|
||||
vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse0;
|
||||
#endif //DIFFUSE_TEXTURE
|
||||
|
||||
#ifdef DIFFUSE_TEXTURE_BLEND
|
||||
uniform sampler2D uTextureDiffuse1;
|
||||
uniform float uTextureDiffuseWeight;
|
||||
uniform mat3 uTextureMatrixTransformDiffuse1;
|
||||
vec3 Tex1CoordDiffuse =
|
||||
vec3(vTexCoord, 1.0) * uTextureMatrixTransformDiffuse1;
|
||||
#endif //DIFFUSE_TEXTURE_BLEND
|
||||
|
||||
#endif //DIFFUSE
|
||||
|
@ -23,13 +29,13 @@ void main() {
|
|||
#ifdef ALPHA_TEST_ENABLED
|
||||
|
||||
#ifdef DIFFUSE_TEXTURE_BLEND
|
||||
gl_FragColor = (texture2D(uTextureDiffuse0, vTexCoord) *
|
||||
uTextureDiffuseWeight + texture2D(uTextureDiffuse1, vTexCoord) *
|
||||
gl_FragColor = (texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)) *
|
||||
uTextureDiffuseWeight + texture2D(uTextureDiffuse1, vec2(Tex1CoordDiffuse)) *
|
||||
(1.0 - uTextureDiffuseWeight));
|
||||
#else
|
||||
|
||||
#ifdef DIFFUSE_TEXTURE
|
||||
gl_FragColor = texture2D(uTextureDiffuse0, vTexCoord) ;
|
||||
gl_FragColor = texture2D(uTextureDiffuse0, vec2(Tex0CoordDiffuse)) ;
|
||||
#else
|
||||
gl_FragColor = vec4(1);
|
||||
#endif //DIFFUSE_TEXTURE
|
||||
|
|
|
@ -2203,9 +2203,9 @@ eng_drawable_scene_render_to_texture(void *data, void *drawable, void *scene_dat
|
|||
}
|
||||
|
||||
static void *
|
||||
eng_texture_new(void *data EINA_UNUSED)
|
||||
eng_texture_new(void *data EINA_UNUSED, Eina_Bool use_atlas)
|
||||
{
|
||||
return e3d_texture_new();
|
||||
return e3d_texture_new(use_atlas);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2214,41 +2214,6 @@ eng_texture_free(void *data EINA_UNUSED, void *texture)
|
|||
e3d_texture_free((E3D_Texture *)texture);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_texture_data_set(void *data, void *texture, Evas_3D_Color_Format color_format,
|
||||
Evas_3D_Pixel_Format pixel_format, int w, int h, const void *pixels)
|
||||
{
|
||||
Evas_Engine_GL_Context *gl_context;
|
||||
Render_Engine_GL_Generic *re = data;
|
||||
|
||||
re->window_use(re->software.ob);
|
||||
gl_context = re->window_gl_context_get(re->software.ob);
|
||||
evas_gl_common_context_flush(gl_context);
|
||||
eng_context_3d_use(data);
|
||||
|
||||
e3d_texture_data_set((E3D_Texture *)texture, color_format, pixel_format, w, h, pixels);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_texture_file_set(void *data, void *texture, const char *file, const char *key)
|
||||
{
|
||||
Evas_Engine_GL_Context *gl_context;
|
||||
Render_Engine_GL_Generic *re = data;
|
||||
|
||||
re->window_use(re->software.ob);
|
||||
gl_context = re->window_gl_context_get(re->software.ob);
|
||||
evas_gl_common_context_flush(gl_context);
|
||||
eng_context_3d_use(data);
|
||||
|
||||
e3d_texture_file_set((E3D_Texture *)texture, file, key);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_texture_color_format_get(void *data EINA_UNUSED, void *texture, Evas_3D_Color_Format *format)
|
||||
{
|
||||
*format = e3d_texture_color_format_get((E3D_Texture *)texture);
|
||||
}
|
||||
|
||||
static void
|
||||
eng_texture_size_get(void *data EINA_UNUSED, void *texture, int *w, int *h)
|
||||
{
|
||||
|
@ -2284,10 +2249,21 @@ eng_texture_filter_get(void *data EINA_UNUSED, void *texture,
|
|||
}
|
||||
|
||||
static void
|
||||
eng_texture_image_set(void *data EINA_UNUSED, void *texture, void *image)
|
||||
eng_texture_image_set(void *data, void *texture, void *image)
|
||||
{
|
||||
Evas_GL_Image *im = (Evas_GL_Image *)image;
|
||||
e3d_texture_import((E3D_Texture *)texture, im->tex->pt->texture);
|
||||
Evas_Engine_GL_Context *gl_context;
|
||||
Render_Engine_GL_Generic *re = data;
|
||||
|
||||
re->window_use(re->software.ob);
|
||||
gl_context = re->window_gl_context_get(re->software.ob);
|
||||
|
||||
e3d_texture_set(gl_context, (E3D_Texture *)texture, (Evas_GL_Image *)image);
|
||||
}
|
||||
|
||||
static void *
|
||||
eng_texture_image_get(void *data EINA_UNUSED, void *texture)
|
||||
{
|
||||
return e3d_texture_get((E3D_Texture *)texture);
|
||||
}
|
||||
|
||||
static Ector_Surface *_software_ector = NULL;
|
||||
|
@ -2607,15 +2583,13 @@ module_open(Evas_Module *em)
|
|||
|
||||
ORD(texture_new);
|
||||
ORD(texture_free);
|
||||
ORD(texture_data_set);
|
||||
ORD(texture_file_set);
|
||||
ORD(texture_color_format_get);
|
||||
ORD(texture_size_get);
|
||||
ORD(texture_wrap_set);
|
||||
ORD(texture_wrap_get);
|
||||
ORD(texture_filter_set);
|
||||
ORD(texture_filter_get);
|
||||
ORD(texture_image_set);
|
||||
ORD(texture_image_get);
|
||||
|
||||
ORD(ector_get);
|
||||
ORD(ector_begin);
|
||||
|
|
|
@ -3917,15 +3917,13 @@ static Evas_Func func =
|
|||
NULL, // eng_drawable_texture_pixel_color_get
|
||||
NULL, // eng_texture_new
|
||||
NULL, // eng_texture_free
|
||||
NULL, // eng_texture_data_set
|
||||
NULL, // eng_texture_file_set
|
||||
NULL, // eng_texture_color_format_get
|
||||
NULL, // eng_texture_size_get
|
||||
NULL, // eng_texture_wrap_set
|
||||
NULL, // eng_texture_wrap_get
|
||||
NULL, // eng_texture_filter_set
|
||||
NULL, // eng_texture_filter_get
|
||||
NULL, // eng_texture_image_set
|
||||
NULL, // eng_texture_image_get
|
||||
eng_ector_get,
|
||||
eng_ector_begin,
|
||||
eng_ector_renderer_draw,
|
||||
|
|
Loading…
Reference in New Issue