Macros | Functions
Material Object

The Evas_Canvas3D_Material structure defines a set of material attributes used for determining the color of mesh surfaces. More...

Macros

#define EVAS_CANVAS3D_MATERIAL_CLASS   evas_canvas3d_material_class_get()
 Evas 3D canvas material class.
 

Functions

EOAPI void evas_canvas3d_material_color_set (Eo *obj, Evas_Canvas3D_Material_Attrib attrib, Evas_Real r, Evas_Real g, Evas_Real b, Evas_Real a)
 Set the material attribute color of the given material. More...
 
EOAPI void evas_canvas3d_material_color_get (const Eo *obj, Evas_Canvas3D_Material_Attrib attrib, Evas_Real *r, Evas_Real *g, Evas_Real *b, Evas_Real *a)
 Get the material attribute color of the given material. More...
 
EOAPI void evas_canvas3d_material_enable_set (Eo *obj, Evas_Canvas3D_Material_Attrib attrib, Eina_Bool enable)
 The material attribute enable flag of the given material. More...
 
EOAPI Eina_Bool evas_canvas3d_material_enable_get (const Eo *obj, Evas_Canvas3D_Material_Attrib attrib)
 The material attribute enable flag of the given material. More...
 
EOAPI void evas_canvas3d_material_shininess_set (Eo *obj, Evas_Real shininess)
 The shininess of the given material. More...
 
EOAPI Evas_Real evas_canvas3d_material_shininess_get (const Eo *obj)
 The shininess of the given material. More...
 
EOAPI void evas_canvas3d_material_texture_set (Eo *obj, Evas_Canvas3D_Material_Attrib attrib, Evas_Canvas3D_Texture *texture)
 The texture of the given material. More...
 
EOAPI Evas_Canvas3D_Texture * evas_canvas3d_material_texture_get (const Eo *obj, Evas_Canvas3D_Material_Attrib attrib)
 The texture of the given material. More...
 

Detailed Description

The Evas_Canvas3D_Material structure defines a set of material attributes used for determining the color of mesh surfaces.

Each attribute is defined by a color value and texture map. The five attributes are: ambient, diffuse, specular, emission, and normal.

Function Documentation

◆ evas_canvas3d_material_color_set()

EOAPI void evas_canvas3d_material_color_set ( Eo obj,
Evas_Canvas3D_Material_Attrib  attrib,
Evas_Real  r,
Evas_Real  g,
Evas_Real  b,
Evas_Real  a 
)

Set the material attribute color of the given material.

Material color is used also when texture map is enabled. The colors will be modulated (multiplied). To control the color contribution of a material attribute, use gray color. Setting color value for normal attribute has no effect.

Default color is as follows.

Ambient : (0.2, 0.2, 0.2, 1.0) Diffuse : (0.8, 0.8, 0.8, 1.0) Specular : (1.0, 1.0, 1.0, 1.0) Emission : (0.0, 0.0, 0.0, 1.0) Normal : Not used

Parameters
[in]objThe object.
[in]attribMaterial attribute ID.
[in]rRed component of the color.
[in]gGreen component of the color.
[in]bBlue component of the color.
[in]aAlpha component of the color.

◆ evas_canvas3d_material_color_get()

EOAPI void evas_canvas3d_material_color_get ( const Eo obj,
Evas_Canvas3D_Material_Attrib  attrib,
Evas_Real r,
Evas_Real g,
Evas_Real b,
Evas_Real a 
)

Get the material attribute color of the given material.

See also evas_canvas3d_material_color_set.

Parameters
[in]objThe object.
[in]attribMaterial attribute ID.
[out]rPointer to receive red component of the color.
[out]gPointer to receive green component of the color.
[out]bPointer to receive blue component of the color.
[out]aPointer to receive alpha component of the color.

◆ evas_canvas3d_material_enable_set()

EOAPI void evas_canvas3d_material_enable_set ( Eo obj,
Evas_Canvas3D_Material_Attrib  attrib,
Eina_Bool  enable 
)

The material attribute enable flag of the given material.

You might want to disable some material reflection contribution. For example, Emission attribute is rarely used. Disabling unused attributes might help the shading less complex so that can get speed up.

By default, diffuse and specular is enabled.

Parameters
[in]objThe object.
[in]attribMaterial attribute ID.
[in]enableWhether to enable the attribute or not.

◆ evas_canvas3d_material_enable_get()

EOAPI Eina_Bool evas_canvas3d_material_enable_get ( const Eo obj,
Evas_Canvas3D_Material_Attrib  attrib 
)

The material attribute enable flag of the given material.

You might want to disable some material reflection contribution. For example, Emission attribute is rarely used. Disabling unused attributes might help the shading less complex so that can get speed up.

By default, diffuse and specular is enabled.

Parameters
[in]objThe object.
[in]attribMaterial attribute ID.
Returns
Whether to enable the attribute or not.

◆ evas_canvas3d_material_shininess_set()

EOAPI void evas_canvas3d_material_shininess_set ( Eo obj,
Evas_Real  shininess 
)

The shininess of the given material.

Shininess is only used when specular attribute is enabled. Higher shininess value will make the object more shiny.

Default shininess value is 150.0.

See also evas_canvas3d_material_enable_set.

Parameters
[in]objThe object.
[in]shininessShininess value.

◆ evas_canvas3d_material_shininess_get()

EOAPI Evas_Real evas_canvas3d_material_shininess_get ( const Eo obj)

The shininess of the given material.

Shininess is only used when specular attribute is enabled. Higher shininess value will make the object more shiny.

Default shininess value is 150.0.

See also evas_canvas3d_material_enable_set.

Parameters
[in]objThe object.
Returns
Shininess value.

◆ evas_canvas3d_material_texture_set()

EOAPI void evas_canvas3d_material_texture_set ( Eo obj,
Evas_Canvas3D_Material_Attrib  attrib,
Evas_Canvas3D_Texture *  texture 
)

The texture of the given material.

You have to enable the desired attribute first.

See also evas_canvas3d_material_enable_set.

Parameters
[in]objThe object.
[in]attribMaterial attribute ID.
[in]textureThe texture set to the attribute.

◆ evas_canvas3d_material_texture_get()

EOAPI Evas_Canvas3D_Texture* evas_canvas3d_material_texture_get ( const Eo obj,
Evas_Canvas3D_Material_Attrib  attrib 
)

The texture of the given material.

You have to enable the desired attribute first.

See also evas_canvas3d_material_enable_set.

Parameters
[in]objThe object.
[in]attribMaterial attribute ID.
Returns
The texture set to the attribute.