forked from enlightenment/efl
Evas canvas3d: Move evas 3d types to evas_types.eot
Summary: Move evas_canvas3d types from Evas_Eo.h to evas_types.eot Change enum constatnt for vertex_arrtib, material_attrib, blend_func Correct namespace for Evas.Real type Reviewers: cedric, tasn Reviewed By: tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2734
This commit is contained in:
parent
086a501be6
commit
60b16be772
|
@ -10018,11 +10018,11 @@ st_collections_group_parts_part_description_properties_material(void)
|
||||||
check_arg_count(1);
|
check_arg_count(1);
|
||||||
|
|
||||||
material_attrib = parse_enum(0,
|
material_attrib = parse_enum(0,
|
||||||
"AMBIENT", EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
"AMBIENT", EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
"DIFFUSE", EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
"DIFFUSE", EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
"SPECULAR", EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
"SPECULAR", EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
"EMISSION", EVAS_CANVAS3D_MATERIAL_EMISSION,
|
"EMISSION", EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION,
|
||||||
"NORMAL", EVAS_CANVAS3D_MATERIAL_NORMAL,
|
"NORMAL", EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
|
if (current_part->type == EDJE_PART_TYPE_MESH_NODE)
|
||||||
|
|
|
@ -196,16 +196,16 @@ main(void)
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
||||||
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, texture),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
0.01, 0.01, 0.01, 1.0),
|
0.01, 0.01, 0.01, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
1.0, 1.0, 1.0, 1.0),
|
1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
1.0, 1.0, 1.0, 1.0),
|
1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ main(void)
|
||||||
evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
|
evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
|
||||||
|
|
||||||
material_box = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
material_box = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
eo_do(material_box, evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE));
|
eo_do(material_box, evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE));
|
||||||
|
|
||||||
cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
||||||
eo_do(cube,
|
eo_do(cube,
|
||||||
|
|
|
@ -22,35 +22,35 @@
|
||||||
static const char *blend_func_names[] =
|
static const char *blend_func_names[] =
|
||||||
{
|
{
|
||||||
/**< The scale factors for color components is (0, 0, 0, 0)*/
|
/**< The scale factors for color components is (0, 0, 0, 0)*/
|
||||||
"EVAS_CANVAS3D_BLEND_ZERO",
|
"EVAS_CANVAS3D_BLEND_FUNC_ZERO",
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1)*/
|
/**< The scale factors for color components is (1, 1, 1, 1)*/
|
||||||
"EVAS_CANVAS3D_BLEND_ONE",
|
"EVAS_CANVAS3D_BLEND_FUNC_ONE",
|
||||||
/**< The scale factors for color components is (Rs/kR, Gs/kG, Bs/kB, As/kA)*/
|
/**< The scale factors for color components is (Rs/kR, Gs/kG, Bs/kB, As/kA)*/
|
||||||
"EVAS_CANVAS3D_BLEND_SRC_COLOR",
|
"EVAS_CANVAS3D_BLEND_FUNC_SRC_COLOR",
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Rs/kR, Gs/kG, Bs/kB, As/kA)*/
|
/**< The scale factors for color components is (1, 1, 1, 1) - (Rs/kR, Gs/kG, Bs/kB, As/kA)*/
|
||||||
"EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_COLOR",
|
"EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_COLOR",
|
||||||
/**< The scale factors for color components is (Rd/kR, Gd/kG, Bd/kB, Ad/kA)*/
|
/**< The scale factors for color components is (Rd/kR, Gd/kG, Bd/kB, Ad/kA)*/
|
||||||
"EVAS_CANVAS3D_BLEND_DST_COLOR",
|
"EVAS_CANVAS3D_BLEND_FUNC_DST_COLOR",
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Rd/kR, Gd/kG, Bd/kB, Ad/kA)*/
|
/**< The scale factors for color components is (1, 1, 1, 1) - (Rd/kR, Gd/kG, Bd/kB, Ad/kA)*/
|
||||||
"EVAS_CANVAS3D_BLEND_ONE_MINUS_DST_COLOR",
|
"EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_DST_COLOR",
|
||||||
/**< The scale factors for color components is (As/kA, As/kA, As/kA, As/kA)*/
|
/**< The scale factors for color components is (As/kA, As/kA, As/kA, As/kA)*/
|
||||||
"EVAS_CANVAS3D_BLEND_SRC_ALPHA",
|
"EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA",
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (As/kA, As/kA, As/kA, As/kA)*/
|
/**< The scale factors for color components is (1, 1, 1, 1) - (As/kA, As/kA, As/kA, As/kA)*/
|
||||||
"EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_ALPHA",
|
"EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA",
|
||||||
/**< The scale factors for color components is (Ad/kA, Ad/kA, Ad/kA, Ad/kA)*/
|
/**< The scale factors for color components is (Ad/kA, Ad/kA, Ad/kA, Ad/kA)*/
|
||||||
"EVAS_CANVAS3D_BLEND_DST_ALPHA",
|
"EVAS_CANVAS3D_BLEND_FUNC_DST_ALPHA",
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Ad/kA, Ad/kA, Ad/kA, Ad/kA)*/
|
/**< The scale factors for color components is (1, 1, 1, 1) - (Ad/kA, Ad/kA, Ad/kA, Ad/kA)*/
|
||||||
"EVAS_CANVAS3D_BLEND_ONE_MINUS_DST_ALPHA",
|
"EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_DST_ALPHA",
|
||||||
/**< The scale factors for color components is (Rc, Gc, Bc, Ac)*/
|
/**< The scale factors for color components is (Rc, Gc, Bc, Ac)*/
|
||||||
"EVAS_CANVAS3D_BLEND_CONSTANT_COLOR",
|
"EVAS_CANVAS3D_BLEND_FUNC_CONSTANT_COLOR",
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Rc, Gc, Bc, Ac)*/
|
/**< The scale factors for color components is (1, 1, 1, 1) - (Rc, Gc, Bc, Ac)*/
|
||||||
"EVAS_CANVAS3D_BLEND_ONE_MINUS_CONSTANT_COLOR",
|
"EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_CONSTANT_COLOR",
|
||||||
/**< The scale factors for color components is (Ac, Ac, Ac, Ac)*/
|
/**< The scale factors for color components is (Ac, Ac, Ac, Ac)*/
|
||||||
"EVAS_CANVAS3D_BLEND_CONSTANT_ALPHA",
|
"EVAS_CANVAS3D_BLEND_FUNC_CONSTANT_ALPHA",
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Ac, Ac, Ac, Ac)*/
|
/**< The scale factors for color components is (1, 1, 1, 1) - (Ac, Ac, Ac, Ac)*/
|
||||||
"EVAS_CANVAS3D_BLEND_ONE_MINUS_CONSTANT_ALPHA",
|
"EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_CONSTANT_ALPHA",
|
||||||
/**< The scale factors for color components is (i, i, i, 1) where i = min(As, kA, Ad)/kA*/
|
/**< The scale factors for color components is (i, i, i, 1) where i = min(As, kA, Ad)/kA*/
|
||||||
"EVAS_CANVAS3D_BLEND_SRC_ALPHA_SATURATE",
|
"EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE",
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _Scene_Data
|
typedef struct _Scene_Data
|
||||||
|
@ -75,8 +75,8 @@ Evas *evas = NULL;
|
||||||
Eo *background = NULL;
|
Eo *background = NULL;
|
||||||
Eo *image = NULL;
|
Eo *image = NULL;
|
||||||
|
|
||||||
int func1 = EVAS_CANVAS3D_BLEND_SRC_ALPHA;
|
int func1 = EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA;
|
||||||
int func2 = EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_ALPHA;
|
int func2 = EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void *event_info)
|
_on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void *event_info)
|
||||||
|
@ -93,15 +93,15 @@ _on_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *eo EINA_UNUSED, void
|
||||||
if (!strcmp("Right", ev->key))
|
if (!strcmp("Right", ev->key))
|
||||||
func2--;
|
func2--;
|
||||||
|
|
||||||
if(func1 < EVAS_CANVAS3D_BLEND_ZERO)
|
if(func1 < EVAS_CANVAS3D_BLEND_FUNC_ZERO)
|
||||||
func1 = EVAS_CANVAS3D_BLEND_SRC_ALPHA_SATURATE;
|
func1 = EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE;
|
||||||
if(func1 > EVAS_CANVAS3D_BLEND_SRC_ALPHA_SATURATE)
|
if(func1 > EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE)
|
||||||
func1 = EVAS_CANVAS3D_BLEND_ZERO;
|
func1 = EVAS_CANVAS3D_BLEND_FUNC_ZERO;
|
||||||
|
|
||||||
if(func2 < EVAS_CANVAS3D_BLEND_ZERO)
|
if(func2 < EVAS_CANVAS3D_BLEND_FUNC_ZERO)
|
||||||
func2 = EVAS_CANVAS3D_BLEND_SRC_ALPHA_SATURATE;
|
func2 = EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE;
|
||||||
if(func2 > EVAS_CANVAS3D_BLEND_SRC_ALPHA_SATURATE)
|
if(func2 > EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE)
|
||||||
func2 = EVAS_CANVAS3D_BLEND_ZERO;
|
func2 = EVAS_CANVAS3D_BLEND_FUNC_ZERO;
|
||||||
eo_do(scene->mesh1, evas_canvas3d_mesh_blending_func_set(func1, func2));
|
eo_do(scene->mesh1, evas_canvas3d_mesh_blending_func_set(func1, func2));
|
||||||
printf("sfactor = %s, dfactor = %s\n", blend_func_names[func1], blend_func_names[func2]);
|
printf("sfactor = %s, dfactor = %s\n", blend_func_names[func1], blend_func_names[func2]);
|
||||||
}
|
}
|
||||||
|
@ -197,25 +197,25 @@ _mesh_setup(Scene_Data *data)
|
||||||
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(data->material,
|
eo_do(data->material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 1.0, 0.2, 0.2, 0.2),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 0.2, 0.2, 0.2),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 1.0, 0.0, 0.0, 0.2),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 0.0, 0.0, 0.2),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 0.2),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(data->material1,
|
eo_do(data->material1,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.0, 0.2, 0.2, 0.2),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.0, 0.2, 0.2, 0.2),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.0, 0.0, 1.0, 0.2),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.0, 0.0, 1.0, 0.2),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 0.2),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 0.2),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
||||||
|
|
|
@ -263,16 +263,16 @@ _init_sphere(void *this, const char *texture)
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
||||||
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
||||||
eo_do(sphere->material,
|
eo_do(sphere->material,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, sphere->texture),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, sphere->texture),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
0.01, 0.01, 0.01, 1.0),
|
0.01, 0.01, 0.01, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
1.0, 1.0, 1.0, 1.0),
|
1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
1.0, 1.0, 1.0, 1.0),
|
1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
|
@ -191,12 +191,12 @@ _mesh_setup(Scene_Data *data)
|
||||||
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(data->material,
|
eo_do(data->material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
/* Setup primitive */
|
/* Setup primitive */
|
||||||
|
|
|
@ -176,13 +176,13 @@ _mesh_setup(Scene_Data *data)
|
||||||
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(data->material,
|
eo_do(data->material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
/* Setup mesh. */
|
/* Setup mesh. */
|
||||||
|
@ -191,13 +191,13 @@ _mesh_setup(Scene_Data *data)
|
||||||
evas_canvas3d_mesh_vertex_count_set(24),
|
evas_canvas3d_mesh_vertex_count_set(24),
|
||||||
evas_canvas3d_mesh_frame_add(0),
|
evas_canvas3d_mesh_frame_add(0),
|
||||||
|
|
||||||
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_POSITION,
|
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION,
|
||||||
12 * sizeof(float), &cube_vertices[ 0]),
|
12 * sizeof(float), &cube_vertices[ 0]),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_NORMAL,
|
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL,
|
||||||
12 * sizeof(float), &cube_vertices[ 3]),
|
12 * sizeof(float), &cube_vertices[ 3]),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_COLOR,
|
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR,
|
||||||
12 * sizeof(float), &cube_vertices[ 6]),
|
12 * sizeof(float), &cube_vertices[ 6]),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_TEXCOORD,
|
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD,
|
||||||
12 * sizeof(float), &cube_vertices[10]),
|
12 * sizeof(float), &cube_vertices[10]),
|
||||||
|
|
||||||
evas_canvas3d_mesh_index_data_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT,
|
evas_canvas3d_mesh_index_data_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT,
|
||||||
|
|
|
@ -156,25 +156,25 @@ _mesh_setup(Scene_Data *data)
|
||||||
data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material1 = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(data->material0,
|
eo_do(data->material0,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
eo_do(data->material1,
|
eo_do(data->material1,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
data->texture0 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
|
data->texture0 = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas);
|
||||||
|
@ -189,11 +189,11 @@ _mesh_setup(Scene_Data *data)
|
||||||
evas_canvas3d_texture_file_set(normal_map_path, NULL));
|
evas_canvas3d_texture_file_set(normal_map_path, NULL));
|
||||||
|
|
||||||
eo_do(data->material0,
|
eo_do(data->material0,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, data->texture0));
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture0));
|
||||||
eo_do(data->material1,
|
eo_do(data->material1,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, data->texture1));
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture1));
|
||||||
eo_do(data->material1,
|
eo_do(data->material1,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_NORMAL, data->texture_normal));
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_normal));
|
||||||
|
|
||||||
/* Set data of primitive */
|
/* Set data of primitive */
|
||||||
data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
||||||
|
|
|
@ -166,15 +166,15 @@ main(void)
|
||||||
evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
|
evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_PHONG));
|
||||||
|
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
0.50, 0.50, 0.00, 0.30),
|
0.50, 0.50, 0.00, 0.30),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
0.00, 0.50, 0.50, 0.30),
|
0.00, 0.50, 0.50, 0.30),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
0.50, 0.00, 0.50, 0.30),
|
0.50, 0.00, 0.50, 0.30),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
|
|
||||||
|
|
|
@ -136,13 +136,13 @@ _mesh_setup(Scene_Data *data)
|
||||||
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(data->material,
|
eo_do(data->material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
data->sphere = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
||||||
|
|
|
@ -334,13 +334,13 @@ _mesh_setup(Scene_Data *data)
|
||||||
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(data->material,
|
eo_do(data->material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
||||||
|
@ -385,15 +385,15 @@ _mesh_setup_model(Scene_Data *data)
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
||||||
|
|
||||||
eo_do(data->material_model,
|
eo_do(data->material_model,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE);
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE);
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.01, 0.01, 0.01, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_texture_set( EVAS_CANVAS3D_MATERIAL_DIFFUSE, data->texture_model),
|
evas_canvas3d_material_texture_set( EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_model),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
eo_do(data->mesh_model,
|
eo_do(data->mesh_model,
|
||||||
|
|
|
@ -149,16 +149,16 @@ main(void)
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
||||||
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, texture),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
0.01, 0.01, 0.01, 1.0),
|
0.01, 0.01, 0.01, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
1.0, 1.0, 1.0, 1.0),
|
1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
1.0, 1.0, 1.0, 1.0),
|
1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
|
|
||||||
|
|
|
@ -231,15 +231,15 @@ main(void)
|
||||||
material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
0.01, 0.01, 0.01, 1.0),
|
0.01, 0.01, 0.01, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
1.0, 1.0, 0.0, 1.0),
|
1.0, 1.0, 0.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
0.5, 0.0, 1.0, 1.0),
|
0.5, 0.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
|
|
||||||
|
|
|
@ -78,15 +78,15 @@
|
||||||
#define ADD_MATERIAL(name) \
|
#define ADD_MATERIAL(name) \
|
||||||
name = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); \
|
name = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); \
|
||||||
eo_do(name, \
|
eo_do(name, \
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE), \
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), \
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE), \
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), \
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),\
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),\
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE), \
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), \
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, \
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, \
|
||||||
COL_RED, 0.5), \
|
COL_RED, 0.5), \
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, \
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, \
|
||||||
COL_GREEN, 0.5), \
|
COL_GREEN, 0.5), \
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, \
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, \
|
||||||
COL_BLUE, 0.5), \
|
COL_BLUE, 0.5), \
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ main(void)
|
||||||
|
|
||||||
ADD_MATERIAL(material_with_tex)
|
ADD_MATERIAL(material_with_tex)
|
||||||
eo_do(material_with_tex,
|
eo_do(material_with_tex,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, texture));
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture));
|
||||||
|
|
||||||
if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES))
|
if (!ecore_file_mkpath(PACKAGE_EXAMPLES_DIR EVAS_SAVED_FILES))
|
||||||
fprintf(stderr, "Failed to create folder %s\n\n",
|
fprintf(stderr, "Failed to create folder %s\n\n",
|
||||||
|
|
|
@ -155,18 +155,18 @@ _mesh_setup(Scene_Data *data)
|
||||||
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
||||||
|
|
||||||
eo_do(data->material_rocks,
|
eo_do(data->material_rocks,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_NORMAL, data->texture_rocks_n),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_rocks_n),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, data->texture_rocks),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_rocks),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, data->texture_rocks),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, data->texture_rocks),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, data->texture_rocks),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, data->texture_rocks),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.1, 0.1, 0.1, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.1, 0.1, 0.1, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
data->material_wood = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material_wood = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
@ -181,18 +181,18 @@ _mesh_setup(Scene_Data *data)
|
||||||
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
||||||
|
|
||||||
eo_do(data->material_wood,
|
eo_do(data->material_wood,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_NORMAL, data->texture_four_n),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, data->texture_four_n),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, data->texture_wood),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture_wood),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, data->texture_wood),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, data->texture_wood),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, data->texture_wood),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, data->texture_wood),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.1, 0.1, 0.1, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.1, 0.1, 0.1, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
/* Set data of primitive */
|
/* Set data of primitive */
|
||||||
|
|
|
@ -170,17 +170,17 @@ main(void)
|
||||||
evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
|
evas_canvas3d_texture_filter_set(EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
|
||||||
EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR));
|
EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR));
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
texture_diffuse),
|
texture_diffuse),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.01, 0.01, 0.01,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.01, 0.01, 0.01,
|
||||||
1.0),
|
1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 1.0, 1.0, 1.0,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0,
|
||||||
1.0),
|
1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0,
|
||||||
1.0),
|
1.0),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
|
|
||||||
|
|
|
@ -171,16 +171,16 @@ main(void)
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
||||||
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, texture),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
0.01, 0.01, 0.01, 1.0),
|
0.01, 0.01, 0.01, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
1.0, 1.0, 1.0, 1.0),
|
1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
1.0, 1.0, 1.0, 1.0),
|
1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
|
|
||||||
|
|
|
@ -148,16 +148,16 @@ _mesh_setup(Scene_Data *data)
|
||||||
evas_canvas3d_texture_source_visible_set(EINA_TRUE));
|
evas_canvas3d_texture_source_visible_set(EINA_TRUE));
|
||||||
|
|
||||||
eo_do(data->material,
|
eo_do(data->material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.2, 0.2, 0.2, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0),
|
evas_canvas3d_material_shininess_set(100.0),
|
||||||
|
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, data->texture));
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->texture));
|
||||||
|
|
||||||
/* Set data of primitive */
|
/* Set data of primitive */
|
||||||
data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
data->cube = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
||||||
|
|
|
@ -182,13 +182,13 @@ _body_material_set(Body_3D *body, float r, float g, float b)
|
||||||
body->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
body->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(body->material,
|
eo_do(body->material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
|
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, r, g, b, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, r, g, b, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, r, g, b, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, r, g, b, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
eo_do(body->mesh,
|
eo_do(body->mesh,
|
||||||
|
@ -283,16 +283,16 @@ _fence_setup(Body_3D *fence)
|
||||||
fence->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
fence->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(fence->material,
|
eo_do(fence->material,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, texture),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, texture),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, texture),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, texture),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_NORMAL, texture1),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, texture1),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
fence->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
fence->primitive = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, evas);
|
||||||
|
@ -374,11 +374,11 @@ _model_setup(Body_3D *model)
|
||||||
model->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
model->material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(model->material,
|
eo_do(model->material,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, model->texture),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, model->texture),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, model->texture),
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, model->texture),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_shininess_set(100.0));
|
evas_canvas3d_material_shininess_set(100.0));
|
||||||
|
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ _billboard_setup(Scene_Data *data)
|
||||||
_body_material_set(&(data->billboard), 1.0, 1.0, 1.0);
|
_body_material_set(&(data->billboard), 1.0, 1.0, 1.0);
|
||||||
|
|
||||||
eo_do(data->billboard.material,
|
eo_do(data->billboard.material,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, data->billboard.texture));
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, data->billboard.texture));
|
||||||
|
|
||||||
eo_do(data->billboard.mesh,
|
eo_do(data->billboard.mesh,
|
||||||
evas_canvas3d_mesh_frame_material_set(0, data->billboard.material),
|
evas_canvas3d_mesh_frame_material_set(0, data->billboard.material),
|
||||||
|
@ -426,8 +426,8 @@ _billboard_setup(Scene_Data *data)
|
||||||
evas_canvas3d_mesh_alpha_test_enable_set(EINA_TRUE),
|
evas_canvas3d_mesh_alpha_test_enable_set(EINA_TRUE),
|
||||||
evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE),
|
evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE),
|
||||||
evas_canvas3d_mesh_blending_enable_set(EINA_TRUE),
|
evas_canvas3d_mesh_blending_enable_set(EINA_TRUE),
|
||||||
evas_canvas3d_mesh_blending_func_set(EVAS_CANVAS3D_BLEND_SRC_ALPHA,
|
evas_canvas3d_mesh_blending_func_set(EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA,
|
||||||
EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_ALPHA));
|
EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA));
|
||||||
|
|
||||||
data->billboard.node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
|
data->billboard.node = eo_add(EVAS_CANVAS3D_NODE_CLASS, evas,
|
||||||
evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
|
evas_canvas3d_node_constructor(EVAS_CANVAS3D_NODE_TYPE_MESH));
|
||||||
|
|
|
@ -153,7 +153,7 @@ Eina_Bool _mesh_aabb(Evas_Canvas3D_Mesh **mesh, Scene_Data *scene, int index)
|
||||||
{
|
{
|
||||||
eo_do(*mesh,
|
eo_do(*mesh,
|
||||||
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES),
|
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_POSITION, 6 * sizeof(float), &vertixes[ 0]),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 6 * sizeof(float), &vertixes[ 0]),
|
||||||
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, 48, &indixes[0]));
|
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, 48, &indixes[0]));
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -366,9 +366,9 @@ _set_ball(Eo *mesh, int p)
|
||||||
|
|
||||||
eo_do(mesh, evas_canvas3d_mesh_vertex_count_set(vcount),
|
eo_do(mesh, evas_canvas3d_mesh_vertex_count_set(vcount),
|
||||||
evas_canvas3d_mesh_frame_add(0);
|
evas_canvas3d_mesh_frame_add(0);
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_POSITION,
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION,
|
||||||
sizeof(vec3), &vertices[0]);
|
sizeof(vec3), &vertices[0]);
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_NORMAL,
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL,
|
||||||
sizeof(vec3), &normals[0]);
|
sizeof(vec3), &normals[0]);
|
||||||
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT,
|
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT,
|
||||||
icount , &indices[0]));
|
icount , &indices[0]));
|
||||||
|
|
|
@ -130,13 +130,13 @@ typedef struct _vec2
|
||||||
data->material_##Object = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); \
|
data->material_##Object = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas); \
|
||||||
\
|
\
|
||||||
eo_do(data->material_##Object, \
|
eo_do(data->material_##Object, \
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE), \
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE), \
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE), \
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE), \
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE), \
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE), \
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE), \
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE), \
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, a, a, a, 1.0), \
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, a, a, a, 1.0), \
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, d, d, d, 1.0), \
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, d, d, d, 1.0), \
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, s, s, s, 1.0), \
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, s, s, s, 1.0), \
|
||||||
evas_canvas3d_material_shininess_set(50.0)); \
|
evas_canvas3d_material_shininess_set(50.0)); \
|
||||||
\
|
\
|
||||||
data->mesh_##Name = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
|
data->mesh_##Name = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
|
||||||
|
@ -171,18 +171,17 @@ typedef struct _vec2
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT)); \
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT)); \
|
||||||
\
|
\
|
||||||
eo_do(data->material_##Object, \
|
eo_do(data->material_##Object, \
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, \
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, \
|
||||||
data->texture_diffuse_##Object), \
|
data->texture_diffuse_##Object), \
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, \
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, \
|
||||||
data->texture_diffuse_##Object));
|
data->texture_diffuse_##Object));
|
||||||
|
|
||||||
|
|
||||||
#define CUBE_TEXTURE_SET(Object, Name, vertex, image) \
|
#define CUBE_TEXTURE_SET(Object, Name, vertex, image) \
|
||||||
eo_do(data->mesh_##Name, \
|
eo_do(data->mesh_##Name, \
|
||||||
evas_canvas3d_mesh_from_primitive_set(0, data->cube_primitive), \
|
evas_canvas3d_mesh_from_primitive_set(0, data->cube_primitive), \
|
||||||
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_TEXCOORD, \
|
evas_canvas3d_mesh_frame_vertex_data_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, \
|
||||||
2 * sizeof(float), vertex)); \
|
2 * sizeof(float), vertex)); \
|
||||||
\
|
|
||||||
SETUP_DEFAULT_MESH(Object, Name, NORMAL_MAP) \
|
SETUP_DEFAULT_MESH(Object, Name, NORMAL_MAP) \
|
||||||
data->texture_diffuse_##Object = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
|
data->texture_diffuse_##Object = eo_add(EVAS_CANVAS3D_TEXTURE_CLASS, evas); \
|
||||||
\
|
\
|
||||||
|
@ -194,9 +193,9 @@ typedef struct _vec2
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT)); \
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT)); \
|
||||||
\
|
\
|
||||||
eo_do(data->material_##Object, \
|
eo_do(data->material_##Object, \
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, \
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, \
|
||||||
data->texture_diffuse_##Object), \
|
data->texture_diffuse_##Object), \
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, \
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, \
|
||||||
data->texture_diffuse_##Object));
|
data->texture_diffuse_##Object));
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +210,7 @@ typedef struct _vec2
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT)); \
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT)); \
|
||||||
\
|
\
|
||||||
eo_do(data->material_##Object, \
|
eo_do(data->material_##Object, \
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_NORMAL, \
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, \
|
||||||
data->texture_normal_##Object)); \
|
data->texture_normal_##Object)); \
|
||||||
\
|
\
|
||||||
eo_do(data->mesh_##Name, \
|
eo_do(data->mesh_##Name, \
|
||||||
|
|
|
@ -138,7 +138,7 @@ _key_down(void *data,
|
||||||
evas_canvas3d_texture_file_set(gazebo_t_trans_path, NULL));
|
evas_canvas3d_texture_file_set(gazebo_t_trans_path, NULL));
|
||||||
eo_do(scene->mesh_carpet,
|
eo_do(scene->mesh_carpet,
|
||||||
evas_canvas3d_mesh_blending_enable_set(EINA_TRUE),
|
evas_canvas3d_mesh_blending_enable_set(EINA_TRUE),
|
||||||
evas_canvas3d_mesh_blending_func_set(EVAS_CANVAS3D_BLEND_SRC_ALPHA, EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_ALPHA));
|
evas_canvas3d_mesh_blending_func_set(EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -537,9 +537,9 @@ _animate_scene_gun(void *data)
|
||||||
{
|
{
|
||||||
_scale(scene->mesh_node_rocket[i], 0.4);
|
_scale(scene->mesh_node_rocket[i], 0.4);
|
||||||
eo_do(scene->material_rocket[i],
|
eo_do(scene->material_rocket[i],
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.2, 0.2, 0.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.2, 0.2, 0.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 0.5, 0.5, 0.5, 1.0));
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.5, 0.5, 0.5, 1.0));
|
||||||
|
|
||||||
rocket_indicator[i] = 2;
|
rocket_indicator[i] = 2;
|
||||||
|
|
||||||
|
@ -576,9 +576,9 @@ _animate_scene_gun(void *data)
|
||||||
((z * cosinus - x * sinus + z1) >= boxy.p0.z) && ((z * cosinus - x * sinus + z1) <= boxy.p1.z))
|
((z * cosinus - x * sinus + z1) >= boxy.p0.z) && ((z * cosinus - x * sinus + z1) <= boxy.p1.z))
|
||||||
{
|
{
|
||||||
eo_do(scene->material_rocket[i],
|
eo_do(scene->material_rocket[i],
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.8, 0.8, 0.8, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.8, 0.8, 0.8, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.9, 0.1, 0.1, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.9, 0.1, 0.1, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 0.5, 0.5, 0.5, 1.0));
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0.5, 0.5, 0.5, 1.0));
|
||||||
|
|
||||||
_scale(scene->mesh_node_rocket[i], 4.5);
|
_scale(scene->mesh_node_rocket[i], 4.5);
|
||||||
rocket_indicator[i] = 3;
|
rocket_indicator[i] = 3;
|
||||||
|
@ -842,7 +842,7 @@ _mesh_setup_gun_planet(Scene_Data *data)
|
||||||
evas_canvas3d_texture_file_set(gazebo_t_trans_path, NULL));
|
evas_canvas3d_texture_file_set(gazebo_t_trans_path, NULL));
|
||||||
eo_do(data->mesh_carpet,
|
eo_do(data->mesh_carpet,
|
||||||
evas_canvas3d_mesh_blending_enable_set(EINA_TRUE),
|
evas_canvas3d_mesh_blending_enable_set(EINA_TRUE),
|
||||||
evas_canvas3d_mesh_blending_func_set(EVAS_CANVAS3D_BLEND_SRC_ALPHA, EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_ALPHA));
|
evas_canvas3d_mesh_blending_func_set(EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA, EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA));
|
||||||
}
|
}
|
||||||
|
|
||||||
eo_do(data->mesh_node_carpet,
|
eo_do(data->mesh_node_carpet,
|
||||||
|
@ -886,12 +886,12 @@ _mesh_setup_gun_planet(Scene_Data *data)
|
||||||
/* Setup mesh for bounding sphere */
|
/* Setup mesh for bounding sphere */
|
||||||
data->material_ball = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material_ball = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
eo_do(data->material_ball,
|
eo_do(data->material_ball,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.0, 5.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.0, 5.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
|
|
||||||
data->mesh_ball = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
|
data->mesh_ball = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
|
||||||
|
@ -952,13 +952,13 @@ _mesh_setup_column(Scene_Data *data, int index)
|
||||||
data->material_column = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
data->material_column = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, evas);
|
||||||
|
|
||||||
eo_do(data->material_column,
|
eo_do(data->material_column,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0.4, 0.4, 0.4, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0.4, 0.4, 0.4, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0.6, 0.6, 0.6, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0.6, 0.6, 0.6, 1.0),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1.0, 1.0, 1.0, 1.0),
|
||||||
evas_canvas3d_material_shininess_set(50.0));
|
evas_canvas3d_material_shininess_set(50.0));
|
||||||
|
|
||||||
data->mesh_column[index] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
|
data->mesh_column[index] = eo_add(EVAS_CANVAS3D_MESH_CLASS, evas);
|
||||||
|
@ -982,9 +982,9 @@ _mesh_setup_column(Scene_Data *data, int index)
|
||||||
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
evas_canvas3d_texture_wrap_set(EVAS_CANVAS3D_WRAP_MODE_REPEAT, EVAS_CANVAS3D_WRAP_MODE_REPEAT));
|
||||||
|
|
||||||
eo_do(data->material_column,
|
eo_do(data->material_column,
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
data->texture_diffuse_column),
|
data->texture_diffuse_column),
|
||||||
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_texture_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
data->texture_diffuse_column));
|
data->texture_diffuse_column));
|
||||||
|
|
||||||
NORMAL_SET(column, column[index], red_brick_n_path)
|
NORMAL_SET(column, column[index], red_brick_n_path)
|
||||||
|
|
|
@ -4459,26 +4459,26 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
|
||||||
EINA_LIST_FOREACH(meshes, list, mesh)
|
EINA_LIST_FOREACH(meshes, list, mesh)
|
||||||
{
|
{
|
||||||
eo_do(mesh, material = evas_canvas3d_mesh_frame_material_get(0));
|
eo_do(mesh, material = evas_canvas3d_mesh_frame_material_get(0));
|
||||||
eo_do(material, texture = evas_canvas3d_material_texture_get(EVAS_CANVAS3D_MATERIAL_DIFFUSE));
|
eo_do(material, texture = evas_canvas3d_material_texture_get(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE));
|
||||||
|
|
||||||
pd_mesh_node = (Edje_Part_Description_Mesh_Node*) ep->chosen_description;
|
pd_mesh_node = (Edje_Part_Description_Mesh_Node*) ep->chosen_description;
|
||||||
|
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, EINA_TRUE),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, pd_mesh_node->mesh_node.properties.normal),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, pd_mesh_node->mesh_node.properties.normal),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
pd_mesh_node->mesh_node.properties.ambient.r / 255,
|
pd_mesh_node->mesh_node.properties.ambient.r / 255,
|
||||||
pd_mesh_node->mesh_node.properties.ambient.g / 255,
|
pd_mesh_node->mesh_node.properties.ambient.g / 255,
|
||||||
pd_mesh_node->mesh_node.properties.ambient.b / 255,
|
pd_mesh_node->mesh_node.properties.ambient.b / 255,
|
||||||
pd_mesh_node->mesh_node.properties.ambient.a / 255),
|
pd_mesh_node->mesh_node.properties.ambient.a / 255),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
pd_mesh_node->mesh_node.properties.diffuse.r / 255,
|
pd_mesh_node->mesh_node.properties.diffuse.r / 255,
|
||||||
pd_mesh_node->mesh_node.properties.diffuse.g / 255,
|
pd_mesh_node->mesh_node.properties.diffuse.g / 255,
|
||||||
pd_mesh_node->mesh_node.properties.diffuse.b / 255,
|
pd_mesh_node->mesh_node.properties.diffuse.b / 255,
|
||||||
pd_mesh_node->mesh_node.properties.diffuse.a / 255),
|
pd_mesh_node->mesh_node.properties.diffuse.a / 255),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
pd_mesh_node->mesh_node.properties.specular.r / 255,
|
pd_mesh_node->mesh_node.properties.specular.r / 255,
|
||||||
pd_mesh_node->mesh_node.properties.specular.g / 255,
|
pd_mesh_node->mesh_node.properties.specular.g / 255,
|
||||||
pd_mesh_node->mesh_node.properties.specular.b / 255,
|
pd_mesh_node->mesh_node.properties.specular.b / 255,
|
||||||
|
@ -4519,7 +4519,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
|
||||||
proxy = NULL;
|
proxy = NULL;
|
||||||
|
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
texture = evas_canvas3d_material_texture_get(EVAS_CANVAS3D_MATERIAL_DIFFUSE));
|
texture = evas_canvas3d_material_texture_get(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE));
|
||||||
|
|
||||||
//proxy = _edje_image_name_find(ed, pd_mesh_node->mesh_node.texture.id);
|
//proxy = _edje_image_name_find(ed, pd_mesh_node->mesh_node.texture.id);
|
||||||
/*FIXME Conflict with function _edje_image_name_find (two places in edje_utils and edje_edit.c,
|
/*FIXME Conflict with function _edje_image_name_find (two places in edje_utils and edje_edit.c,
|
||||||
|
|
|
@ -470,397 +470,6 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x,
|
||||||
Evas_Real a,
|
Evas_Real a,
|
||||||
Evas_Real b);
|
Evas_Real b);
|
||||||
|
|
||||||
/**
|
|
||||||
* Type of 3D Object
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Type
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Object_Type
|
|
||||||
{
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_INVALID = 0,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_SCENE,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_NODE,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_CAMERA,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_LIGHT,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_MODEL,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_MESH,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_TEXTURE,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_MATERIAL,
|
|
||||||
EVAS_CANVAS3D_OBJECT_TYPE_PRIMITIVE,
|
|
||||||
} Evas_Canvas3D_Object_Type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* State of the Evas 3D
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Type
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_State
|
|
||||||
{
|
|
||||||
EVAS_CANVAS3D_STATE_MAX = 16,
|
|
||||||
|
|
||||||
EVAS_CANVAS3D_STATE_ANY = 0,
|
|
||||||
|
|
||||||
EVAS_CANVAS3D_STATE_SCENE_ROOT_NODE = 1,
|
|
||||||
EVAS_CANVAS3D_STATE_SCENE_CAMERA_NODE,
|
|
||||||
EVAS_CANVAS3D_STATE_SCENE_BACKGROUND_COLOR,
|
|
||||||
EVAS_CANVAS3D_STATE_SCENE_SIZE,
|
|
||||||
EVAS_CANVAS3D_STATE_SCENE_SHADOWS_ENABLED,
|
|
||||||
EVAS_CANVAS3D_STATE_SCENE_UPDATED,
|
|
||||||
|
|
||||||
EVAS_CANVAS3D_STATE_TEXTURE_DATA = 1,
|
|
||||||
EVAS_CANVAS3D_STATE_TEXTURE_WRAP,
|
|
||||||
EVAS_CANVAS3D_STATE_TEXTURE_FILTER,
|
|
||||||
|
|
||||||
EVAS_CANVAS3D_STATE_MATERIAL_ID = 1,
|
|
||||||
EVAS_CANVAS3D_STATE_MATERIAL_COLOR,
|
|
||||||
EVAS_CANVAS3D_STATE_MATERIAL_TEXTURE,
|
|
||||||
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_VERTEX_COUNT = 1,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_FRAME,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_MATERIAL,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_TRANSFORM,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_VERTEX_DATA,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_INDEX_DATA,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_VERTEX_ASSEMBLY,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_SHADE_MODE,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_FOG,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_BLENDING,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_ALPHA_TEST,
|
|
||||||
EVAS_CANVAS3D_STATE_MESH_COLOR_PICK,
|
|
||||||
|
|
||||||
EVAS_CANVAS3D_STATE_CAMERA_PROJECTION = 1,
|
|
||||||
|
|
||||||
EVAS_CANVAS3D_STATE_LIGHT_AMBIENT = 1,
|
|
||||||
EVAS_CANVAS3D_STATE_LIGHT_DIFFUSE,
|
|
||||||
EVAS_CANVAS3D_STATE_LIGHT_SPECULAR,
|
|
||||||
EVAS_CANVAS3D_STATE_LIGHT_SPOT_DIR,
|
|
||||||
EVAS_CANVAS3D_STATE_LIGHT_SPOT_EXP,
|
|
||||||
EVAS_CANVAS3D_STATE_LIGHT_SPOT_CUTOFF,
|
|
||||||
EVAS_CANVAS3D_STATE_LIGHT_ATTENUATION,
|
|
||||||
EVAS_CANVAS3D_STATE_LIGHT_PROJECTION,
|
|
||||||
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_TRANSFORM_POSITION = 1,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_TRANSFORM_ORIENTATION,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_TRANSFORM_SCALE,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_MESH_GEOMETRY,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_MESH_MATERIAL,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_MESH_FRAME,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_MESH_SHADE_MODE,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_MESH_MATERIAL_ID,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_LIGHT,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_CAMERA,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_PARENT_POSITION,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_PARENT_ORIENTATION,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_PARENT_SCALE,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_MEMBER,
|
|
||||||
EVAS_CANVAS3D_STATE_NODE_PARENT_BILLBOARD,
|
|
||||||
} Evas_Canvas3D_State;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Transform space
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Space
|
|
||||||
{
|
|
||||||
EVAS_CANVAS3D_SPACE_LOCAL = 0, /**< Local coordinate space */
|
|
||||||
EVAS_CANVAS3D_SPACE_PARENT, /**< Parent coordinate space */
|
|
||||||
EVAS_CANVAS3D_SPACE_WORLD, /**< World coordinate space */
|
|
||||||
} Evas_Canvas3D_Space;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Types of a node
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Node_Type
|
|
||||||
{
|
|
||||||
EVAS_CANVAS3D_NODE_TYPE_NODE = 0, /**< Node with no items */
|
|
||||||
EVAS_CANVAS3D_NODE_TYPE_CAMERA, /**< Node which can contain camera object */
|
|
||||||
EVAS_CANVAS3D_NODE_TYPE_LIGHT, /**< Node which can contain light object */
|
|
||||||
EVAS_CANVAS3D_NODE_TYPE_MESH, /**< Node which can contain mesh objects */
|
|
||||||
} Evas_Canvas3D_Node_Type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Types of node orientation
|
|
||||||
*
|
|
||||||
* @since 1.13
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Node_Orientation_Type
|
|
||||||
{
|
|
||||||
/**< Node with no orientation properties */
|
|
||||||
EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_NONE = 0,
|
|
||||||
/**< Node orientation is given as a point to look at and a vector
|
|
||||||
that indicates the angle at which the subject is looking at the point */
|
|
||||||
EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_AT,
|
|
||||||
/**< Node orientation is given as id of another part to look at and a vector
|
|
||||||
that indicates the angle at which the subject is looking at the part */
|
|
||||||
EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_LOOK_TO,
|
|
||||||
/**< Node orientation is given as an angle and an axis to rotate around */
|
|
||||||
EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_ANGLE_AXIS,
|
|
||||||
/**< Node orientation is given as a quaternion */
|
|
||||||
EVAS_CANVAS3D_NODE_ORIENTATION_TYPE_QUATERNION,
|
|
||||||
} Evas_Canvas3D_Node_Orientation_Type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vertex attribute IDs
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Vertex_Attrib
|
|
||||||
{
|
|
||||||
EVAS_CANVAS3D_VERTEX_POSITION = 0, /**< Vertex position */
|
|
||||||
EVAS_CANVAS3D_VERTEX_NORMAL, /**< Vertex normal */
|
|
||||||
EVAS_CANVAS3D_VERTEX_TANGENT, /**< Vertex tangent (for normal mapping) */
|
|
||||||
EVAS_CANVAS3D_VERTEX_COLOR, /**< Vertex color */
|
|
||||||
EVAS_CANVAS3D_VERTEX_TEXCOORD, /**< Vertex texture coordinate */
|
|
||||||
} Evas_Canvas3D_Vertex_Attrib;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Index formats
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Index_Format
|
|
||||||
{
|
|
||||||
EVAS_CANVAS3D_INDEX_FORMAT_NONE = 0, /**< Indexing is not used */
|
|
||||||
EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_BYTE, /**< Index is of type unsigned byte */
|
|
||||||
EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT /**< Index is of type unsigned short */
|
|
||||||
} Evas_Canvas3D_Index_Format;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Frustum modes
|
|
||||||
*
|
|
||||||
* @since 1.12
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Frustum_Mode
|
|
||||||
{
|
|
||||||
EVAS_CANVAS3D_FRUSTUM_MODE_BSPHERE,
|
|
||||||
EVAS_CANVAS3D_FRUSTUM_MODE_AABB,
|
|
||||||
EVAS_CANVAS3D_FRUSTUM_MODE_CENTRAL_POINT
|
|
||||||
} Evas_Canvas3D_Frustum_Mode;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vertex assembly modes
|
|
||||||
*
|
|
||||||
* Vertex assembly represents how the vertices are organized into geometric
|
|
||||||
* primitives.
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Vertex_Assembly
|
|
||||||
{
|
|
||||||
/**< A vertex is rendered as a point */
|
|
||||||
EVAS_CANVAS3D_VERTEX_ASSEMBLY_POINTS = 0,
|
|
||||||
/**< Two vertices are organized as a line */
|
|
||||||
EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINES,
|
|
||||||
/**< Vertices are organized as a connected line path */
|
|
||||||
EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINE_STRIP,
|
|
||||||
/**< Vertices are organized as a closed line path */
|
|
||||||
EVAS_CANVAS3D_VERTEX_ASSEMBLY_LINE_LOOP,
|
|
||||||
/**< Three vertices are organized as a triangle */
|
|
||||||
EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES,
|
|
||||||
/**< Vertices are organized as connected triangles */
|
|
||||||
EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLE_STRIP,
|
|
||||||
/**< Vertices are organized as a triangle fan */
|
|
||||||
EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLE_FAN,
|
|
||||||
} Evas_Canvas3D_Vertex_Assembly;
|
|
||||||
|
|
||||||
typedef enum _Evas_Canvas3D_Blend_Func
|
|
||||||
{
|
|
||||||
/**< The scale factors for color components is (0, 0, 0, 0)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_ZERO = 0,
|
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_ONE,
|
|
||||||
/**< The scale factors for color components is (Rs/kR, Gs/kG, Bs/kB, As/kA)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_SRC_COLOR,
|
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Rs/kR, Gs/kG, Bs/kB, As/kA)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_COLOR,
|
|
||||||
/**< The scale factors for color components is (Rd/kR, Gd/kG, Bd/kB, Ad/kA)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_DST_COLOR,
|
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Rd/kR, Gd/kG, Bd/kB, Ad/kA)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_ONE_MINUS_DST_COLOR,
|
|
||||||
/**< The scale factors for color components is (As/kA, As/kA, As/kA, As/kA)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_SRC_ALPHA,
|
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (As/kA, As/kA, As/kA, As/kA)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_ALPHA,
|
|
||||||
/**< The scale factors for color components is (Ad/kA, Ad/kA, Ad/kA, Ad/kA)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_DST_ALPHA,
|
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Ad/kA, Ad/kA, Ad/kA, Ad/kA)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_ONE_MINUS_DST_ALPHA,
|
|
||||||
/**< The scale factors for color components is (Rc, Gc, Bc, Ac)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_CONSTANT_COLOR,
|
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Rc, Gc, Bc, Ac)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_ONE_MINUS_CONSTANT_COLOR,
|
|
||||||
/**< The scale factors for color components is (Ac, Ac, Ac, Ac)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_CONSTANT_ALPHA,
|
|
||||||
/**< The scale factors for color components is (1, 1, 1, 1) - (Ac, Ac, Ac, Ac)*/
|
|
||||||
EVAS_CANVAS3D_BLEND_ONE_MINUS_CONSTANT_ALPHA,
|
|
||||||
/**< The scale factors for color components is (i, i, i, 1) where i = min(As, kA, Ad)/kA*/
|
|
||||||
EVAS_CANVAS3D_BLEND_SRC_ALPHA_SATURATE,
|
|
||||||
} Evas_Canvas3D_Blend_Func;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Comparsion functions for testing(alpha, depth, stencil) in fragment shader.
|
|
||||||
*
|
|
||||||
* @since 1.14
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Comparison
|
|
||||||
{
|
|
||||||
/**< Never passes.*/
|
|
||||||
EVAS_CANVAS3D_COMPARISON_NEVER,
|
|
||||||
/**< Passes if the incoming value is less than the reference value.*/
|
|
||||||
EVAS_CANVAS3D_COMPARISON_LESS,
|
|
||||||
/**< Passes if the incoming value is equal to the reference value.*/
|
|
||||||
EVAS_CANVAS3D_COMPARISON_EQUAL,
|
|
||||||
/**< Passes if the incoming value is less than or equal to the reference value.*/
|
|
||||||
EVAS_CANVAS3D_COMPARISON_LEQUAL,
|
|
||||||
/**< Passes if the incoming value is greater than the reference value.*/
|
|
||||||
EVAS_CANVAS3D_COMPARISON_GREATER,
|
|
||||||
/**< Passes if the incoming value is not equal to the reference value.*/
|
|
||||||
EVAS_CANVAS3D_COMPARISON_NOTEQUAL,
|
|
||||||
/**< Passes if the incoming value is greater than or equal to the reference value.*/
|
|
||||||
EVAS_CANVAS3D_COMPARISON_GEQUAL,
|
|
||||||
/**< Always passes (initial value).*/
|
|
||||||
EVAS_CANVAS3D_COMPARISON_ALWAYS,
|
|
||||||
} Evas_Canvas3D_Comparison;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wrap modes
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Wrap_Mode
|
|
||||||
{
|
|
||||||
/**< Values will be clamped to be in range [min, max] */
|
|
||||||
EVAS_CANVAS3D_WRAP_MODE_CLAMP = 0,
|
|
||||||
/**< Values will be repeated */
|
|
||||||
EVAS_CANVAS3D_WRAP_MODE_REPEAT,
|
|
||||||
/**< Values will be repeated in a reflected manner */
|
|
||||||
EVAS_CANVAS3D_WRAP_MODE_REFLECT
|
|
||||||
} Evas_Canvas3D_Wrap_Mode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mesh primitive
|
|
||||||
*
|
|
||||||
* @since 1.12
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Mesh_Primitive
|
|
||||||
{
|
|
||||||
/**< An empty space */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_NONE = 0,
|
|
||||||
/**< One sided square */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_SQUARE,
|
|
||||||
/**< Cube */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_CUBE,
|
|
||||||
/**< Cylinder (can use precision and texture scale) */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_CYLINDER,
|
|
||||||
/**< Cone (can use precision and texture scale) */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_CONE,
|
|
||||||
/**< Sphere (can use precision and texture scale) */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_SPHERE,
|
|
||||||
/**< Torus (can use ratio, precision and texture scale) */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_TORUS,
|
|
||||||
/**< Custom surface (can use pointer to users function, precision and texture scale) */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_SURFACE,
|
|
||||||
/**< Terrain as surface with pointer to Perlin's noise function */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_TERRAIN,
|
|
||||||
/**< Count of supported primitives */
|
|
||||||
EVAS_CANVAS3D_MESH_PRIMITIVE_COUNT
|
|
||||||
} Evas_Canvas3D_Mesh_Primitive;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mode of mesh primitive
|
|
||||||
*
|
|
||||||
* @since 1.15
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Primitive_Mode
|
|
||||||
{
|
|
||||||
/**< Default mode of primitive */
|
|
||||||
EVAS_CANVAS3D_PRIMITIVE_MODE_DEFAULT = 0,
|
|
||||||
/**< Primitive without base (supported for cylinder and cone) */
|
|
||||||
EVAS_CANVAS3D_PRIMITIVE_MODE_WITHOUT_BASE,
|
|
||||||
/**< Ptimitive with alternative UV (supported for sphere)*/
|
|
||||||
EVAS_CANVAS3D_PRIMITIVE_MODE_ALTERNATIVE_UV
|
|
||||||
} Evas_Canvas3D_Primitive_Mode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Texture filters
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Texture_Filter
|
|
||||||
{
|
|
||||||
/**< Samples nearest texel */
|
|
||||||
EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST = 0,
|
|
||||||
/**< Lineary interpolate nearby texels */
|
|
||||||
EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR,
|
|
||||||
/**< Nearest sampling mipmap */
|
|
||||||
EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_NEAREST,
|
|
||||||
/**< Nearest sampling mipmap and interpolate */
|
|
||||||
EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_NEAREST,
|
|
||||||
/**< Linear sampling in nearest mipmap */
|
|
||||||
EVAS_CANVAS3D_TEXTURE_FILTER_NEAREST_MIPMAP_LINEAR,
|
|
||||||
/**< Linear sampling in mipmap and interpolate */
|
|
||||||
EVAS_CANVAS3D_TEXTURE_FILTER_LINEAR_MIPMAP_LINEAR
|
|
||||||
} Evas_Canvas3D_Texture_Filter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shade modes
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Shade_Mode
|
|
||||||
{
|
|
||||||
/**< Shaded using vertex color attribute */
|
|
||||||
EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR = 0,
|
|
||||||
/**< Shaded using material diffuse term */
|
|
||||||
EVAS_CANVAS3D_SHADE_MODE_DIFFUSE,
|
|
||||||
/**< Per-vertex flat lighting */
|
|
||||||
EVAS_CANVAS3D_SHADE_MODE_FLAT,
|
|
||||||
/**< Per-pixel phong shading */
|
|
||||||
EVAS_CANVAS3D_SHADE_MODE_PHONG,
|
|
||||||
/**< Per-pixel normal map shading */
|
|
||||||
EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP,
|
|
||||||
/**< fragment color is defined by its z-coord*/
|
|
||||||
EVAS_CANVAS3D_SHADE_MODE_SHADOW_MAP_RENDER,
|
|
||||||
/**< rendering to additional frame bufer*/
|
|
||||||
EVAS_CANVAS3D_SHADE_MODE_COLOR_PICK,
|
|
||||||
/**< Per-pixel parallax occlusion map shading */
|
|
||||||
EVAS_CANVAS3D_SHADE_MODE_PARALLAX_OCCLUSION,
|
|
||||||
} Evas_Canvas3D_Shade_Mode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Material attributes
|
|
||||||
*
|
|
||||||
* @since 1.10
|
|
||||||
* @ingroup Evas_Canvas3D_Types
|
|
||||||
*/
|
|
||||||
typedef enum _Evas_Canvas3D_Material_Attrib
|
|
||||||
{
|
|
||||||
EVAS_CANVAS3D_MATERIAL_AMBIENT = 0, /**< Ambient term */
|
|
||||||
EVAS_CANVAS3D_MATERIAL_DIFFUSE, /**< Diffuse term */
|
|
||||||
EVAS_CANVAS3D_MATERIAL_SPECULAR, /**< Specular term */
|
|
||||||
EVAS_CANVAS3D_MATERIAL_EMISSION, /**< Emission term */
|
|
||||||
EVAS_CANVAS3D_MATERIAL_NORMAL, /**< Normal map term */
|
|
||||||
} Evas_Canvas3D_Material_Attrib;
|
|
||||||
|
|
||||||
#include "canvas/evas_image.eo.h"
|
#include "canvas/evas_image.eo.h"
|
||||||
|
|
||||||
#include "canvas/evas_canvas3d_camera.eo.h"
|
#include "canvas/evas_canvas3d_camera.eo.h"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import evas_types;
|
||||||
|
|
||||||
class Evas.Canvas3D.Camera (Evas.Canvas3D.Object, Evas.Common_Interface)
|
class Evas.Canvas3D.Camera (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
{
|
{
|
||||||
legacy_prefix: null;
|
legacy_prefix: null;
|
||||||
|
@ -10,7 +12,7 @@ class Evas.Canvas3D.Camera (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.projection_perspective_set, @.projection_ortho_set and @.projection_frustum_set.]]
|
See also @.projection_perspective_set, @.projection_ortho_set and @.projection_frustum_set.]]
|
||||||
params {
|
params {
|
||||||
@in matrix: const(Evas_Real)*; [[Projection Matrix]]
|
@in matrix: const(Evas.Real)*; [[Projection Matrix]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +21,7 @@ class Evas.Canvas3D.Camera (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.projection_matrix_set.]]
|
See also @.projection_matrix_set.]]
|
||||||
params {
|
params {
|
||||||
@out matrix: Evas_Real; [[Projection Matrix]]
|
@out matrix: Evas.Real; [[Projection Matrix]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,10 +31,10 @@ class Evas.Canvas3D.Camera (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @.projection_matrix_set.]]
|
See also @.projection_matrix_set.]]
|
||||||
|
|
||||||
params {
|
params {
|
||||||
fovy: Evas_Real; [[Field of view angle in Y direction.]]
|
fovy: Evas.Real; [[Field of view angle in Y direction.]]
|
||||||
aspect: Evas_Real; [[Aspect ratio.]]
|
aspect: Evas.Real; [[Aspect ratio.]]
|
||||||
dnear: Evas_Real; [[Distance to near clipping plane.]]
|
dnear: Evas.Real; [[Distance to near clipping plane.]]
|
||||||
dfar: Evas_Real; [[Distance to far clipping plane.]]
|
dfar: Evas.Real; [[Distance to far clipping plane.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,12 +43,12 @@ class Evas.Canvas3D.Camera (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.projection_matrix_set.]]
|
See also @.projection_matrix_set.]]
|
||||||
params {
|
params {
|
||||||
left: Evas_Real; [[Left X coordinate of the near clipping plane.]]
|
left: Evas.Real; [[Left X coordinate of the near clipping plane.]]
|
||||||
right: Evas_Real; [[Right X coordinate of the near clipping plane..]]
|
right: Evas.Real; [[Right X coordinate of the near clipping plane..]]
|
||||||
bottom: Evas_Real; [[Bottom Y coordinate of the near clipping plane.]]
|
bottom: Evas.Real; [[Bottom Y coordinate of the near clipping plane.]]
|
||||||
top: Evas_Real; [[Top Y coordinate of the near clipping plane]]
|
top: Evas.Real; [[Top Y coordinate of the near clipping plane]]
|
||||||
dnear: Evas_Real; [[Distance to near clipping plane.]]
|
dnear: Evas.Real; [[Distance to near clipping plane.]]
|
||||||
dfar: Evas_Real; [[Distance to far clipping plane.]]
|
dfar: Evas.Real; [[Distance to far clipping plane.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
projection_ortho_set {
|
projection_ortho_set {
|
||||||
|
@ -54,12 +56,12 @@ class Evas.Canvas3D.Camera (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.projection_matrix_set.]]
|
See also @.projection_matrix_set.]]
|
||||||
params {
|
params {
|
||||||
left: Evas_Real; [[Left X coordinate of the near clipping plane.]]
|
left: Evas.Real; [[Left X coordinate of the near clipping plane.]]
|
||||||
right: Evas_Real; [[Right X coordinate of the near clipping plane..]]
|
right: Evas.Real; [[Right X coordinate of the near clipping plane..]]
|
||||||
bottom: Evas_Real; [[Bottom Y coordinate of the near clipping plane.]]
|
bottom: Evas.Real; [[Bottom Y coordinate of the near clipping plane.]]
|
||||||
top: Evas_Real; [[Top Y coordinate of the near clipping plane]]
|
top: Evas.Real; [[Top Y coordinate of the near clipping plane]]
|
||||||
dnear: Evas_Real; [[Distance to near clipping plane.]]
|
dnear: Evas.Real; [[Distance to near clipping plane.]]
|
||||||
dfar: Evas_Real; [[Distance to far clipping plane.]]
|
dfar: Evas.Real; [[Distance to far clipping plane.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
node_visible_get {
|
node_visible_get {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import evas_types;
|
||||||
|
|
||||||
class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
{
|
{
|
||||||
legacy_prefix: null;
|
legacy_prefix: null;
|
||||||
|
@ -45,7 +47,7 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @.spot_exponent.set]]
|
See also @.spot_exponent.set]]
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
exponent: Evas_Real; [[Spot exponent value.]]
|
exponent: Evas.Real; [[Spot exponent value.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +66,7 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @.spot_cutoff.set]]
|
See also @.spot_cutoff.set]]
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
cutoff: Evas_Real; [[Cutoff angle in degree..]]
|
cutoff: Evas.Real; [[Cutoff angle in degree..]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,10 +93,10 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
Default ambient color is (0.0, 0.0, 0.0, 1.0).]]
|
Default ambient color is (0.0, 0.0, 0.0, 1.0).]]
|
||||||
params {
|
params {
|
||||||
@in r: Evas_Real; [[Red component of the ambient color between [0.0, 1.0].]]
|
@in r: Evas.Real; [[Red component of the ambient color between [0.0, 1.0].]]
|
||||||
@in g: Evas_Real; [[Green component of the ambient color between [0.0, 1.0].]]
|
@in g: Evas.Real; [[Green component of the ambient color between [0.0, 1.0].]]
|
||||||
@in b: Evas_Real; [[Blue component of the ambient color between [0.0, 1.0].]]
|
@in b: Evas.Real; [[Blue component of the ambient color between [0.0, 1.0].]]
|
||||||
@in a: Evas_Real; [[Alpha component of the ambient color between [0.0, 1.0].]]
|
@in a: Evas.Real; [[Alpha component of the ambient color between [0.0, 1.0].]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ambient_get @const {
|
ambient_get @const {
|
||||||
|
@ -102,10 +104,10 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.ambient_set]]
|
See also @.ambient_set]]
|
||||||
params {
|
params {
|
||||||
@out r: Evas_Real; [[Red component of the ambient color between [0.0, 1.0].]]
|
@out r: Evas.Real; [[Red component of the ambient color between [0.0, 1.0].]]
|
||||||
@out g: Evas_Real; [[Green component of the ambient color between [0.0, 1.0].]]
|
@out g: Evas.Real; [[Green component of the ambient color between [0.0, 1.0].]]
|
||||||
@out b: Evas_Real; [[Blue component of the ambient color between [0.0, 1.0].]]
|
@out b: Evas.Real; [[Blue component of the ambient color between [0.0, 1.0].]]
|
||||||
@out a: Evas_Real; [[Alpha component of the ambient color between [0.0, 1.0].]]
|
@out a: Evas.Real; [[Alpha component of the ambient color between [0.0, 1.0].]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,10 +116,10 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
Default diffuse color is (1.0, 1.0, 1.0, 1.0).]]
|
Default diffuse color is (1.0, 1.0, 1.0, 1.0).]]
|
||||||
params {
|
params {
|
||||||
@in r: Evas_Real; [[Red component of the diffuse color between [0.0, 1.0].]]
|
@in r: Evas.Real; [[Red component of the diffuse color between [0.0, 1.0].]]
|
||||||
@in g: Evas_Real; [[Green component of the diffuse color between [0.0, 1.0].]]
|
@in g: Evas.Real; [[Green component of the diffuse color between [0.0, 1.0].]]
|
||||||
@in b: Evas_Real; [[Blue component of the diffuse color between [0.0, 1.0].]]
|
@in b: Evas.Real; [[Blue component of the diffuse color between [0.0, 1.0].]]
|
||||||
@in a: Evas_Real; [[Alpha component of the diffuse color between [0.0, 1.0].]]
|
@in a: Evas.Real; [[Alpha component of the diffuse color between [0.0, 1.0].]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
diffuse_get @const {
|
diffuse_get @const {
|
||||||
|
@ -125,10 +127,10 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.diffuse_set]]
|
See also @.diffuse_set]]
|
||||||
params {
|
params {
|
||||||
@out r: Evas_Real; [[Red component of the diffuse color between [0.0, 1.0].]]
|
@out r: Evas.Real; [[Red component of the diffuse color between [0.0, 1.0].]]
|
||||||
@out g: Evas_Real; [[Green component of the diffuse color between [0.0, 1.0].]]
|
@out g: Evas.Real; [[Green component of the diffuse color between [0.0, 1.0].]]
|
||||||
@out b: Evas_Real; [[Blue component of the diffuse color between [0.0, 1.0].]]
|
@out b: Evas.Real; [[Blue component of the diffuse color between [0.0, 1.0].]]
|
||||||
@out a: Evas_Real; [[Alpha component of the diffuse color between [0.0, 1.0].]]
|
@out a: Evas.Real; [[Alpha component of the diffuse color between [0.0, 1.0].]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,10 +139,10 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
Default specular color is (1.0, 1.0, 1.0, 1.0).]]
|
Default specular color is (1.0, 1.0, 1.0, 1.0).]]
|
||||||
params {
|
params {
|
||||||
@in r: Evas_Real; [[Red component of the specular color between [0.0, 1.0].]]
|
@in r: Evas.Real; [[Red component of the specular color between [0.0, 1.0].]]
|
||||||
@in g: Evas_Real; [[Green component of the specular color between [0.0, 1.0].]]
|
@in g: Evas.Real; [[Green component of the specular color between [0.0, 1.0].]]
|
||||||
@in b: Evas_Real; [[Blue component of the specular color between [0.0, 1.0].]]
|
@in b: Evas.Real; [[Blue component of the specular color between [0.0, 1.0].]]
|
||||||
@in a: Evas_Real; [[Alpha component of the specular color between [0.0, 1.0].]]
|
@in a: Evas.Real; [[Alpha component of the specular color between [0.0, 1.0].]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
specular_get @const {
|
specular_get @const {
|
||||||
|
@ -148,10 +150,10 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.specular_set]]
|
See also @.specular_set]]
|
||||||
params {
|
params {
|
||||||
@out r: Evas_Real; [[Red component of the specular color between [0.0, 1.0].]]
|
@out r: Evas.Real; [[Red component of the specular color between [0.0, 1.0].]]
|
||||||
@out g: Evas_Real; [[Green component of the specular color between [0.0, 1.0].]]
|
@out g: Evas.Real; [[Green component of the specular color between [0.0, 1.0].]]
|
||||||
@out b: Evas_Real; [[Blue component of the specular color between [0.0, 1.0].]]
|
@out b: Evas.Real; [[Blue component of the specular color between [0.0, 1.0].]]
|
||||||
@out a: Evas_Real; [[Alpha component of the specular color between [0.0, 1.0].]]
|
@out a: Evas.Real; [[Alpha component of the specular color between [0.0, 1.0].]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,9 +170,9 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.attenuation_enable.set]]
|
See also @.attenuation_enable.set]]
|
||||||
params {
|
params {
|
||||||
@in constant: Evas_Real; [[Constant attenuation term..]]
|
@in constant: Evas.Real; [[Constant attenuation term..]]
|
||||||
@in linear: Evas_Real; [[Linear attenuation term..]]
|
@in linear: Evas.Real; [[Linear attenuation term..]]
|
||||||
@in quadratic: Evas_Real; [[Quadratic attenuation term..]]
|
@in quadratic: Evas.Real; [[Quadratic attenuation term..]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,9 +181,9 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.attenuation_set]]
|
See also @.attenuation_set]]
|
||||||
params {
|
params {
|
||||||
@out constant: Evas_Real; [[Constant attenuation term..]]
|
@out constant: Evas.Real; [[Constant attenuation term..]]
|
||||||
@out linear: Evas_Real; [[Linear attenuation term..]]
|
@out linear: Evas.Real; [[Linear attenuation term..]]
|
||||||
@out quadratic: Evas_Real; [[Quadratic attenuation term..]]
|
@out quadratic: Evas.Real; [[Quadratic attenuation term..]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +194,7 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.projection_perspective_set, @.projection_ortho_set and @.projection_frustum_set]]
|
See also @.projection_perspective_set, @.projection_ortho_set and @.projection_frustum_set]]
|
||||||
params {
|
params {
|
||||||
@in matrix: const(Evas_Real) *; [[Projection Matrix. Pointer to the array of 16 Evas_Real values in column major order.]]
|
@in matrix: const(Evas.Real) *; [[Projection Matrix. Pointer to the array of 16 Evas.Real values in column major order.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +203,7 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.projection_matrix_set]]
|
See also @.projection_matrix_set]]
|
||||||
params {
|
params {
|
||||||
@out matrix: Evas_Real; [[Projection Matrix]]
|
@out matrix: Evas.Real; [[Projection Matrix]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,10 +213,10 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @.projection_matrix_set]]
|
See also @.projection_matrix_set]]
|
||||||
|
|
||||||
params {
|
params {
|
||||||
fovy: Evas_Real; [[Field of view angle in Y direction.]]
|
fovy: Evas.Real; [[Field of view angle in Y direction.]]
|
||||||
aspect: Evas_Real; [[Aspect ratio.]]
|
aspect: Evas.Real; [[Aspect ratio.]]
|
||||||
dnear: Evas_Real; [[Distance to near clipping plane.]]
|
dnear: Evas.Real; [[Distance to near clipping plane.]]
|
||||||
dfar: Evas_Real; [[Distance to far clipping plane.]]
|
dfar: Evas.Real; [[Distance to far clipping plane.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,12 +225,12 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
@Evas.Canvas3D.Light.projection_matrix_set]]
|
@Evas.Canvas3D.Light.projection_matrix_set]]
|
||||||
params {
|
params {
|
||||||
left: Evas_Real; [[Left X coordinate of the near clipping plane.]]
|
left: Evas.Real; [[Left X coordinate of the near clipping plane.]]
|
||||||
right: Evas_Real; [[Right X coordinate of the near clipping plane.]]
|
right: Evas.Real; [[Right X coordinate of the near clipping plane.]]
|
||||||
bottom: Evas_Real; [[Bottom Y coordinate of the near clipping plane.]]
|
bottom: Evas.Real; [[Bottom Y coordinate of the near clipping plane.]]
|
||||||
top: Evas_Real; [[Top Y coordinate of the near clipping plane]]
|
top: Evas.Real; [[Top Y coordinate of the near clipping plane]]
|
||||||
dnear: Evas_Real; [[Distance to near clipping plane.]]
|
dnear: Evas.Real; [[Distance to near clipping plane.]]
|
||||||
dfar: Evas_Real; [[Distance to far clipping plane.]]
|
dfar: Evas.Real; [[Distance to far clipping plane.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
projection_ortho_set {
|
projection_ortho_set {
|
||||||
|
@ -236,12 +238,12 @@ class Evas.Canvas3D.Light (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @.projection_matrix_set]]
|
See also @.projection_matrix_set]]
|
||||||
params {
|
params {
|
||||||
left: Evas_Real; [[Left X coordinate of the near clipping plane.]]
|
left: Evas.Real; [[Left X coordinate of the near clipping plane.]]
|
||||||
right: Evas_Real; [[Right X coordinate of the near clipping plane.]]
|
right: Evas.Real; [[Right X coordinate of the near clipping plane.]]
|
||||||
bottom: Evas_Real; [[Bottom Y coordinate of the near clipping plane.]]
|
bottom: Evas.Real; [[Bottom Y coordinate of the near clipping plane.]]
|
||||||
top: Evas_Real; [[Top Y coordinate of the near clipping plane]]
|
top: Evas.Real; [[Top Y coordinate of the near clipping plane]]
|
||||||
dnear: Evas_Real; [[Distance to near clipping plane.]]
|
dnear: Evas.Real; [[Distance to near clipping plane.]]
|
||||||
dfar: Evas_Real; [[Distance to far clipping plane.]]
|
dfar: Evas.Real; [[Distance to far clipping plane.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,10 +94,10 @@ _evas_canvas3d_material_eo_base_constructor(Eo *obj EINA_UNUSED, Evas_Canvas3D_M
|
||||||
obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
|
obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
|
||||||
eo_do(obj, evas_canvas3d_object_type_set(EVAS_CANVAS3D_OBJECT_TYPE_MATERIAL));
|
eo_do(obj, evas_canvas3d_object_type_set(EVAS_CANVAS3D_OBJECT_TYPE_MATERIAL));
|
||||||
|
|
||||||
evas_color_set(&pd->attribs[EVAS_CANVAS3D_MATERIAL_AMBIENT].color, 0.2, 0.2, 0.2, 1.0);
|
evas_color_set(&pd->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color, 0.2, 0.2, 0.2, 1.0);
|
||||||
evas_color_set(&pd->attribs[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color, 0.8, 0.8, 0.8, 1.0);
|
evas_color_set(&pd->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color, 0.8, 0.8, 0.8, 1.0);
|
||||||
evas_color_set(&pd->attribs[EVAS_CANVAS3D_MATERIAL_SPECULAR].color, 1.0, 1.0, 1.0, 1.0);
|
evas_color_set(&pd->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color, 1.0, 1.0, 1.0, 1.0);
|
||||||
evas_color_set(&pd->attribs[EVAS_CANVAS3D_MATERIAL_EMISSION].color, 0.0, 0.0, 0.0, 1.0);
|
evas_color_set(&pd->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color, 0.0, 0.0, 0.0, 1.0);
|
||||||
pd->shininess = 150.0;
|
pd->shininess = 150.0;
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
|
|
@ -22,10 +22,10 @@ class Evas.Canvas3D.Material (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
params {
|
params {
|
||||||
@in attrib: Evas.Canvas3D.Material_Attrib; [[Material attribute ID.]]
|
@in attrib: Evas.Canvas3D.Material_Attrib; [[Material attribute ID.]]
|
||||||
@in r: Evas_Real; [[Red component of the color.]]
|
@in r: Evas.Real; [[Red component of the color.]]
|
||||||
@in g: Evas_Real; [[Green component of the color.]]
|
@in g: Evas.Real; [[Green component of the color.]]
|
||||||
@in b: Evas_Real; [[Blue component of the color.]]
|
@in b: Evas.Real; [[Blue component of the color.]]
|
||||||
@in a: Evas_Real; [[Alpha component of the color.]]
|
@in a: Evas.Real; [[Alpha component of the color.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,10 +36,10 @@ class Evas.Canvas3D.Material (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
]]
|
]]
|
||||||
params {
|
params {
|
||||||
@in attrib: Evas.Canvas3D.Material_Attrib; [[Material attribute ID.]]
|
@in attrib: Evas.Canvas3D.Material_Attrib; [[Material attribute ID.]]
|
||||||
@out r: Evas_Real; [[Pointer to receive red component of the color.]]
|
@out r: Evas.Real; [[Pointer to receive red component of the color.]]
|
||||||
@out g: Evas_Real; [[Pointer to receive green component of the color.]]
|
@out g: Evas.Real; [[Pointer to receive green component of the color.]]
|
||||||
@out b: Evas_Real; [[Pointer to receive blue component of the color.]]
|
@out b: Evas.Real; [[Pointer to receive blue component of the color.]]
|
||||||
@out a: Evas_Real; [[Pointer to receive alpha component of the color.]]
|
@out a: Evas.Real; [[Pointer to receive alpha component of the color.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class Evas.Canvas3D.Material (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
]]
|
]]
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
shininess: Evas_Real; [[Shininess value.]]
|
shininess: Evas.Real; [[Shininess value.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,9 +70,9 @@ evas_canvas3d_mesh_aabb_add_to_frame(Evas_Canvas3D_Mesh_Data *pd, int frame, int
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
step = curframe->vertices[EVAS_CANVAS3D_VERTEX_POSITION].element_count;
|
step = curframe->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].element_count;
|
||||||
size = curframe->vertices[EVAS_CANVAS3D_VERTEX_POSITION].size;
|
size = curframe->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].size;
|
||||||
minmaxdata = (float *)curframe->vertices[EVAS_CANVAS3D_VERTEX_POSITION].data;
|
minmaxdata = (float *)curframe->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].data;
|
||||||
|
|
||||||
if (!minmaxdata)
|
if (!minmaxdata)
|
||||||
{
|
{
|
||||||
|
@ -117,8 +117,8 @@ _mesh_init(Evas_Canvas3D_Mesh_Data *pd)
|
||||||
pd->assembly = EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES;
|
pd->assembly = EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES;
|
||||||
|
|
||||||
pd->nodes = NULL;
|
pd->nodes = NULL;
|
||||||
pd->blend_sfactor = EVAS_CANVAS3D_BLEND_ONE;
|
pd->blend_sfactor = EVAS_CANVAS3D_BLEND_FUNC_ONE;
|
||||||
pd->blend_dfactor = EVAS_CANVAS3D_BLEND_ZERO;
|
pd->blend_dfactor = EVAS_CANVAS3D_BLEND_FUNC_ZERO;
|
||||||
pd->blending = EINA_FALSE;
|
pd->blending = EINA_FALSE;
|
||||||
|
|
||||||
pd->alpha_comparison = EVAS_CANVAS3D_COMPARISON_ALWAYS;
|
pd->alpha_comparison = EVAS_CANVAS3D_COMPARISON_ALWAYS;
|
||||||
|
@ -398,7 +398,7 @@ _evas_canvas3d_mesh_frame_vertex_data_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attrib == EVAS_CANVAS3D_VERTEX_POSITION)
|
if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION)
|
||||||
{
|
{
|
||||||
int i = 0, j = 0, size = stride/sizeof(float);
|
int i = 0, j = 0, size = stride/sizeof(float);
|
||||||
float vxmin, vymin, vzmin, vxmax, vymax, vzmax;
|
float vxmin, vymin, vzmin, vxmax, vymax, vzmax;
|
||||||
|
@ -434,19 +434,19 @@ _evas_canvas3d_mesh_frame_vertex_data_set(Eo *obj, Evas_Canvas3D_Mesh_Data *pd,
|
||||||
ERR("Axis-Aligned Bounding Box wasn't added in frame %d ", frame);
|
ERR("Axis-Aligned Bounding Box wasn't added in frame %d ", frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (attrib == EVAS_CANVAS3D_VERTEX_NORMAL)
|
else if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL)
|
||||||
{
|
{
|
||||||
element_count = 3;
|
element_count = 3;
|
||||||
}
|
}
|
||||||
else if (attrib == EVAS_CANVAS3D_VERTEX_TANGENT)
|
else if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT)
|
||||||
{
|
{
|
||||||
element_count = 3;
|
element_count = 3;
|
||||||
}
|
}
|
||||||
else if (attrib == EVAS_CANVAS3D_VERTEX_COLOR)
|
else if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR)
|
||||||
{
|
{
|
||||||
element_count = 4;
|
element_count = 4;
|
||||||
}
|
}
|
||||||
else if (attrib == EVAS_CANVAS3D_VERTEX_TEXCOORD)
|
else if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD)
|
||||||
{
|
{
|
||||||
element_count = 2;
|
element_count = 2;
|
||||||
}
|
}
|
||||||
|
@ -481,23 +481,23 @@ _evas_canvas3d_mesh_frame_vertex_data_copy_set(Eo *obj, Evas_Canvas3D_Mesh_Data
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attrib == EVAS_CANVAS3D_VERTEX_POSITION)
|
if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION)
|
||||||
{
|
{
|
||||||
element_count = 3;
|
element_count = 3;
|
||||||
}
|
}
|
||||||
else if (attrib == EVAS_CANVAS3D_VERTEX_NORMAL)
|
else if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL)
|
||||||
{
|
{
|
||||||
element_count = 3;
|
element_count = 3;
|
||||||
}
|
}
|
||||||
else if (attrib == EVAS_CANVAS3D_VERTEX_TANGENT)
|
else if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT)
|
||||||
{
|
{
|
||||||
element_count = 3;
|
element_count = 3;
|
||||||
}
|
}
|
||||||
else if (attrib == EVAS_CANVAS3D_VERTEX_COLOR)
|
else if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR)
|
||||||
{
|
{
|
||||||
element_count = 4;
|
element_count = 4;
|
||||||
}
|
}
|
||||||
else if (attrib == EVAS_CANVAS3D_VERTEX_TEXCOORD)
|
else if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD)
|
||||||
{
|
{
|
||||||
element_count = 2;
|
element_count = 2;
|
||||||
}
|
}
|
||||||
|
@ -583,7 +583,7 @@ _evas_canvas3d_mesh_frame_vertex_data_copy_set(Eo *obj, Evas_Canvas3D_Mesh_Data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attrib == EVAS_CANVAS3D_VERTEX_POSITION &&
|
if (attrib == EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION &&
|
||||||
!evas_canvas3d_mesh_aabb_add_to_frame(pd, frame, stride))
|
!evas_canvas3d_mesh_aabb_add_to_frame(pd, frame, stride))
|
||||||
{
|
{
|
||||||
ERR("Axis-Aligned Bounding Box wasn't added in frame %d ", frame);
|
ERR("Axis-Aligned Bounding Box wasn't added in frame %d ", frame);
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import evas_types;
|
||||||
|
|
||||||
class Evas.Canvas3D.Mesh (Evas.Canvas3D.Object, Evas.Common_Interface, Efl.File)
|
class Evas.Canvas3D.Mesh (Evas.Canvas3D.Object, Evas.Common_Interface, Efl.File)
|
||||||
{
|
{
|
||||||
legacy_prefix: null;
|
legacy_prefix: null;
|
||||||
|
@ -174,19 +176,19 @@ class Evas.Canvas3D.Mesh (Evas.Canvas3D.Object, Evas.Common_Interface, Efl.File)
|
||||||
fog_color_set {
|
fog_color_set {
|
||||||
[[Set the fog color and density for the given mesh.]]
|
[[Set the fog color and density for the given mesh.]]
|
||||||
params {
|
params {
|
||||||
@in r: Evas_Real; [[The red component of the fog color.]]
|
@in r: Evas.Real; [[The red component of the fog color.]]
|
||||||
@in g: Evas_Real; [[The green component of the fog color.]]
|
@in g: Evas.Real; [[The green component of the fog color.]]
|
||||||
@in b: Evas_Real; [[The blue component of the fog color.]]
|
@in b: Evas.Real; [[The blue component of the fog color.]]
|
||||||
@in a: Evas_Real; [[The transparency of fog.]]
|
@in a: Evas.Real; [[The transparency of fog.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fog_color_get {
|
fog_color_get {
|
||||||
[[Set the fog color and density for the given mesh.]]
|
[[Set the fog color and density for the given mesh.]]
|
||||||
params {
|
params {
|
||||||
@out r: Evas_Real; [[Pointer to receive red component of the fog color.]]
|
@out r: Evas.Real; [[Pointer to receive red component of the fog color.]]
|
||||||
@out g: Evas_Real; [[Pointer to receive green component of the fog color.]]
|
@out g: Evas.Real; [[Pointer to receive green component of the fog color.]]
|
||||||
@out b: Evas_Real; [[Pointer to receive blue component of the fog color.]]
|
@out b: Evas.Real; [[Pointer to receive blue component of the fog color.]]
|
||||||
@out a: Evas_Real; [[Pointer to receive transparency of fog.]]
|
@out a: Evas.Real; [[Pointer to receive transparency of fog.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
blending_func_set {
|
blending_func_set {
|
||||||
|
@ -306,7 +308,7 @@ class Evas.Canvas3D.Mesh (Evas.Canvas3D.Object, Evas.Common_Interface, Efl.File)
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
comparison_func: Evas.Canvas3D.Comparison; [[The alpha comparison function.]]
|
comparison_func: Evas.Canvas3D.Comparison; [[The alpha comparison function.]]
|
||||||
ref_value: Evas_Real; [[The reference value that incoming alpha values are compared to.]]
|
ref_value: Evas.Real; [[The reference value that incoming alpha values are compared to.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -522,7 +522,7 @@ _pack_meshes_vertex_data(Evas_Canvas3D_Node *node, Evas_Vec3 **vertices, int *co
|
||||||
EINA_LIST_FOREACH(m, l, mesh)
|
EINA_LIST_FOREACH(m, l, mesh)
|
||||||
{
|
{
|
||||||
eo_do(node, frame = evas_canvas3d_node_mesh_frame_get(mesh));
|
eo_do(node, frame = evas_canvas3d_node_mesh_frame_get(mesh));
|
||||||
evas_canvas3d_mesh_interpolate_vertex_buffer_get(mesh, frame, EVAS_CANVAS3D_VERTEX_POSITION,
|
evas_canvas3d_mesh_interpolate_vertex_buffer_get(mesh, frame, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION,
|
||||||
&pos0, &pos1, &pos_weight);
|
&pos0, &pos1, &pos_weight);
|
||||||
if(!pos0.data) continue;
|
if(!pos0.data) continue;
|
||||||
if(!pos0.stride)
|
if(!pos0.stride)
|
||||||
|
@ -545,7 +545,7 @@ _pack_meshes_vertex_data(Evas_Canvas3D_Node *node, Evas_Vec3 **vertices, int *co
|
||||||
EINA_LIST_FOREACH(m, l, mesh)
|
EINA_LIST_FOREACH(m, l, mesh)
|
||||||
{
|
{
|
||||||
eo_do(node, frame = evas_canvas3d_node_mesh_frame_get(mesh));
|
eo_do(node, frame = evas_canvas3d_node_mesh_frame_get(mesh));
|
||||||
evas_canvas3d_mesh_interpolate_vertex_buffer_get(mesh, frame, EVAS_CANVAS3D_VERTEX_POSITION,
|
evas_canvas3d_mesh_interpolate_vertex_buffer_get(mesh, frame, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION,
|
||||||
&pos0, &pos1, &pos_weight);
|
&pos0, &pos1, &pos_weight);
|
||||||
if(!pos0.data) continue;
|
if(!pos0.data) continue;
|
||||||
int stride = 0;
|
int stride = 0;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import evas_types;
|
||||||
|
|
||||||
class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
{
|
{
|
||||||
legacy_prefix: null;
|
legacy_prefix: null;
|
||||||
|
@ -60,9 +62,9 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @Evas.Canvas3D.Node.position_inherit.set.]]
|
See also @Evas.Canvas3D.Node.position_inherit.set.]]
|
||||||
params {
|
params {
|
||||||
@in x: Evas_Real; [[X coordinate of the position.]]
|
@in x: Evas.Real; [[X coordinate of the position.]]
|
||||||
@in y: Evas_Real; [[Y coordinate of the position.]]
|
@in y: Evas.Real; [[Y coordinate of the position.]]
|
||||||
@in z: Evas_Real; [[Z coordinate of the position.]]
|
@in z: Evas.Real; [[Z coordinate of the position.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
orientation_set {
|
orientation_set {
|
||||||
|
@ -75,10 +77,10 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @Evas.Canvas3D.Node.orientation_inherit.set.]]
|
See also @Evas.Canvas3D.Node.orientation_inherit.set.]]
|
||||||
params {
|
params {
|
||||||
@in x: Evas_Real; [[X term of the orientation quaternion (w, x, y, z.]]
|
@in x: Evas.Real; [[X term of the orientation quaternion (w, x, y, z.]]
|
||||||
@in y: Evas_Real; [[Y term of the orientation quaternion (w, x, y, z.]]
|
@in y: Evas.Real; [[Y term of the orientation quaternion (w, x, y, z.]]
|
||||||
@in z: Evas_Real; [[Z term of the orientation quaternion (w, x, y, z.]]
|
@in z: Evas.Real; [[Z term of the orientation quaternion (w, x, y, z.]]
|
||||||
@in w: Evas_Real; [[W term of the orientation quaternion (w, x, y, z.]]
|
@in w: Evas.Real; [[W term of the orientation quaternion (w, x, y, z.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,10 +89,10 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @Evas.Canvas3D.Node.orientation_set.]]
|
See also @Evas.Canvas3D.Node.orientation_set.]]
|
||||||
params {
|
params {
|
||||||
@in angle: Evas_Real; [[Rotation angle.]]
|
@in angle: Evas.Real; [[Rotation angle.]]
|
||||||
@in x: Evas_Real; [[X term of the rotation axis.]]
|
@in x: Evas.Real; [[X term of the rotation axis.]]
|
||||||
@in y: Evas_Real; [[Y term of the rotation axis.]]
|
@in y: Evas.Real; [[Y term of the rotation axis.]]
|
||||||
@in z: Evas_Real; [[Z term of the rotation axis.]]
|
@in z: Evas.Real; [[Z term of the rotation axis.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,9 +107,9 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
|
|
||||||
See also @Evas.Canvas3D.Node.scale_inherit.set.]]
|
See also @Evas.Canvas3D.Node.scale_inherit.set.]]
|
||||||
params {
|
params {
|
||||||
@in x: Evas_Real; [[Scale factor along X-axis.]]
|
@in x: Evas.Real; [[Scale factor along X-axis.]]
|
||||||
@in y: Evas_Real; [[Scale factor along Y-axis.]]
|
@in y: Evas.Real; [[Scale factor along Y-axis.]]
|
||||||
@in z: Evas_Real; [[Scale factor along Z-axis.]]
|
@in z: Evas.Real; [[Scale factor along Z-axis.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,9 +119,9 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @Evas.Canvas3D.Node.position_set.]]
|
See also @Evas.Canvas3D.Node.position_set.]]
|
||||||
params {
|
params {
|
||||||
@in space: Evas.Canvas3D.Space; [[The given node.]]
|
@in space: Evas.Canvas3D.Space; [[The given node.]]
|
||||||
@out x: Evas_Real; [[Pointer to receive X coordinate of the position.]]
|
@out x: Evas.Real; [[Pointer to receive X coordinate of the position.]]
|
||||||
@out y: Evas_Real; [[Pointer to receive Y coordinate of the position.]]
|
@out y: Evas.Real; [[Pointer to receive Y coordinate of the position.]]
|
||||||
@out z: Evas_Real; [[Pointer to receive Z coordinate of the position.]]
|
@out z: Evas.Real; [[Pointer to receive Z coordinate of the position.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,10 +131,10 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @Evas.Canvas3D.Node.orientation_set.]]
|
See also @Evas.Canvas3D.Node.orientation_set.]]
|
||||||
params {
|
params {
|
||||||
@in space: Evas.Canvas3D.Space; [[The given node.]]
|
@in space: Evas.Canvas3D.Space; [[The given node.]]
|
||||||
@out x: Evas_Real; [[Pointer to receive X term of the orientation quaternion.]]
|
@out x: Evas.Real; [[Pointer to receive X term of the orientation quaternion.]]
|
||||||
@out y: Evas_Real; [[Pointer to receive Y term of the orientation quaternion.]]
|
@out y: Evas.Real; [[Pointer to receive Y term of the orientation quaternion.]]
|
||||||
@out z: Evas_Real; [[Pointer to receive Z term of the orientation quaternion.]]
|
@out z: Evas.Real; [[Pointer to receive Z term of the orientation quaternion.]]
|
||||||
@out w: Evas_Real; [[Pointer to receive W term of the orientation quaternion.]]
|
@out w: Evas.Real; [[Pointer to receive W term of the orientation quaternion.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,9 +144,9 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @Evas.Canvas3D.Node.scale_get.]]
|
See also @Evas.Canvas3D.Node.scale_get.]]
|
||||||
params {
|
params {
|
||||||
@in space: Evas.Canvas3D.Space; [[The given node.]]
|
@in space: Evas.Canvas3D.Space; [[The given node.]]
|
||||||
@out x: Evas_Real; [[Pointer to receive Scale factor along X-axis.]]
|
@out x: Evas.Real; [[Pointer to receive Scale factor along X-axis.]]
|
||||||
@out y: Evas_Real; [[Pointer to receive Scale factor along X-axis.]]
|
@out y: Evas.Real; [[Pointer to receive Scale factor along X-axis.]]
|
||||||
@out z: Evas_Real; [[Pointer to receive Scale factor along X-axis.]]
|
@out z: Evas.Real; [[Pointer to receive Scale factor along X-axis.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,13 +160,13 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @Evas.Canvas3D.Node.orientation_set.]]
|
See also @Evas.Canvas3D.Node.orientation_set.]]
|
||||||
params {
|
params {
|
||||||
@in target_space: Evas.Canvas3D.Space; [[Space where the target position belongs to.]]
|
@in target_space: Evas.Canvas3D.Space; [[Space where the target position belongs to.]]
|
||||||
@in x: Evas_Real; [[X coordinate of the target position.]]
|
@in x: Evas.Real; [[X coordinate of the target position.]]
|
||||||
@in y: Evas_Real; [[Y coordinate of the target position.]]
|
@in y: Evas.Real; [[Y coordinate of the target position.]]
|
||||||
@in z: Evas_Real; [[Z coordinate of the target position.]]
|
@in z: Evas.Real; [[Z coordinate of the target position.]]
|
||||||
@in up_space: Evas.Canvas3D.Space; [[Space where the up vector belongs to.]]
|
@in up_space: Evas.Canvas3D.Space; [[Space where the up vector belongs to.]]
|
||||||
@in ux: Evas_Real; [[X term of the up vector.]]
|
@in ux: Evas.Real; [[X term of the up vector.]]
|
||||||
@in uy: Evas_Real; [[Y term of the up vector.]]
|
@in uy: Evas.Real; [[Y term of the up vector.]]
|
||||||
@in uz: Evas_Real; [[Z term of the up vector.]]
|
@in uz: Evas.Real; [[Z term of the up vector.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,12 +208,12 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
bounding_box_get{
|
bounding_box_get{
|
||||||
[[Get axis-aligned bounding box (AABB) of the given node.]]
|
[[Get axis-aligned bounding box (AABB) of the given node.]]
|
||||||
params {
|
params {
|
||||||
@in x: Evas_Real *; [[Pointer to receive X coordinate of the first point of AABB.]]
|
@in x: Evas.Real *; [[Pointer to receive X coordinate of the first point of AABB.]]
|
||||||
@in y: Evas_Real *; [[Pointer to receive Y coordinate of the first point of AABB.]]
|
@in y: Evas.Real *; [[Pointer to receive Y coordinate of the first point of AABB.]]
|
||||||
@in z: Evas_Real *; [[Pointer to receive Z coordinate of the first point of AABB.]]
|
@in z: Evas.Real *; [[Pointer to receive Z coordinate of the first point of AABB.]]
|
||||||
@in x2: Evas_Real *; [[Pointer to receive X coordinate of the second point of AABB.]]
|
@in x2: Evas.Real *; [[Pointer to receive X coordinate of the second point of AABB.]]
|
||||||
@in y2: Evas_Real *; [[Pointer to receive Y coordinate of the second point of AABB.]]
|
@in y2: Evas.Real *; [[Pointer to receive Y coordinate of the second point of AABB.]]
|
||||||
@in z2: Evas_Real *; [[Pointer to receive Z coordinate of the second point of AABB.]]
|
@in z2: Evas.Real *; [[Pointer to receive Z coordinate of the second point of AABB.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,10 +221,10 @@ class Evas.Canvas3D.Node (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
[[Get bounding sphere of the given node.]]
|
[[Get bounding sphere of the given node.]]
|
||||||
params {
|
params {
|
||||||
|
|
||||||
@in x: Evas_Real *; [[Pointer to receive X coordinate of the center of sphere.]]
|
@in x: Evas.Real *; [[Pointer to receive X coordinate of the center of sphere.]]
|
||||||
@in y: Evas_Real *; [[Pointer to receive Y coordinate of the center of sphere.]]
|
@in y: Evas.Real *; [[Pointer to receive Y coordinate of the center of sphere.]]
|
||||||
@in z: Evas_Real *; [[Pointer to receive Z coordinate of center of sphere.]]
|
@in z: Evas.Real *; [[Pointer to receive Z coordinate of center of sphere.]]
|
||||||
@in r: Evas_Real *; [[Pointer to receive radius of center of sphere.]]
|
@in r: Evas.Real *; [[Pointer to receive radius of center of sphere.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import evas_types;
|
||||||
|
|
||||||
class Evas.Canvas3D.Object (Eo.Base, Evas.Common_Interface)
|
class Evas.Canvas3D.Object (Eo.Base, Evas.Common_Interface)
|
||||||
{
|
{
|
||||||
legacy_prefix: null;
|
legacy_prefix: null;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import evas_types;
|
||||||
|
|
||||||
class Evas.Canvas3D.Primitive (Evas.Canvas3D.Object, Evas.Common_Interface)
|
class Evas.Canvas3D.Primitive (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
{
|
{
|
||||||
legacy_prefix: null;
|
legacy_prefix: null;
|
||||||
|
@ -67,7 +69,7 @@ class Evas.Canvas3D.Primitive (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @.ratio.set.]]
|
See also @.ratio.set.]]
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
ratio: Evas_Real; [[Ratio of primitive.]]
|
ratio: Evas.Real; [[Ratio of primitive.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@property precision {
|
@property precision {
|
||||||
|
@ -127,8 +129,8 @@ class Evas.Canvas3D.Primitive (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
See also @.tex_scale.set.]]
|
See also @.tex_scale.set.]]
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
tex_scale_x: Evas_Real;
|
tex_scale_x: Evas.Real;
|
||||||
tex_scale_y: Evas_Real;
|
tex_scale_y: Evas.Real;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,10 +293,10 @@ _pick_data_mesh_add(Evas_Canvas3D_Pick_Data *data, const Evas_Ray3 *ray,
|
||||||
memset(&tex0, 0x00, sizeof(Evas_Canvas3D_Vertex_Buffer));
|
memset(&tex0, 0x00, sizeof(Evas_Canvas3D_Vertex_Buffer));
|
||||||
memset(&tex1, 0x00, sizeof(Evas_Canvas3D_Vertex_Buffer));
|
memset(&tex1, 0x00, sizeof(Evas_Canvas3D_Vertex_Buffer));
|
||||||
|
|
||||||
evas_canvas3d_mesh_interpolate_vertex_buffer_get(mesh, frame, EVAS_CANVAS3D_VERTEX_POSITION,
|
evas_canvas3d_mesh_interpolate_vertex_buffer_get(mesh, frame, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION,
|
||||||
&pos0, &pos1, &pos_weight);
|
&pos0, &pos1, &pos_weight);
|
||||||
|
|
||||||
evas_canvas3d_mesh_interpolate_vertex_buffer_get(mesh, frame, EVAS_CANVAS3D_VERTEX_TEXCOORD,
|
evas_canvas3d_mesh_interpolate_vertex_buffer_get(mesh, frame, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD,
|
||||||
&tex0, &tex1, &tex_weight);
|
&tex0, &tex1, &tex_weight);
|
||||||
Evas_Canvas3D_Mesh_Data *pdmesh = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS);
|
Evas_Canvas3D_Mesh_Data *pdmesh = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS);
|
||||||
if (pdmesh->indices)
|
if (pdmesh->indices)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import evas_types;
|
||||||
|
|
||||||
class Evas.Canvas3D.Scene (Evas.Canvas3D.Object, Evas.Common_Interface)
|
class Evas.Canvas3D.Scene (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
{
|
{
|
||||||
legacy_prefix: null;
|
legacy_prefix: null;
|
||||||
|
@ -35,20 +37,20 @@ class Evas.Canvas3D.Scene (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
Default background color is (0.0, 0.0, 0.0, 0.0).
|
Default background color is (0.0, 0.0, 0.0, 0.0).
|
||||||
]]
|
]]
|
||||||
params {
|
params {
|
||||||
@in r: Evas_Real; [[Red component of the background color.]]
|
@in r: Evas.Real; [[Red component of the background color.]]
|
||||||
@in g: Evas_Real; [[Green component of the background color.]]
|
@in g: Evas.Real; [[Green component of the background color.]]
|
||||||
@in b: Evas_Real; [[Blue component of the background color.]]
|
@in b: Evas.Real; [[Blue component of the background color.]]
|
||||||
@in a: Evas_Real; [[Alpha component of the background color.]]
|
@in a: Evas.Real; [[Alpha component of the background color.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
background_color_get @const {
|
background_color_get @const {
|
||||||
[[Get the background color of a scene.]]
|
[[Get the background color of a scene.]]
|
||||||
params {
|
params {
|
||||||
@out r: Evas_Real; [[Pointer to receive red component of the background color.]]
|
@out r: Evas.Real; [[Pointer to receive red component of the background color.]]
|
||||||
@out g: Evas_Real; [[Pointer to receive green component of the background color.]]
|
@out g: Evas.Real; [[Pointer to receive green component of the background color.]]
|
||||||
@out b: Evas_Real; [[Pointer to receive blue component of the background color.]]
|
@out b: Evas.Real; [[Pointer to receive blue component of the background color.]]
|
||||||
@out a: Evas_Real; [[Pointer to receive alpha component of the background color.]]
|
@out a: Evas.Real; [[Pointer to receive alpha component of the background color.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,12 +65,12 @@ class Evas.Canvas3D.Scene (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
]]
|
]]
|
||||||
return: bool;
|
return: bool;
|
||||||
params {
|
params {
|
||||||
@in x: Evas_Real; [[X coordinate of the picking position.]]
|
@in x: Evas.Real; [[X coordinate of the picking position.]]
|
||||||
@in y: Evas_Real; [[Y coordinate of the picking position.]]
|
@in y: Evas.Real; [[Y coordinate of the picking position.]]
|
||||||
@out node: Evas.Canvas3D.Node *; [[Pointer to receive the node contains the picked mesh.]]
|
@out node: Evas.Canvas3D.Node *; [[Pointer to receive the node contains the picked mesh.]]
|
||||||
@out mesh: Evas.Canvas3D.Mesh *; [[Pointer to receive the picked mesh.]]
|
@out mesh: Evas.Canvas3D.Mesh *; [[Pointer to receive the picked mesh.]]
|
||||||
@out s: Evas_Real; [[Pointer to receive the texture "s" coordinate.]]
|
@out s: Evas.Real; [[Pointer to receive the texture "s" coordinate.]]
|
||||||
@out t: Evas_Real; [[Pointer to receive the texture "t" coordinate.]]
|
@out t: Evas.Real; [[Pointer to receive the texture "t" coordinate.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,8 +78,8 @@ class Evas.Canvas3D.Scene (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
[[Search given node in the given position.]]
|
[[Search given node in the given position.]]
|
||||||
return: Evas.Canvas3D.Node *;
|
return: Evas.Canvas3D.Node *;
|
||||||
params {
|
params {
|
||||||
@in x: Evas_Real; [[X coordinate of the picking position.]]
|
@in x: Evas.Real; [[X coordinate of the picking position.]]
|
||||||
@in y: Evas_Real; [[Y coordinate of the picking position.]]
|
@in y: Evas.Real; [[Y coordinate of the picking position.]]
|
||||||
@in node: Evas.Canvas3D.Node *; [[Node for search.]]
|
@in node: Evas.Canvas3D.Node *; [[Node for search.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,8 +88,8 @@ class Evas.Canvas3D.Scene (Evas.Canvas3D.Object, Evas.Common_Interface)
|
||||||
[[Get list of the all root members from scene in the given position.]]
|
[[Get list of the all root members from scene in the given position.]]
|
||||||
return: list<Evas.Canvas3D.Node *> *;
|
return: list<Evas.Canvas3D.Node *> *;
|
||||||
params {
|
params {
|
||||||
@in x: Evas_Real; [[X coordinate of the picking position.]]
|
@in x: Evas.Real; [[X coordinate of the picking position.]]
|
||||||
@in y: Evas_Real; [[Y coordinate of the picking position.]]
|
@in y: Evas.Real; [[Y coordinate of the picking position.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
shadows_enable_set {
|
shadows_enable_set {
|
||||||
|
|
|
@ -229,3 +229,283 @@ struct Evas.Engine_Info; [[A generic Evas Engine information structure]]
|
||||||
struct Evas.Axis; [[Details for a single device axis state
|
struct Evas.Axis; [[Details for a single device axis state
|
||||||
|
|
||||||
@since 1.13]]
|
@since 1.13]]
|
||||||
|
|
||||||
|
type Evas.Real: double; [[A type for floating value]]
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Object_Type
|
||||||
|
{
|
||||||
|
[[Type of 3D Object
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
invalid = 0,
|
||||||
|
scene,
|
||||||
|
node,
|
||||||
|
camera,
|
||||||
|
light,
|
||||||
|
model,
|
||||||
|
mesh,
|
||||||
|
texture,
|
||||||
|
material,
|
||||||
|
primitive [[@since 1.15]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.State
|
||||||
|
{
|
||||||
|
[[State of the Evas 3D
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
max = 16,
|
||||||
|
|
||||||
|
any = 0,
|
||||||
|
|
||||||
|
scene_root_node = 1,
|
||||||
|
scene_camera_node,
|
||||||
|
scene_background_color,
|
||||||
|
scene_size,
|
||||||
|
scene_shadows_enabled,
|
||||||
|
scene_updated, [[@since 1.14]]
|
||||||
|
|
||||||
|
texture_data = 1,
|
||||||
|
texture_wrap,
|
||||||
|
texture_filter,
|
||||||
|
|
||||||
|
material_id = 1,
|
||||||
|
material_color,
|
||||||
|
material_texture,
|
||||||
|
|
||||||
|
mesh_vertex_count = 1,
|
||||||
|
mesh_frame,
|
||||||
|
mesh_material,
|
||||||
|
mesh_transform,
|
||||||
|
mesh_vertex_data,
|
||||||
|
mesh_index_data,
|
||||||
|
mesh_vertex_assembly,
|
||||||
|
mesh_shade_mode,
|
||||||
|
mesh_fog,
|
||||||
|
mesh_blending,
|
||||||
|
mesh_alpha_test,
|
||||||
|
mesh_color_pick,
|
||||||
|
|
||||||
|
camera_projection = 1,
|
||||||
|
|
||||||
|
light_ambient = 1,
|
||||||
|
light_diffuse,
|
||||||
|
light_specular,
|
||||||
|
light_spot_dir,
|
||||||
|
light_spot_exp,
|
||||||
|
light_spot_cutoff,
|
||||||
|
light_attenuation,
|
||||||
|
light_projection,
|
||||||
|
|
||||||
|
node_transform_position = 1,
|
||||||
|
node_transform_orientation,
|
||||||
|
node_transform_scale,
|
||||||
|
node_mesh_geometry,
|
||||||
|
node_mesh_material,
|
||||||
|
node_mesh_frame,
|
||||||
|
node_mesh_shade_mode,
|
||||||
|
node_mesh_material_id,
|
||||||
|
node_light,
|
||||||
|
node_camera,
|
||||||
|
node_parent_position,
|
||||||
|
node_parent_orientation,
|
||||||
|
node_parent_scale,
|
||||||
|
node_member,
|
||||||
|
node_parent_billboard [[@since 1.14]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Space
|
||||||
|
{
|
||||||
|
[[Transform space
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
local = 0, [[Local coordinate space]]
|
||||||
|
parent, [[Parent coordinate space]]
|
||||||
|
world [[World coordinate space]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Node_Type
|
||||||
|
{
|
||||||
|
[[Types of a node
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
node = 0, [[Node with no items]]
|
||||||
|
camera, [[Node which can contain camera object]]
|
||||||
|
light, [[Node which can contain light object]]
|
||||||
|
mesh [[Node which can contain mesh objects]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Node_Orientation_Type
|
||||||
|
{
|
||||||
|
[[Types of node orientation
|
||||||
|
|
||||||
|
@since 1.13]]
|
||||||
|
none = 0, [[Node with no orientation properties]]
|
||||||
|
look_at, [[Node orientation is given as a point to look at and a vector that indicates the angle at which the subject is looking at the point]]
|
||||||
|
look_to, [[Node orientation is given as id of another part to look at and a vector that indicates the angle at which the subject is looking at the part]]
|
||||||
|
angle_axis, [[Node orientation is given as an angle and an axis to rotate around]]
|
||||||
|
quaternion [[Node orientation is given as a quaternion]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Index_Format
|
||||||
|
{
|
||||||
|
[[Index formats
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
none = 0, [[Indexing is not used]]
|
||||||
|
unsigned_byte, [[Index is of type unsigned byte]]
|
||||||
|
unsigned_short [[Index is of type unsigned short]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Frustum_Mode
|
||||||
|
{
|
||||||
|
[[Frustum modes
|
||||||
|
|
||||||
|
@since 1.12]]
|
||||||
|
bsphere, [[Bounding sphere]]
|
||||||
|
aabb, [[Axis-aligned bounding box]]
|
||||||
|
central_point
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Vertex_Assembly
|
||||||
|
{
|
||||||
|
[[Vertex assembly modes. Vertex assembly represents how the vertices are organized into geometric primitives.
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
points = 0, [[A vertex is rendered as a point]]
|
||||||
|
lines, [[Two vertices are organized as a line]]
|
||||||
|
line_strip, [[Vertices are organized as a connected line path]]
|
||||||
|
line_loop, [[Vertices are organized as a closed line path]]
|
||||||
|
triangles, [[Three vertices are organized as a triangle]]
|
||||||
|
triangle_strip, [[Vertices are organized as connected triangles]]
|
||||||
|
triangle_fan [[Vertices are organized as a triangle fan]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Comparison
|
||||||
|
{
|
||||||
|
[[Comparsion functions for testing(alpha, depth, stencil) in fragment shader
|
||||||
|
|
||||||
|
@since 1.14]]
|
||||||
|
never, [[Never passes]]
|
||||||
|
less, [[Passes if the incoming value is less than the reference value]]
|
||||||
|
equal, [[Passes if the incoming value is equal to the reference value]]
|
||||||
|
lequal, [[Passes if the incoming value is less than or equal to the reference value]]
|
||||||
|
greater, [[Passes if the incoming value is greater than the reference value]]
|
||||||
|
notequal, [[Passes if the incoming value is not equal to the reference value]]
|
||||||
|
gequal, [[Passes if the incoming value is greater than or equal to the reference value]]
|
||||||
|
always [[Always passes (initial value)]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Wrap_Mode
|
||||||
|
{
|
||||||
|
[[Wrap modes for texture units
|
||||||
|
|
||||||
|
@since 1.14]]
|
||||||
|
clamp = 0, [[Values will be clamped to be in range (min, max)]]
|
||||||
|
repeat, [[Values will be repeated]]
|
||||||
|
reflect [[Values will be repeated in a reflected manner]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Texture_Filter
|
||||||
|
{
|
||||||
|
[[Filters for texture units
|
||||||
|
|
||||||
|
@since 1.14]]
|
||||||
|
nearest = 0, [[Samples nearest texel]]
|
||||||
|
linear, [[Lineary interpolate nearby texels]]
|
||||||
|
nearest_mipmap_nearest, [[Nearest sampling mipmap]]
|
||||||
|
linear_mipmap_nearest, [[Nearest sampling mipmap and interpolate]]
|
||||||
|
nearest_mipmap_linear, [[Linear sampling in nearest mipmap]]
|
||||||
|
linear_mipmap_linear [[Linear sampling in mipmap and interpolate]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Mesh_Primitive
|
||||||
|
{
|
||||||
|
[[Mesh primitive
|
||||||
|
|
||||||
|
@since 1.12]]
|
||||||
|
none = 0, [[An empty space]]
|
||||||
|
square, [[One sided square]]
|
||||||
|
cube,
|
||||||
|
cylinder, [[Cylinder (can use precision and texture scale)]]
|
||||||
|
cone, [[Cone (can use precision and texture scale)]]
|
||||||
|
sphere, [[Sphere (can use precision and texture scale)]]
|
||||||
|
torus, [[Torus (can use ratio, precision and texture scale)]]
|
||||||
|
surface, [[Custom surface (can use pointer to users function, precision and texture scale)]]
|
||||||
|
terrain, [[Terrain as surface with pointer to perlin's noise function]]
|
||||||
|
count
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Primitive_Mode
|
||||||
|
{
|
||||||
|
[[Mode of mesh primitive
|
||||||
|
|
||||||
|
@since 1.15]]
|
||||||
|
default = 0, [[Default mode of primitive]]
|
||||||
|
without_base, [[Primitive without base (supported for cylinder and cone)]]
|
||||||
|
alternative_uv [[Ptimitive with alternative uv (supported for sphere)]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Shade_Mode
|
||||||
|
{
|
||||||
|
[[Shader shade modes
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
vertex_color = 0, [[Shaded using vertex color attribute]]
|
||||||
|
diffuse, [[Shaded using material diffuse term]]
|
||||||
|
flat, [[Per-vertex flat lighting]]
|
||||||
|
phong, [[Per-pixel phong shading]]
|
||||||
|
normal_map, [[Per-pixel normal map shading]]
|
||||||
|
shadow_map_render, [[Fragment color is defined by its z-coord]]
|
||||||
|
color_pick, [[Rendering to additional frame bufer]]
|
||||||
|
parallax_occlusion [[Per-pixel parallax occlusion map shading]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Vertex_Attrib
|
||||||
|
{
|
||||||
|
[[Vertex attribute IDs
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
position = 0, [[vertex position]]
|
||||||
|
normal, [[vertex normal]]
|
||||||
|
tangent, [[vertex tangent (for normal mapping)]]
|
||||||
|
color, [[vertex color]]
|
||||||
|
texcoord [[vertex texture coordinate]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Blend_Func
|
||||||
|
{
|
||||||
|
[[Blending function
|
||||||
|
|
||||||
|
@since 1.14]]
|
||||||
|
|
||||||
|
zero = 0, [[The scale factors for color components is (0, 0, 0, 0)]]
|
||||||
|
one, [[The scale factors for color components is (1, 1, 1, 1)]]
|
||||||
|
src_color, [[The scale factors for color components is (rs/kr, gs/kg, bs/kb, as/ka)]]
|
||||||
|
one_minus_src_color, [[The scale factors for color components is (1, 1, 1, 1) - (rs/kr, gs/kg, bs/kb, as/ka)]]
|
||||||
|
dst_color, [[The scale factors for color components is (rd/kr, gd/kg, bd/kb, ad/ka)]]
|
||||||
|
one_minus_dst_color, [[The scale factors for color components is (1, 1, 1, 1) - (rd/kr, gd/kg, bd/kb, ad/ka)]]
|
||||||
|
src_alpha, [[The scale factors for color components is (as/ka, as/ka, as/ka, as/ka)]]
|
||||||
|
one_minus_src_alpha, [[The scale factors for color components is (1, 1, 1, 1) - (as/ka, as/ka, as/ka, as/ka)]]
|
||||||
|
dst_alpha, [[The scale factors for color components is (ad/ka, ad/ka, ad/ka, ad/ka)]]
|
||||||
|
one_minus_dst_alpha, [[The scale factors for color components is (1, 1, 1, 1) - (ad/ka, ad/ka, ad/ka, ad/ka)]]
|
||||||
|
constant_color, [[The scale factors for color components is (rc, gc, bc, ac)]]
|
||||||
|
one_minus_constant_color, [[The scale factors for color components is (1, 1, 1, 1) - (rc, gc, bc, ac)]]
|
||||||
|
constant_alpha, [[The scale factors for color components is (ac, ac, ac, ac)]]
|
||||||
|
one_minus_constant_alpha, [[The scale factors for color components is (1, 1, 1, 1) - (ac, ac, ac, ac)]]
|
||||||
|
src_alpha_saturate [[The scale factors for color components is (i, i, i, 1) where i = min(as, ka, ad)/ka]]
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Evas.Canvas3D.Material_Attrib
|
||||||
|
{
|
||||||
|
[[Material attributes
|
||||||
|
|
||||||
|
@since 1.10]]
|
||||||
|
ambient = 0, [[ambient term]]
|
||||||
|
diffuse, [[diffuse term]]
|
||||||
|
specular, [[specular term]]
|
||||||
|
emission, [[emission term]]
|
||||||
|
normal [[Normal map term]]
|
||||||
|
}
|
||||||
|
|
||||||
|
type Evas.Canvas3D.Surface_Func: __undefined_type;
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
evas_canvas3d_mesh_frame_add(frame), \
|
evas_canvas3d_mesh_frame_add(frame), \
|
||||||
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
|
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
|
||||||
icount, &indices[0])); \
|
icount, &indices[0])); \
|
||||||
_set_vec3_vertex_data(mesh, frame, vcount, vertices, EVAS_CANVAS3D_VERTEX_POSITION); \
|
_set_vec3_vertex_data(mesh, frame, vcount, vertices, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION); \
|
||||||
_set_vec3_vertex_data(mesh, frame, vcount, normals, EVAS_CANVAS3D_VERTEX_NORMAL); \
|
_set_vec3_vertex_data(mesh, frame, vcount, normals, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL); \
|
||||||
_set_vec2_vertex_data(mesh, frame, vcount, tex_coord, EVAS_CANVAS3D_VERTEX_TEXCOORD); \
|
_set_vec2_vertex_data(mesh, frame, vcount, tex_coord, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD); \
|
||||||
_set_vec3_vertex_data(mesh, frame, vcount, tangents, EVAS_CANVAS3D_VERTEX_TANGENT); \
|
_set_vec3_vertex_data(mesh, frame, vcount, tangents, EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT); \
|
||||||
free(indices);
|
free(indices);
|
||||||
|
|
||||||
#define SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, varray, vcount, indices, icount) \
|
#define SET_VERTEX_DATA_FROM_ARRAY(mesh, frame, varray, vcount, indices, icount) \
|
||||||
|
@ -34,15 +34,15 @@
|
||||||
evas_canvas3d_mesh_frame_add(frame), \
|
evas_canvas3d_mesh_frame_add(frame), \
|
||||||
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
|
evas_canvas3d_mesh_index_data_copy_set(EVAS_CANVAS3D_INDEX_FORMAT_UNSIGNED_SHORT, \
|
||||||
icount, &indices[0])); \
|
icount, &indices[0])); \
|
||||||
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_POSITION, \
|
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, \
|
||||||
0, 3, 15, vcount); \
|
0, 3, 15, vcount); \
|
||||||
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_NORMAL, \
|
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, \
|
||||||
3, 3, 15, vcount); \
|
3, 3, 15, vcount); \
|
||||||
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_COLOR, \
|
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR, \
|
||||||
6, 4, 15, vcount); \
|
6, 4, 15, vcount); \
|
||||||
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_TEXCOORD, \
|
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, \
|
||||||
10, 2, 15, vcount); \
|
10, 2, 15, vcount); \
|
||||||
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_TANGENT, \
|
_set_vertex_data_from_array(mesh, frame, varray, EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT, \
|
||||||
12, 3, 15, vcount);
|
12, 3, 15, vcount);
|
||||||
|
|
||||||
void _generate_indices(unsigned short *indices, int count, int width);
|
void _generate_indices(unsigned short *indices, int count, int width);
|
||||||
|
|
|
@ -558,31 +558,31 @@ _vertex_attrib_flag_add(E3D_Draw_Data *data,
|
||||||
{
|
{
|
||||||
switch (attrib)
|
switch (attrib)
|
||||||
{
|
{
|
||||||
case EVAS_CANVAS3D_VERTEX_POSITION:
|
case EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION:
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_POSITION;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_POSITION;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_POSITION_BLEND;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_POSITION_BLEND;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_VERTEX_NORMAL:
|
case EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL:
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_NORMAL;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_NORMAL;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_NORMAL_BLEND;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_NORMAL_BLEND;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_VERTEX_TANGENT:
|
case EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT:
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_TANGENT;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_TANGENT;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_TANGENT_BLEND;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_TANGENT_BLEND;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_VERTEX_COLOR:
|
case EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR:
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_COLOR;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_COLOR;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_COLOR_BLEND;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_COLOR_BLEND;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_VERTEX_TEXCOORD:
|
case EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD:
|
||||||
data->flags |= E3D_SHADER_FLAG_VERTEX_TEXCOORD;
|
data->flags |= E3D_SHADER_FLAG_VERTEX_TEXCOORD;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
|
@ -599,19 +599,19 @@ _material_color_flag_add(E3D_Draw_Data *data, Evas_Canvas3D_Material_Attrib attr
|
||||||
{
|
{
|
||||||
switch (attrib)
|
switch (attrib)
|
||||||
{
|
{
|
||||||
case EVAS_CANVAS3D_MATERIAL_AMBIENT:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT:
|
||||||
data->flags |= E3D_SHADER_FLAG_AMBIENT;
|
data->flags |= E3D_SHADER_FLAG_AMBIENT;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_MATERIAL_DIFFUSE:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE:
|
||||||
data->flags |= E3D_SHADER_FLAG_DIFFUSE;
|
data->flags |= E3D_SHADER_FLAG_DIFFUSE;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_MATERIAL_SPECULAR:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR:
|
||||||
data->flags |= E3D_SHADER_FLAG_SPECULAR;
|
data->flags |= E3D_SHADER_FLAG_SPECULAR;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_MATERIAL_EMISSION:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION:
|
||||||
data->flags |= E3D_SHADER_FLAG_EMISSION;
|
data->flags |= E3D_SHADER_FLAG_EMISSION;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_MATERIAL_NORMAL:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL:
|
||||||
ERR("Material attribute normal should not be used with color values.");
|
ERR("Material attribute normal should not be used with color values.");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -625,35 +625,35 @@ _material_texture_flag_add(E3D_Draw_Data *data, Evas_Canvas3D_Material_Attrib at
|
||||||
{
|
{
|
||||||
switch (attrib)
|
switch (attrib)
|
||||||
{
|
{
|
||||||
case EVAS_CANVAS3D_MATERIAL_AMBIENT:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT:
|
||||||
data->flags |= E3D_SHADER_FLAG_AMBIENT;
|
data->flags |= E3D_SHADER_FLAG_AMBIENT;
|
||||||
data->flags |= E3D_SHADER_FLAG_AMBIENT_TEXTURE;
|
data->flags |= E3D_SHADER_FLAG_AMBIENT_TEXTURE;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
data->flags |= E3D_SHADER_FLAG_AMBIENT_TEXTURE_BLEND;
|
data->flags |= E3D_SHADER_FLAG_AMBIENT_TEXTURE_BLEND;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_MATERIAL_DIFFUSE:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE:
|
||||||
data->flags |= E3D_SHADER_FLAG_DIFFUSE;
|
data->flags |= E3D_SHADER_FLAG_DIFFUSE;
|
||||||
data->flags |= E3D_SHADER_FLAG_DIFFUSE_TEXTURE;
|
data->flags |= E3D_SHADER_FLAG_DIFFUSE_TEXTURE;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
data->flags |= E3D_SHADER_FLAG_DIFFUSE_TEXTURE_BLEND;
|
data->flags |= E3D_SHADER_FLAG_DIFFUSE_TEXTURE_BLEND;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_MATERIAL_SPECULAR:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR:
|
||||||
data->flags |= E3D_SHADER_FLAG_SPECULAR;
|
data->flags |= E3D_SHADER_FLAG_SPECULAR;
|
||||||
data->flags |= E3D_SHADER_FLAG_SPECULAR_TEXTURE;
|
data->flags |= E3D_SHADER_FLAG_SPECULAR_TEXTURE;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
data->flags |= E3D_SHADER_FLAG_SPECULAR_TEXTURE_BLEND;
|
data->flags |= E3D_SHADER_FLAG_SPECULAR_TEXTURE_BLEND;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_MATERIAL_EMISSION:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION:
|
||||||
data->flags |= E3D_SHADER_FLAG_EMISSION;
|
data->flags |= E3D_SHADER_FLAG_EMISSION;
|
||||||
data->flags |= E3D_SHADER_FLAG_EMISSION_TEXTURE;
|
data->flags |= E3D_SHADER_FLAG_EMISSION_TEXTURE;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
data->flags |= E3D_SHADER_FLAG_EMISSION_TEXTURE_BLEND;
|
data->flags |= E3D_SHADER_FLAG_EMISSION_TEXTURE_BLEND;
|
||||||
break;
|
break;
|
||||||
case EVAS_CANVAS3D_MATERIAL_NORMAL:
|
case EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL:
|
||||||
data->flags |= E3D_SHADER_FLAG_NORMAL_TEXTURE;
|
data->flags |= E3D_SHADER_FLAG_NORMAL_TEXTURE;
|
||||||
|
|
||||||
if (blend)
|
if (blend)
|
||||||
|
@ -795,7 +795,7 @@ _material_color_build(E3D_Draw_Data *data, int frame,
|
||||||
{
|
{
|
||||||
data->materials[attrib].color = pdmf0->attribs[attrib].color;
|
data->materials[attrib].color = pdmf0->attribs[attrib].color;
|
||||||
|
|
||||||
if (attrib == EVAS_CANVAS3D_MATERIAL_SPECULAR)
|
if (attrib == EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR)
|
||||||
data->shininess = pdmf0->shininess;
|
data->shininess = pdmf0->shininess;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -809,7 +809,7 @@ _material_color_build(E3D_Draw_Data *data, int frame,
|
||||||
&pdmf0->attribs[attrib].color,
|
&pdmf0->attribs[attrib].color,
|
||||||
weight);
|
weight);
|
||||||
|
|
||||||
if (attrib == EVAS_CANVAS3D_MATERIAL_SPECULAR)
|
if (attrib == EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR)
|
||||||
{
|
{
|
||||||
data->shininess = pdmf0->shininess * weight +
|
data->shininess = pdmf0->shininess * weight +
|
||||||
pdmf1->shininess * (1.0 - weight);
|
pdmf1->shininess * (1.0 - weight);
|
||||||
|
@ -894,7 +894,7 @@ _material_texture_build(E3D_Draw_Data *data, int frame,
|
||||||
|
|
||||||
data->materials[attrib].texture_weight = weight;
|
data->materials[attrib].texture_weight = weight;
|
||||||
|
|
||||||
if (attrib == EVAS_CANVAS3D_MATERIAL_SPECULAR)
|
if (attrib == EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR)
|
||||||
{
|
{
|
||||||
data->shininess = pdmf0->shininess * weight +
|
data->shininess = pdmf0->shininess * weight +
|
||||||
pdmf1->shininess * (1.0 - weight);
|
pdmf1->shininess * (1.0 - weight);
|
||||||
|
@ -904,7 +904,7 @@ _material_texture_build(E3D_Draw_Data *data, int frame,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (attrib == EVAS_CANVAS3D_MATERIAL_SPECULAR)
|
if (attrib == EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR)
|
||||||
data->shininess = pdmf0->shininess;
|
data->shininess = pdmf0->shininess;
|
||||||
|
|
||||||
_material_texture_flag_add(data, attrib, EINA_FALSE);
|
_material_texture_flag_add(data, attrib, EINA_FALSE);
|
||||||
|
@ -1043,98 +1043,98 @@ _mesh_draw_data_build(E3D_Draw_Data *data,
|
||||||
|
|
||||||
if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR)
|
if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_VERTEX_COLOR)
|
||||||
{
|
{
|
||||||
BUILD(vertex_attrib, VERTEX_POSITION, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_POSITION, EINA_TRUE);
|
||||||
BUILD(vertex_attrib, VERTEX_COLOR, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_COLOR, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_SHADOW_MAP_RENDER)
|
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_SHADOW_MAP_RENDER)
|
||||||
{
|
{
|
||||||
BUILD(vertex_attrib, VERTEX_POSITION, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_POSITION, EINA_TRUE);
|
||||||
if (pdmesh->alpha_test_enabled)
|
if (pdmesh->alpha_test_enabled)
|
||||||
{
|
{
|
||||||
BUILD(material_texture, MATERIAL_DIFFUSE, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_DIFFUSE, EINA_FALSE);
|
||||||
|
|
||||||
if (_flags_need_tex_coord(data->flags))
|
if (_flags_need_tex_coord(data->flags))
|
||||||
BUILD(vertex_attrib, VERTEX_TEXCOORD, EINA_FALSE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_TEXCOORD, EINA_FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_COLOR_PICK)
|
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_COLOR_PICK)
|
||||||
{
|
{
|
||||||
BUILD(vertex_attrib, VERTEX_POSITION, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_POSITION, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_DIFFUSE)
|
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_DIFFUSE)
|
||||||
{
|
{
|
||||||
BUILD(vertex_attrib, VERTEX_POSITION, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_POSITION, EINA_TRUE);
|
||||||
BUILD(material_color, MATERIAL_DIFFUSE, EINA_TRUE);
|
BUILD(material_color, MATERIAL_ATTRIB_DIFFUSE, EINA_TRUE);
|
||||||
BUILD(material_texture, MATERIAL_DIFFUSE, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_DIFFUSE, EINA_FALSE);
|
||||||
|
|
||||||
if (_flags_need_tex_coord(data->flags))
|
if (_flags_need_tex_coord(data->flags))
|
||||||
BUILD(vertex_attrib, VERTEX_TEXCOORD, EINA_FALSE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_TEXCOORD, EINA_FALSE);
|
||||||
}
|
}
|
||||||
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_FLAT)
|
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_FLAT)
|
||||||
{
|
{
|
||||||
BUILD(vertex_attrib, VERTEX_POSITION, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_POSITION, EINA_TRUE);
|
||||||
BUILD(vertex_attrib, VERTEX_NORMAL, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_NORMAL, EINA_TRUE);
|
||||||
|
|
||||||
BUILD(material_color, MATERIAL_AMBIENT, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_AMBIENT, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_DIFFUSE, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_DIFFUSE, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_SPECULAR, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_SPECULAR, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_EMISSION, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_EMISSION, EINA_FALSE);
|
||||||
|
|
||||||
BUILD(material_texture, MATERIAL_AMBIENT, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_AMBIENT, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_DIFFUSE, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_DIFFUSE, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_SPECULAR, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_SPECULAR, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_EMISSION, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_EMISSION, EINA_FALSE);
|
||||||
|
|
||||||
_light_build(data, light, matrix_eye);
|
_light_build(data, light, matrix_eye);
|
||||||
evas_normal_matrix_get(&data->matrix_normal, matrix_mv);
|
evas_normal_matrix_get(&data->matrix_normal, matrix_mv);
|
||||||
|
|
||||||
if (_flags_need_tex_coord(data->flags))
|
if (_flags_need_tex_coord(data->flags))
|
||||||
BUILD(vertex_attrib, VERTEX_TEXCOORD, EINA_FALSE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_TEXCOORD, EINA_FALSE);
|
||||||
}
|
}
|
||||||
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_PHONG)
|
else if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_PHONG)
|
||||||
{
|
{
|
||||||
BUILD(vertex_attrib, VERTEX_POSITION, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_POSITION, EINA_TRUE);
|
||||||
BUILD(vertex_attrib, VERTEX_NORMAL, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_NORMAL, EINA_TRUE);
|
||||||
|
|
||||||
BUILD(material_color, MATERIAL_AMBIENT, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_AMBIENT, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_DIFFUSE, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_DIFFUSE, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_SPECULAR, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_SPECULAR, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_EMISSION, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_EMISSION, EINA_FALSE);
|
||||||
|
|
||||||
BUILD(material_texture, MATERIAL_AMBIENT, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_AMBIENT, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_DIFFUSE, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_DIFFUSE, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_SPECULAR, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_SPECULAR, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_EMISSION, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_EMISSION, EINA_FALSE);
|
||||||
|
|
||||||
_light_build(data, light, matrix_eye);
|
_light_build(data, light, matrix_eye);
|
||||||
evas_normal_matrix_get(&data->matrix_normal, matrix_mv);
|
evas_normal_matrix_get(&data->matrix_normal, matrix_mv);
|
||||||
|
|
||||||
if (_flags_need_tex_coord(data->flags))
|
if (_flags_need_tex_coord(data->flags))
|
||||||
BUILD(vertex_attrib, VERTEX_TEXCOORD, EINA_FALSE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_TEXCOORD, EINA_FALSE);
|
||||||
}
|
}
|
||||||
else if ((pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP) ||
|
else if ((pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP) ||
|
||||||
(pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_PARALLAX_OCCLUSION))
|
(pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_PARALLAX_OCCLUSION))
|
||||||
{
|
{
|
||||||
BUILD(vertex_attrib, VERTEX_POSITION, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_POSITION, EINA_TRUE);
|
||||||
BUILD(vertex_attrib, VERTEX_NORMAL, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_NORMAL, EINA_TRUE);
|
||||||
BUILD(vertex_attrib, VERTEX_TEXCOORD, EINA_TRUE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_TEXCOORD, EINA_TRUE);
|
||||||
BUILD(material_texture, MATERIAL_NORMAL, EINA_TRUE);
|
BUILD(material_texture, MATERIAL_ATTRIB_NORMAL, EINA_TRUE);
|
||||||
BUILD(vertex_attrib, VERTEX_TANGENT, EINA_FALSE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_TANGENT, EINA_FALSE);
|
||||||
|
|
||||||
|
|
||||||
if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP)
|
if (pdmesh->shade_mode == EVAS_CANVAS3D_SHADE_MODE_NORMAL_MAP)
|
||||||
BUILD(vertex_attrib, VERTEX_TANGENT, EINA_FALSE);
|
BUILD(vertex_attrib, VERTEX_ATTRIB_TANGENT, EINA_FALSE);
|
||||||
else BUILD(vertex_attrib, VERTEX_TANGENT, EINA_TRUE);
|
else BUILD(vertex_attrib, VERTEX_ATTRIB_TANGENT, EINA_TRUE);
|
||||||
|
|
||||||
BUILD(material_color, MATERIAL_AMBIENT, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_AMBIENT, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_DIFFUSE, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_DIFFUSE, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_SPECULAR, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_SPECULAR, EINA_FALSE);
|
||||||
BUILD(material_color, MATERIAL_EMISSION, EINA_FALSE);
|
BUILD(material_color, MATERIAL_ATTRIB_EMISSION, EINA_FALSE);
|
||||||
|
|
||||||
BUILD(material_texture, MATERIAL_AMBIENT, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_AMBIENT, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_DIFFUSE, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_DIFFUSE, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_SPECULAR, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_SPECULAR, EINA_FALSE);
|
||||||
BUILD(material_texture, MATERIAL_EMISSION, EINA_FALSE);
|
BUILD(material_texture, MATERIAL_ATTRIB_EMISSION, EINA_FALSE);
|
||||||
|
|
||||||
_light_build(data, light, matrix_eye);
|
_light_build(data, light, matrix_eye);
|
||||||
evas_normal_matrix_get(&data->matrix_normal, matrix_mv);
|
evas_normal_matrix_get(&data->matrix_normal, matrix_mv);
|
||||||
|
|
|
@ -47,35 +47,35 @@ _gl_blend_func_get(Evas_Canvas3D_Blend_Func blend_func)
|
||||||
{
|
{
|
||||||
switch (blend_func)
|
switch (blend_func)
|
||||||
{
|
{
|
||||||
case EVAS_CANVAS3D_BLEND_ZERO:
|
case EVAS_CANVAS3D_BLEND_FUNC_ZERO:
|
||||||
return GL_ZERO;
|
return GL_ZERO;
|
||||||
case EVAS_CANVAS3D_BLEND_ONE:
|
case EVAS_CANVAS3D_BLEND_FUNC_ONE:
|
||||||
return GL_ONE;
|
return GL_ONE;
|
||||||
case EVAS_CANVAS3D_BLEND_SRC_COLOR:
|
case EVAS_CANVAS3D_BLEND_FUNC_SRC_COLOR:
|
||||||
return GL_SRC_COLOR;
|
return GL_SRC_COLOR;
|
||||||
case EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_COLOR:
|
case EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_COLOR:
|
||||||
return GL_ONE_MINUS_SRC_COLOR;
|
return GL_ONE_MINUS_SRC_COLOR;
|
||||||
case EVAS_CANVAS3D_BLEND_DST_COLOR:
|
case EVAS_CANVAS3D_BLEND_FUNC_DST_COLOR:
|
||||||
return GL_DST_COLOR;
|
return GL_DST_COLOR;
|
||||||
case EVAS_CANVAS3D_BLEND_ONE_MINUS_DST_COLOR:
|
case EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_DST_COLOR:
|
||||||
return GL_ONE_MINUS_DST_COLOR;
|
return GL_ONE_MINUS_DST_COLOR;
|
||||||
case EVAS_CANVAS3D_BLEND_SRC_ALPHA:
|
case EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA:
|
||||||
return GL_SRC_ALPHA;
|
return GL_SRC_ALPHA;
|
||||||
case EVAS_CANVAS3D_BLEND_ONE_MINUS_SRC_ALPHA:
|
case EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_SRC_ALPHA:
|
||||||
return GL_ONE_MINUS_SRC_ALPHA;
|
return GL_ONE_MINUS_SRC_ALPHA;
|
||||||
case EVAS_CANVAS3D_BLEND_DST_ALPHA:
|
case EVAS_CANVAS3D_BLEND_FUNC_DST_ALPHA:
|
||||||
return GL_DST_ALPHA;
|
return GL_DST_ALPHA;
|
||||||
case EVAS_CANVAS3D_BLEND_ONE_MINUS_DST_ALPHA:
|
case EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_DST_ALPHA:
|
||||||
return GL_ONE_MINUS_DST_ALPHA;
|
return GL_ONE_MINUS_DST_ALPHA;
|
||||||
case EVAS_CANVAS3D_BLEND_CONSTANT_COLOR:
|
case EVAS_CANVAS3D_BLEND_FUNC_CONSTANT_COLOR:
|
||||||
return GL_CONSTANT_COLOR;
|
return GL_CONSTANT_COLOR;
|
||||||
case EVAS_CANVAS3D_BLEND_ONE_MINUS_CONSTANT_COLOR:
|
case EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_CONSTANT_COLOR:
|
||||||
return GL_ONE_MINUS_CONSTANT_COLOR;
|
return GL_ONE_MINUS_CONSTANT_COLOR;
|
||||||
case EVAS_CANVAS3D_BLEND_CONSTANT_ALPHA:
|
case EVAS_CANVAS3D_BLEND_FUNC_CONSTANT_ALPHA:
|
||||||
return GL_CONSTANT_ALPHA;
|
return GL_CONSTANT_ALPHA;
|
||||||
case EVAS_CANVAS3D_BLEND_ONE_MINUS_CONSTANT_ALPHA:
|
case EVAS_CANVAS3D_BLEND_FUNC_ONE_MINUS_CONSTANT_ALPHA:
|
||||||
return GL_ONE_MINUS_CONSTANT_ALPHA;
|
return GL_ONE_MINUS_CONSTANT_ALPHA;
|
||||||
case EVAS_CANVAS3D_BLEND_SRC_ALPHA_SATURATE:
|
case EVAS_CANVAS3D_BLEND_FUNC_SRC_ALPHA_SATURATE:
|
||||||
return GL_SRC_ALPHA_SATURATE;
|
return GL_SRC_ALPHA_SATURATE;
|
||||||
default:
|
default:
|
||||||
return GL_ZERO;
|
return GL_ZERO;
|
||||||
|
|
|
@ -410,103 +410,103 @@ _uniform_upload(E3D_Uniform u, GLint loc, const E3D_Draw_Data *data)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_POSITION_WEIGHT:
|
case E3D_UNIFORM_POSITION_WEIGHT:
|
||||||
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_POSITION].weight);
|
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_NORMAL_WEIGHT:
|
case E3D_UNIFORM_NORMAL_WEIGHT:
|
||||||
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_NORMAL].weight);
|
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL].weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TANGENT_WEIGHT:
|
case E3D_UNIFORM_TANGENT_WEIGHT:
|
||||||
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_TANGENT].weight);
|
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TANGENT].weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_COLOR_WEIGHT:
|
case E3D_UNIFORM_COLOR_WEIGHT:
|
||||||
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_COLOR].weight);
|
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR].weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXCOORD_WEIGHT:
|
case E3D_UNIFORM_TEXCOORD_WEIGHT:
|
||||||
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_TEXCOORD].weight);
|
glUniform1f(loc, data->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD].weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_WEIGHT_AMBIENT:
|
case E3D_UNIFORM_TEXTURE_WEIGHT_AMBIENT:
|
||||||
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_AMBIENT].texture_weight);
|
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].texture_weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_WEIGHT_DIFFUSE:
|
case E3D_UNIFORM_TEXTURE_WEIGHT_DIFFUSE:
|
||||||
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_DIFFUSE].texture_weight);
|
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].texture_weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_WEIGHT_SPECULAR:
|
case E3D_UNIFORM_TEXTURE_WEIGHT_SPECULAR:
|
||||||
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_SPECULAR].texture_weight);
|
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].texture_weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_WEIGHT_EMISSION:
|
case E3D_UNIFORM_TEXTURE_WEIGHT_EMISSION:
|
||||||
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_EMISSION].texture_weight);
|
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].texture_weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_WEIGHT_NORMAL:
|
case E3D_UNIFORM_TEXTURE_WEIGHT_NORMAL:
|
||||||
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_NORMAL].texture_weight);
|
glUniform1f(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].texture_weight);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_AMBIENT0:
|
case E3D_UNIFORM_TEXTURE_AMBIENT0:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_AMBIENT].sampler0);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].sampler0);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_DIFFUSE0:
|
case E3D_UNIFORM_TEXTURE_DIFFUSE0:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_DIFFUSE].sampler0);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].sampler0);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_SPECULAR0:
|
case E3D_UNIFORM_TEXTURE_SPECULAR0:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_SPECULAR].sampler0);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].sampler0);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_EMISSION0:
|
case E3D_UNIFORM_TEXTURE_EMISSION0:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_EMISSION].sampler0);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].sampler0);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_NORMAL0:
|
case E3D_UNIFORM_TEXTURE_NORMAL0:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_NORMAL].sampler0);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].sampler0);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_AMBIENT1:
|
case E3D_UNIFORM_TEXTURE_AMBIENT1:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_AMBIENT].sampler1);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].sampler1);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_DIFFUSE1:
|
case E3D_UNIFORM_TEXTURE_DIFFUSE1:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_DIFFUSE].sampler1);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].sampler1);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_SPECULAR1:
|
case E3D_UNIFORM_TEXTURE_SPECULAR1:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_SPECULAR].sampler1);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].sampler1);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_EMISSION1:
|
case E3D_UNIFORM_TEXTURE_EMISSION1:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_EMISSION].sampler1);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].sampler1);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_NORMAL1:
|
case E3D_UNIFORM_TEXTURE_NORMAL1:
|
||||||
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_NORMAL].sampler1);
|
glUniform1i(loc, data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL].sampler1);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT0: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT0: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_AMBIENT, 0)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_DIFFUSE0: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_DIFFUSE0: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 0)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_SPECULAR0: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_SPECULAR0: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_SPECULAR, 0)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_EMISSION0: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_EMISSION0: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_EMISSION, 0)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION, 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_NORMAL0: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_NORMAL0: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_NORMAL, 0)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT1: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_AMBIENT1: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_AMBIENT, 1)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT, 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_DIFFUSE1: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_DIFFUSE1: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_DIFFUSE, 1)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE, 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_SPECULAR1: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_SPECULAR1: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_SPECULAR, 1)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR, 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_EMISSION1: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_EMISSION1: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_EMISSION, 1)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION, 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_NORMAL1: {
|
case E3D_UNIFORM_TEXTURE_MATRIX_TRANSFORM_NORMAL1: {
|
||||||
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_NORMAL, 1)
|
SET_TEX_COORD_TRANSFORM_MATRIX(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case E3D_UNIFORM_SHADOWMAP:
|
case E3D_UNIFORM_SHADOWMAP:
|
||||||
|
@ -545,31 +545,31 @@ _uniform_upload(E3D_Uniform u, GLint loc, const E3D_Draw_Data *data)
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_MATERIAL_AMBIENT:
|
case E3D_UNIFORM_MATERIAL_AMBIENT:
|
||||||
glUniform4f(loc,
|
glUniform4f(loc,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.r,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.r,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.g,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.g,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.b,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.b,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.a);
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.a);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_MATERIAL_DIFFUSE:
|
case E3D_UNIFORM_MATERIAL_DIFFUSE:
|
||||||
glUniform4f(loc,
|
glUniform4f(loc,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.r,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.r,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.g,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.g,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.b,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.b,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.a);
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.a);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_MATERIAL_SPECULAR:
|
case E3D_UNIFORM_MATERIAL_SPECULAR:
|
||||||
glUniform4f(loc,
|
glUniform4f(loc,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.r,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.r,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.g,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.g,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.b,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.b,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.a);
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.a);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_MATERIAL_EMISSION:
|
case E3D_UNIFORM_MATERIAL_EMISSION:
|
||||||
glUniform4f(loc,
|
glUniform4f(loc,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_EMISSION].color.r,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.r,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_EMISSION].color.g,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.g,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_EMISSION].color.b,
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.b,
|
||||||
data->materials[EVAS_CANVAS3D_MATERIAL_EMISSION].color.a);
|
data->materials[EVAS_CANVAS3D_MATERIAL_ATTRIB_EMISSION].color.a);
|
||||||
break;
|
break;
|
||||||
case E3D_UNIFORM_MATERIAL_SHININESS:
|
case E3D_UNIFORM_MATERIAL_SHININESS:
|
||||||
glUniform1f(loc, data->shininess);
|
glUniform1f(loc, data->shininess);
|
||||||
|
|
|
@ -23,17 +23,17 @@ _set_geometry_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh,
|
||||||
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES),
|
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES),
|
||||||
evas_canvas3d_mesh_frame_add(0),
|
evas_canvas3d_mesh_frame_add(0),
|
||||||
|
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_POSITION, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, NULL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_NORMAL, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 0, NULL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_TEXCOORD, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 0, NULL),
|
||||||
|
|
||||||
pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_POSITION),
|
pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_NORMAL),
|
nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_TEXCOORD),
|
tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD),
|
||||||
|
|
||||||
stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_POSITION),
|
stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_NORMAL),
|
stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_TEXCOORD));
|
stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD));
|
||||||
|
|
||||||
if (stride_pos == 0) stride_pos = sizeof(float) * 3;
|
if (stride_pos == 0) stride_pos = sizeof(float) * 3;
|
||||||
if (stride_nor == 0) stride_nor = sizeof(float) * 3;
|
if (stride_nor == 0) stride_nor = sizeof(float) * 3;
|
||||||
|
@ -62,9 +62,9 @@ _set_geometry_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh,
|
||||||
|
|
||||||
/* unmap vertex buffer */
|
/* unmap vertex buffer */
|
||||||
eo_do(mesh,
|
eo_do(mesh,
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_POSITION),
|
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_NORMAL),
|
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_TEXCOORD));
|
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -76,24 +76,24 @@ _set_material_to_mesh_from_eet_file(Evas_Canvas3D_Mesh *mesh,
|
||||||
material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, pd->evas);
|
material = eo_add(EVAS_CANVAS3D_MATERIAL_CLASS, pd->evas);
|
||||||
|
|
||||||
eo_do(material,
|
eo_do(material,
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
!!(eet_mesh->materials->colors[0].a > 0)),
|
!!(eet_mesh->materials->colors[0].a > 0)),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
!!(eet_mesh->materials->colors[1].a > 0)),
|
!!(eet_mesh->materials->colors[1].a > 0)),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
!!(eet_mesh->materials->colors[2].a > 0)),
|
!!(eet_mesh->materials->colors[2].a > 0)),
|
||||||
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_NORMAL, EINA_TRUE),
|
evas_canvas3d_material_enable_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_NORMAL, EINA_TRUE),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_AMBIENT,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT,
|
||||||
eet_mesh->materials->colors[0].r,
|
eet_mesh->materials->colors[0].r,
|
||||||
eet_mesh->materials->colors[0].g,
|
eet_mesh->materials->colors[0].g,
|
||||||
eet_mesh->materials->colors[0].b,
|
eet_mesh->materials->colors[0].b,
|
||||||
eet_mesh->materials->colors[0].a),
|
eet_mesh->materials->colors[0].a),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_DIFFUSE,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE,
|
||||||
eet_mesh->materials->colors[1].r,
|
eet_mesh->materials->colors[1].r,
|
||||||
eet_mesh->materials->colors[1].g,
|
eet_mesh->materials->colors[1].g,
|
||||||
eet_mesh->materials->colors[1].b,
|
eet_mesh->materials->colors[1].b,
|
||||||
eet_mesh->materials->colors[1].a),
|
eet_mesh->materials->colors[1].a),
|
||||||
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_SPECULAR,
|
evas_canvas3d_material_color_set(EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR,
|
||||||
eet_mesh->materials->colors[2].r,
|
eet_mesh->materials->colors[2].r,
|
||||||
eet_mesh->materials->colors[2].g,
|
eet_mesh->materials->colors[2].g,
|
||||||
eet_mesh->materials->colors[2].b,
|
eet_mesh->materials->colors[2].b,
|
||||||
|
|
|
@ -352,18 +352,18 @@ evas_model_load_file_md2(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
|
||||||
evas_canvas3d_mesh_frame_add(f),
|
evas_canvas3d_mesh_frame_add(f),
|
||||||
|
|
||||||
/* Allocate vertex buffer for the frame. */
|
/* Allocate vertex buffer for the frame. */
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(f, EVAS_CANVAS3D_VERTEX_POSITION, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, NULL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(f, EVAS_CANVAS3D_VERTEX_NORMAL, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 0, NULL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(f, EVAS_CANVAS3D_VERTEX_TEXCOORD, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 0, NULL),
|
||||||
|
|
||||||
/* Map vertex buffer. */
|
/* Map vertex buffer. */
|
||||||
pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(f, EVAS_CANVAS3D_VERTEX_POSITION),
|
pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(f, EVAS_CANVAS3D_VERTEX_NORMAL),
|
nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(f, EVAS_CANVAS3D_VERTEX_TEXCOORD),
|
tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD),
|
||||||
|
|
||||||
stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(f, EVAS_CANVAS3D_VERTEX_POSITION),
|
stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(f, EVAS_CANVAS3D_VERTEX_NORMAL),
|
stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(f, EVAS_CANVAS3D_VERTEX_TEXCOORD));
|
stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD));
|
||||||
|
|
||||||
if (stride_pos == 0)
|
if (stride_pos == 0)
|
||||||
stride_pos = sizeof(float) * 3;
|
stride_pos = sizeof(float) * 3;
|
||||||
|
@ -405,9 +405,9 @@ evas_model_load_file_md2(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
|
||||||
|
|
||||||
/* Unmap vertex buffer. */
|
/* Unmap vertex buffer. */
|
||||||
eo_do(mesh,
|
eo_do(mesh,
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(f, EVAS_CANVAS3D_VERTEX_POSITION),
|
evas_canvas3d_mesh_frame_vertex_data_unmap(f, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(f, EVAS_CANVAS3D_VERTEX_NORMAL),
|
evas_canvas3d_mesh_frame_vertex_data_unmap(f, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(f, EVAS_CANVAS3D_VERTEX_TEXCOORD));
|
evas_canvas3d_mesh_frame_vertex_data_unmap(f, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD));
|
||||||
|
|
||||||
pd = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS);
|
pd = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS);
|
||||||
|
|
||||||
|
|
|
@ -376,21 +376,21 @@ evas_model_load_file_obj(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
|
||||||
evas_canvas3d_mesh_vertex_count_set(counts._triangles_counter * 3),
|
evas_canvas3d_mesh_vertex_count_set(counts._triangles_counter * 3),
|
||||||
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES),
|
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES),
|
||||||
evas_canvas3d_mesh_frame_add(0),
|
evas_canvas3d_mesh_frame_add(0),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_POSITION, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, NULL),
|
||||||
pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_POSITION),
|
pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_POSITION));
|
stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION));
|
||||||
|
|
||||||
if (counts.existence_of_normal)
|
if (counts.existence_of_normal)
|
||||||
eo_do(mesh,
|
eo_do(mesh,
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_NORMAL, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 0, NULL),
|
||||||
nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_NORMAL),
|
nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_NORMAL));
|
stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL));
|
||||||
|
|
||||||
if (counts.existence_of_tex_point)
|
if (counts.existence_of_tex_point)
|
||||||
eo_do(mesh,
|
eo_do(mesh,
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_TEXCOORD, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 0, NULL),
|
||||||
tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_TEXCOORD),
|
tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD),
|
||||||
stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_TEXCOORD));
|
stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD));
|
||||||
|
|
||||||
if (stride_pos == 0) stride_pos = sizeof(float) * 3;
|
if (stride_pos == 0) stride_pos = sizeof(float) * 3;
|
||||||
if ((counts.existence_of_normal) && (stride_nor == 0))
|
if ((counts.existence_of_normal) && (stride_nor == 0))
|
||||||
|
@ -437,11 +437,11 @@ evas_model_load_file_obj(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
|
||||||
free(_triangles);
|
free(_triangles);
|
||||||
|
|
||||||
/* Unmap vertex buffer. */
|
/* Unmap vertex buffer. */
|
||||||
eo_do(mesh, evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_POSITION));
|
eo_do(mesh, evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION));
|
||||||
if (counts.existence_of_normal)
|
if (counts.existence_of_normal)
|
||||||
eo_do(mesh, evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_NORMAL));
|
eo_do(mesh, evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL));
|
||||||
if (counts.existence_of_tex_point)
|
if (counts.existence_of_tex_point)
|
||||||
eo_do(mesh, evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_TEXCOORD));
|
eo_do(mesh, evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD));
|
||||||
|
|
||||||
Evas_Canvas3D_Mesh_Data *pd = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS);
|
Evas_Canvas3D_Mesh_Data *pd = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS);
|
||||||
|
|
||||||
|
|
|
@ -278,20 +278,20 @@ evas_model_load_file_ply(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
|
||||||
evas_canvas3d_mesh_vertex_count_set(header.triangles_count * 3),
|
evas_canvas3d_mesh_vertex_count_set(header.triangles_count * 3),
|
||||||
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES),
|
evas_canvas3d_mesh_vertex_assembly_set(EVAS_CANVAS3D_VERTEX_ASSEMBLY_TRIANGLES),
|
||||||
evas_canvas3d_mesh_frame_add(0),
|
evas_canvas3d_mesh_frame_add(0),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_POSITION, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, 0, NULL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_NORMAL, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, 0, NULL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_TEXCOORD, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, 0, NULL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_COLOR, 0, NULL),
|
evas_canvas3d_mesh_frame_vertex_data_copy_set(0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR, 0, NULL),
|
||||||
|
|
||||||
pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_POSITION),
|
pos = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_NORMAL),
|
nor = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_TEXCOORD),
|
tex = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD),
|
||||||
col = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_COLOR),
|
col = (float *)evas_canvas3d_mesh_frame_vertex_data_map(0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR),
|
||||||
|
|
||||||
stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_POSITION),
|
stride_pos = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_NORMAL),
|
stride_nor = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_TEXCOORD),
|
stride_tex = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD),
|
||||||
stride_col = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_COLOR));
|
stride_col = evas_canvas3d_mesh_frame_vertex_stride_get(0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR));
|
||||||
|
|
||||||
if (stride_pos == 0) stride_pos = sizeof(float) * 3;
|
if (stride_pos == 0) stride_pos = sizeof(float) * 3;
|
||||||
if (stride_nor == 0) stride_nor = sizeof(float) * 3;
|
if (stride_nor == 0) stride_nor = sizeof(float) * 3;
|
||||||
|
@ -366,10 +366,10 @@ evas_model_load_file_ply(Evas_Canvas3D_Mesh *mesh, Eina_File *file)
|
||||||
|
|
||||||
/* Unmap vertex buffer. */
|
/* Unmap vertex buffer. */
|
||||||
eo_do(mesh,
|
eo_do(mesh,
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_POSITION),
|
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_NORMAL),
|
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_TEXCOORD),
|
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD),
|
||||||
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_COLOR));
|
evas_canvas3d_mesh_frame_vertex_data_unmap(0, EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR));
|
||||||
|
|
||||||
pd = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS);
|
pd = eo_data_scope_get(mesh, EVAS_CANVAS3D_MESH_CLASS);
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ _set_geometry_to_eet_file_from_mesh(Evas_Canvas3D_Mesh_Data *mesh,
|
||||||
src += f->vertices[a].element_count;\
|
src += f->vertices[a].element_count;\
|
||||||
}
|
}
|
||||||
geometry->vertices = vertices;
|
geometry->vertices = vertices;
|
||||||
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_POSITION, position, vertices[i].position.z = src[2];)
|
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, position, vertices[i].position.z = src[2];)
|
||||||
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_NORMAL, normal, vertices[i].normal.z = src[2];)
|
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, normal, vertices[i].normal.z = src[2];)
|
||||||
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_TEXCOORD, texcoord,)
|
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, texcoord,)
|
||||||
#undef SAVE_GEOMETRICS
|
#undef SAVE_GEOMETRICS
|
||||||
|
|
||||||
eet_mesh->geometries = geometry;
|
eet_mesh->geometries = geometry;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
for (i = 0; i < pd->vertex_count; i++) \
|
for (i = 0; i < pd->vertex_count; i++) \
|
||||||
{ \
|
{ \
|
||||||
fprintf(_obj_file, format, src[0], src[1]); \
|
fprintf(_obj_file, format, src[0], src[1]); \
|
||||||
if (a != EVAS_CANVAS3D_VERTEX_TEXCOORD) \
|
if (a != EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD) \
|
||||||
fprintf(_obj_file, " %.4f", src[2]); \
|
fprintf(_obj_file, " %.4f", src[2]); \
|
||||||
fprintf(_obj_file, "\n"); \
|
fprintf(_obj_file, "\n"); \
|
||||||
src += f->vertices[a].element_count; \
|
src += f->vertices[a].element_count; \
|
||||||
|
@ -103,12 +103,12 @@ _save_mesh(Evas_Canvas3D_Mesh_Data *pd, const char *_obj_file_name, Evas_Canvas3
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_POSITION, "v %.4f %.4f")
|
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION, "v %.4f %.4f")
|
||||||
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_NORMAL, "vn %.4f %.4f")
|
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL, "vn %.4f %.4f")
|
||||||
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_TEXCOORD, "vt %.4f %.4f")
|
SAVE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD, "vt %.4f %.4f")
|
||||||
|
|
||||||
existence_of_normal = (f->vertices[EVAS_CANVAS3D_VERTEX_NORMAL].data != NULL);
|
existence_of_normal = (f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL].data != NULL);
|
||||||
existence_of_tex_point = (f->vertices[EVAS_CANVAS3D_VERTEX_TEXCOORD].data != NULL);
|
existence_of_tex_point = (f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD].data != NULL);
|
||||||
|
|
||||||
fprintf(_obj_file,"usemtl Material\n s off\n");
|
fprintf(_obj_file,"usemtl Material\n s off\n");
|
||||||
for (i = 1; i <= pd->vertex_count; i++)//numeration of faces in .obj started from 1
|
for (i = 1; i <= pd->vertex_count; i++)//numeration of faces in .obj started from 1
|
||||||
|
@ -138,17 +138,17 @@ _save_material(Evas_Canvas3D_Mesh_Data *pd EINA_UNUSED,
|
||||||
fprintf(_mtl_file, "newmtl Material \n");
|
fprintf(_mtl_file, "newmtl Material \n");
|
||||||
fprintf(_mtl_file, "Ns 1.000000 \n");//exp factor for specular highlight
|
fprintf(_mtl_file, "Ns 1.000000 \n");//exp factor for specular highlight
|
||||||
fprintf(_mtl_file, "Ka %.6f %.6f %.6f \n",
|
fprintf(_mtl_file, "Ka %.6f %.6f %.6f \n",
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.r,
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.r,
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.g,
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.g,
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_AMBIENT].color.b);
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_AMBIENT].color.b);
|
||||||
fprintf(_mtl_file, "Kd %.6f %.6f %.6f \n",
|
fprintf(_mtl_file, "Kd %.6f %.6f %.6f \n",
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.r,
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.r,
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.g,
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.g,
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_DIFFUSE].color.b);
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_DIFFUSE].color.b);
|
||||||
fprintf(_mtl_file, "Ks %.6f %.6f %.6f \n",
|
fprintf(_mtl_file, "Ks %.6f %.6f %.6f \n",
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.r,
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.r,
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.g,
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.g,
|
||||||
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_SPECULAR].color.b);
|
(float)mat->attribs[EVAS_CANVAS3D_MATERIAL_ATTRIB_SPECULAR].color.b);
|
||||||
fprintf(_mtl_file, "Ni 1.000000 \n");//optical density
|
fprintf(_mtl_file, "Ni 1.000000 \n");//optical density
|
||||||
fprintf(_mtl_file, "d 1.000000 \n");//a factor d of 1.0 is fully opaque material
|
fprintf(_mtl_file, "d 1.000000 \n");//a factor d of 1.0 is fully opaque material
|
||||||
fprintf(_mtl_file, "illum 2 \n");//illumination properties
|
fprintf(_mtl_file, "illum 2 \n");//illumination properties
|
||||||
|
|
|
@ -33,10 +33,10 @@ evas_model_save_file_ply(const Evas_Canvas3D_Mesh *mesh, const char *file, Evas_
|
||||||
fprintf(_ply_file,"element face %d\nproperty list uchar uint vertex_indices\nend_header\n",
|
fprintf(_ply_file,"element face %d\nproperty list uchar uint vertex_indices\nend_header\n",
|
||||||
pd->vertex_count / 3);
|
pd->vertex_count / 3);
|
||||||
|
|
||||||
src_pos = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_POSITION])->data;
|
src_pos = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION])->data;
|
||||||
src_nor = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_NORMAL])->data;
|
src_nor = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL])->data;
|
||||||
src_tex = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_TEXCOORD])->data;
|
src_tex = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD])->data;
|
||||||
src_col = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_COLOR])->data;
|
src_col = (float*)(&f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_COLOR])->data;
|
||||||
|
|
||||||
for (i = 0; i < pd->vertex_count; i++)
|
for (i = 0; i < pd->vertex_count; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
{ \
|
{ \
|
||||||
if ((src1[0] != src2[0]) || (src1[1] != src2[1])) \
|
if ((src1[0] != src2[0]) || (src1[1] != src2[1])) \
|
||||||
return 1; \
|
return 1; \
|
||||||
if (a != EVAS_CANVAS3D_VERTEX_TEXCOORD) \
|
if (a != EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD) \
|
||||||
if (src1[2] != src2[2]) \
|
if (src1[2] != src2[2]) \
|
||||||
return 1; \
|
return 1; \
|
||||||
src1 += f1->vertices[a].element_count; \
|
src1 += f1->vertices[a].element_count; \
|
||||||
|
@ -94,9 +94,9 @@ static int _compare_meshes(Evas_Canvas3D_Mesh *mesh1, Evas_Canvas3D_Mesh *mesh2)
|
||||||
if ((pd1->vertex_count) != (pd2->vertex_count))
|
if ((pd1->vertex_count) != (pd2->vertex_count))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
COMPARE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_POSITION)
|
COMPARE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION)
|
||||||
COMPARE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_NORMAL)
|
COMPARE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_NORMAL)
|
||||||
COMPARE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_TEXCOORD)
|
COMPARE_GEOMETRICS(EVAS_CANVAS3D_VERTEX_ATTRIB_TEXCOORD)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue