Macros | Functions
Light Object

The Evas_Canvas3D_Light structure defines various light source properties. More...

Macros

#define EVAS_CANVAS3D_LIGHT_CLASS   evas_canvas3d_light_class_get()
 Evas 3D canvas light class.
 

Functions

EOAPI void evas_canvas3d_light_directional_set (Eo *obj, Eina_Bool directional)
 Set the directional flag of the given light. More...
 
EOAPI Eina_Bool evas_canvas3d_light_directional_get (const Eo *obj)
 Get the directional flag of the given light. More...
 
EOAPI void evas_canvas3d_light_spot_exponent_set (Eo *obj, Evas_Real exponent)
 Set the spot exponent of the given light. More...
 
EOAPI Evas_Real evas_canvas3d_light_spot_exponent_get (const Eo *obj)
 Get the spot exponent of the given light. More...
 
EOAPI void evas_canvas3d_light_spot_cutoff_set (Eo *obj, Evas_Real cutoff)
 Set the spot cutoff angle of the given light. More...
 
EOAPI Evas_Real evas_canvas3d_light_spot_cutoff_get (const Eo *obj)
 Get the spot cutoff angle of the given light. More...
 
EOAPI void evas_canvas3d_light_attenuation_enable_set (Eo *obj, Eina_Bool enable)
 Set the attenuation enable flag of the given light. More...
 
EOAPI Eina_Bool evas_canvas3d_light_attenuation_enable_get (const Eo *obj)
 Get the attenuation enable flag of the given light. More...
 
EOAPI void evas_canvas3d_light_ambient_set (Eo *obj, Evas_Real r, Evas_Real g, Evas_Real b, Evas_Real a)
 Set the ambient color of the given light. More...
 
EOAPI void evas_canvas3d_light_ambient_get (const Eo *obj, Evas_Real *r, Evas_Real *g, Evas_Real *b, Evas_Real *a)
 Get the ambient color of the given light. More...
 
EOAPI void evas_canvas3d_light_diffuse_set (Eo *obj, Evas_Real r, Evas_Real g, Evas_Real b, Evas_Real a)
 Set the diffuse color of the given light. More...
 
EOAPI void evas_canvas3d_light_diffuse_get (const Eo *obj, Evas_Real *r, Evas_Real *g, Evas_Real *b, Evas_Real *a)
 Get the diffuse color of the given light. More...
 
EOAPI void evas_canvas3d_light_specular_set (Eo *obj, Evas_Real r, Evas_Real g, Evas_Real b, Evas_Real a)
 Set the specular color of the given light. More...
 
EOAPI void evas_canvas3d_light_specular_get (const Eo *obj, Evas_Real *r, Evas_Real *g, Evas_Real *b, Evas_Real *a)
 Get the specular color of the given light. More...
 
EOAPI void evas_canvas3d_light_attenuation_set (Eo *obj, Evas_Real constant, Evas_Real linear, Evas_Real quadratic)
 Set the attenuation of the given light. More...
 
EOAPI void evas_canvas3d_light_attenuation_get (const Eo *obj, Evas_Real *constant, Evas_Real *linear, Evas_Real *quadratic)
 Get the attenuation of the given light. More...
 
EOAPI void evas_canvas3d_light_projection_matrix_set (Eo *obj, const Evas_Real *matrix)
 Set the projection matrix of the given light source. More...
 
EOAPI void evas_canvas3d_light_projection_matrix_get (const Eo *obj, Evas_Real *matrix)
 Get the projection matrix of the given light source. More...
 
EOAPI void evas_canvas3d_light_projection_perspective_set (Eo *obj, Evas_Real fovy, Evas_Real aspect, Evas_Real dnear, Evas_Real dfar)
 Set the projection matrix of the given light source with perspective projection. More...
 
EOAPI void evas_canvas3d_light_projection_frustum_set (Eo *obj, Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top, Evas_Real dnear, Evas_Real dfar)
 Set the projection matrix of the given light source with frustum projection. More...
 
EOAPI void evas_canvas3d_light_projection_ortho_set (Eo *obj, Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top, Evas_Real dnear, Evas_Real dfar)
 Set the projection matrix of the given light source with orthogonal projection. More...
 

Detailed Description

The Evas_Canvas3D_Light structure defines various light source properties.

Reflection models include: Ambient, diffuse, and specular. Light models include directional, point, and spot. The position and direction for the light is tracked by the node that contains the light.

Function Documentation

◆ evas_canvas3d_light_directional_set()

EOAPI void evas_canvas3d_light_directional_set ( Eo obj,
Eina_Bool  directional 
)

Set the directional flag of the given light.

Directional light is a type of light which is infinitely far away with no attenuation. The light direction is determined by the containing node's forward vector (negative Z-axis).

By default, directional is not enabled.

evas_canvas3d_node_look_at_set

Parameters
[in]objThe object.
[in]directionalWhether the light is directional ($true), or not ($false).

◆ evas_canvas3d_light_directional_get()

EOAPI Eina_Bool evas_canvas3d_light_directional_get ( const Eo obj)

Get the directional flag of the given light.

See also evas_canvas3d_light_directional_set

Parameters
[in]objThe object.
Returns
Whether the light is directional ($true), or not ($false).

◆ evas_canvas3d_light_spot_exponent_set()

EOAPI void evas_canvas3d_light_spot_exponent_set ( Eo obj,
Evas_Real  exponent 
)

Set the spot exponent of the given light.

Higher spot exponent means intensity at the center of the cone is relatively stronger. Zero exponent means the light intensity is evenly distibuted. The spot exponent has no effect when the light is not spot light (spot cutoff angle is less than 180 degree).

Default spot exponent is 0.

See also evas_canvas3d_light_spot_cutoff_set

Parameters
[in]objThe object.
[in]exponentSpot exponent value.

◆ evas_canvas3d_light_spot_exponent_get()

EOAPI Evas_Real evas_canvas3d_light_spot_exponent_get ( const Eo obj)

Get the spot exponent of the given light.

See also evas_canvas3d_light_spot_exponent_set

Parameters
[in]objThe object.
Returns
Spot exponent value.

◆ evas_canvas3d_light_spot_cutoff_set()

EOAPI void evas_canvas3d_light_spot_cutoff_set ( Eo obj,
Evas_Real  cutoff 
)

Set the spot cutoff angle of the given light.

Only angle less than 180 degree will make it spot light, so that other spot light attribute will take effect.

Default spot cutoff angle is 180.

Parameters
[in]objThe object.
[in]cutoffCutoff angle in degree..

◆ evas_canvas3d_light_spot_cutoff_get()

EOAPI Evas_Real evas_canvas3d_light_spot_cutoff_get ( const Eo obj)

Get the spot cutoff angle of the given light.

See also evas_canvas3d_light_spot_cutoff_set

Parameters
[in]objThe object.
Returns
Cutoff angle in degree..

◆ evas_canvas3d_light_attenuation_enable_set()

EOAPI void evas_canvas3d_light_attenuation_enable_set ( Eo obj,
Eina_Bool  enable 
)

Set the attenuation enable flag of the given light.

By default, light attenuation is not enabled.

See also evas_canvas3d_light_attenuation_set

Parameters
[in]objThe object.
[in]enableWhether to enable attenuation ($true), or not ($false)..

◆ evas_canvas3d_light_attenuation_enable_get()

EOAPI Eina_Bool evas_canvas3d_light_attenuation_enable_get ( const Eo obj)

Get the attenuation enable flag of the given light.

See also evas_canvas3d_light_attenuation_enable_set

Parameters
[in]objThe object.
Returns
Whether to enable attenuation ($true), or not ($false)..

◆ evas_canvas3d_light_ambient_set()

EOAPI void evas_canvas3d_light_ambient_set ( Eo obj,
Evas_Real  r,
Evas_Real  g,
Evas_Real  b,
Evas_Real  a 
)

Set the ambient color of the given light.

Default ambient color is (0.0, 0.0, 0.0, 1.0).

Parameters
[in]objThe object.
[in]rRed component of the ambient color between [0.0, 1.0].
[in]gGreen component of the ambient color between [0.0, 1.0].
[in]bBlue component of the ambient color between [0.0, 1.0].
[in]aAlpha component of the ambient color between [0.0, 1.0].

◆ evas_canvas3d_light_ambient_get()

EOAPI void evas_canvas3d_light_ambient_get ( const Eo obj,
Evas_Real r,
Evas_Real g,
Evas_Real b,
Evas_Real a 
)

Get the ambient color of the given light.

See also evas_canvas3d_light_ambient_set

Parameters
[in]objThe object.
[out]rRed component of the ambient color between [0.0, 1.0].
[out]gGreen component of the ambient color between [0.0, 1.0].
[out]bBlue component of the ambient color between [0.0, 1.0].
[out]aAlpha component of the ambient color between [0.0, 1.0].

◆ evas_canvas3d_light_diffuse_set()

EOAPI void evas_canvas3d_light_diffuse_set ( Eo obj,
Evas_Real  r,
Evas_Real  g,
Evas_Real  b,
Evas_Real  a 
)

Set the diffuse color of the given light.

Default diffuse color is (1.0, 1.0, 1.0, 1.0).

Parameters
[in]objThe object.
[in]rRed component of the diffuse color between [0.0, 1.0].
[in]gGreen component of the diffuse color between [0.0, 1.0].
[in]bBlue component of the diffuse color between [0.0, 1.0].
[in]aAlpha component of the diffuse color between [0.0, 1.0].

◆ evas_canvas3d_light_diffuse_get()

EOAPI void evas_canvas3d_light_diffuse_get ( const Eo obj,
Evas_Real r,
Evas_Real g,
Evas_Real b,
Evas_Real a 
)

Get the diffuse color of the given light.

See also evas_canvas3d_light_diffuse_set

Parameters
[in]objThe object.
[out]rRed component of the diffuse color between [0.0, 1.0].
[out]gGreen component of the diffuse color between [0.0, 1.0].
[out]bBlue component of the diffuse color between [0.0, 1.0].
[out]aAlpha component of the diffuse color between [0.0, 1.0].

◆ evas_canvas3d_light_specular_set()

EOAPI void evas_canvas3d_light_specular_set ( Eo obj,
Evas_Real  r,
Evas_Real  g,
Evas_Real  b,
Evas_Real  a 
)

Set the specular color of the given light.

Default specular color is (1.0, 1.0, 1.0, 1.0).

Parameters
[in]objThe object.
[in]rRed component of the specular color between [0.0, 1.0].
[in]gGreen component of the specular color between [0.0, 1.0].
[in]bBlue component of the specular color between [0.0, 1.0].
[in]aAlpha component of the specular color between [0.0, 1.0].

◆ evas_canvas3d_light_specular_get()

EOAPI void evas_canvas3d_light_specular_get ( const Eo obj,
Evas_Real r,
Evas_Real g,
Evas_Real b,
Evas_Real a 
)

Get the specular color of the given light.

See also evas_canvas3d_light_specular_set

Parameters
[in]objThe object.
[out]rRed component of the specular color between [0.0, 1.0].
[out]gGreen component of the specular color between [0.0, 1.0].
[out]bBlue component of the specular color between [0.0, 1.0].
[out]aAlpha component of the specular color between [0.0, 1.0].

◆ evas_canvas3d_light_attenuation_set()

EOAPI void evas_canvas3d_light_attenuation_set ( Eo obj,
Evas_Real  constant,
Evas_Real  linear,
Evas_Real  quadratic 
)

Set the attenuation of the given light.

Light attenuation has no effect with directional light. And the attenuation should be enabled first to take effect. The attenuation factor is calculated as follows.

atten = 1.0 / constant + linear * distance + quadratic * distance * distance

Default attenuation is constant = 1.0, linear = 0.0, quadratic = 0.0.

See also evas_canvas3d_light_attenuation_enable_set

Parameters
[in]objThe object.
[in]constantConstant attenuation term..
[in]linearLinear attenuation term..
[in]quadraticQuadratic attenuation term..

◆ evas_canvas3d_light_attenuation_get()

EOAPI void evas_canvas3d_light_attenuation_get ( const Eo obj,
Evas_Real constant,
Evas_Real linear,
Evas_Real quadratic 
)

Get the attenuation of the given light.

See also evas_canvas3d_light_attenuation_set

Parameters
[in]objThe object.
[out]constantConstant attenuation term..
[out]linearLinear attenuation term..
[out]quadraticQuadratic attenuation term..

◆ evas_canvas3d_light_projection_matrix_set()

EOAPI void evas_canvas3d_light_projection_matrix_set ( Eo obj,
const Evas_Real matrix 
)

Set the projection matrix of the given light source.

Default projection matrix is identity matrix.

See also evas_canvas3d_light_projection_perspective_set, evas_canvas3d_light_projection_ortho_set and evas_canvas3d_light_projection_frustum_set

Parameters
[in]objThe object.
[in]matrixProjection Matrix. Pointer to the array of 16 Evas.Real values in column major order.

◆ evas_canvas3d_light_projection_matrix_get()

EOAPI void evas_canvas3d_light_projection_matrix_get ( const Eo obj,
Evas_Real matrix 
)

Get the projection matrix of the given light source.

See also evas_canvas3d_light_projection_matrix_set

Parameters
[in]objThe object.
[out]matrixProjection Matrix

◆ evas_canvas3d_light_projection_perspective_set()

EOAPI void evas_canvas3d_light_projection_perspective_set ( Eo obj,
Evas_Real  fovy,
Evas_Real  aspect,
Evas_Real  dnear,
Evas_Real  dfar 
)

Set the projection matrix of the given light source with perspective projection.

See also evas_canvas3d_light_projection_matrix_set

Parameters
[in]objThe object.
[in]fovyField of view angle in Y direction.
[in]aspectAspect ratio.
[in]dnearDistance to near clipping plane.
[in]dfarDistance to far clipping plane.

◆ evas_canvas3d_light_projection_frustum_set()

EOAPI void evas_canvas3d_light_projection_frustum_set ( Eo obj,
Evas_Real  left,
Evas_Real  right,
Evas_Real  bottom,
Evas_Real  top,
Evas_Real  dnear,
Evas_Real  dfar 
)

Set the projection matrix of the given light source with frustum projection.

evas_canvas3d_light_projection_matrix_set

Parameters
[in]objThe object.
[in]leftLeft X coordinate of the near clipping plane.
[in]rightRight X coordinate of the near clipping plane.
[in]bottomBottom Y coordinate of the near clipping plane.
[in]topTop Y coordinate of the near clipping plane
[in]dnearDistance to near clipping plane.
[in]dfarDistance to far clipping plane.

◆ evas_canvas3d_light_projection_ortho_set()

EOAPI void evas_canvas3d_light_projection_ortho_set ( Eo obj,
Evas_Real  left,
Evas_Real  right,
Evas_Real  bottom,
Evas_Real  top,
Evas_Real  dnear,
Evas_Real  dfar 
)

Set the projection matrix of the given light source with orthogonal projection.

See also evas_canvas3d_light_projection_matrix_set

Parameters
[in]objThe object.
[in]leftLeft X coordinate of the near clipping plane.
[in]rightRight X coordinate of the near clipping plane.
[in]bottomBottom Y coordinate of the near clipping plane.
[in]topTop Y coordinate of the near clipping plane
[in]dnearDistance to near clipping plane.
[in]dfarDistance to far clipping plane.