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... | |
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.
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
[in] | obj | The object. |
[in] | directional | Whether the light is directional ($true), or not ($false). |
Get the directional flag of the given light.
See also evas_canvas3d_light_directional_set
[in] | obj | The object. |
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
[in] | obj | The object. |
[in] | exponent | Spot exponent value. |
Get the spot exponent of the given light.
See also evas_canvas3d_light_spot_exponent_set
[in] | obj | The object. |
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.
[in] | obj | The object. |
[in] | cutoff | Cutoff angle in degree.. |
Get the spot cutoff angle of the given light.
See also evas_canvas3d_light_spot_cutoff_set
[in] | obj | The object. |
Set the attenuation enable flag of the given light.
By default, light attenuation is not enabled.
See also evas_canvas3d_light_attenuation_set
[in] | obj | The object. |
[in] | enable | Whether to enable attenuation ($true), or not ($false).. |
Get the attenuation enable flag of the given light.
See also evas_canvas3d_light_attenuation_enable_set
[in] | obj | The object. |
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).
[in] | obj | The object. |
[in] | r | Red component of the ambient color between [0.0, 1.0]. |
[in] | g | Green component of the ambient color between [0.0, 1.0]. |
[in] | b | Blue component of the ambient color between [0.0, 1.0]. |
[in] | a | Alpha component of the ambient color between [0.0, 1.0]. |
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
[in] | obj | The object. |
[out] | r | Red component of the ambient color between [0.0, 1.0]. |
[out] | g | Green component of the ambient color between [0.0, 1.0]. |
[out] | b | Blue component of the ambient color between [0.0, 1.0]. |
[out] | a | Alpha component of the ambient color between [0.0, 1.0]. |
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).
[in] | obj | The object. |
[in] | r | Red component of the diffuse color between [0.0, 1.0]. |
[in] | g | Green component of the diffuse color between [0.0, 1.0]. |
[in] | b | Blue component of the diffuse color between [0.0, 1.0]. |
[in] | a | Alpha component of the diffuse color between [0.0, 1.0]. |
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
[in] | obj | The object. |
[out] | r | Red component of the diffuse color between [0.0, 1.0]. |
[out] | g | Green component of the diffuse color between [0.0, 1.0]. |
[out] | b | Blue component of the diffuse color between [0.0, 1.0]. |
[out] | a | Alpha component of the diffuse color between [0.0, 1.0]. |
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).
[in] | obj | The object. |
[in] | r | Red component of the specular color between [0.0, 1.0]. |
[in] | g | Green component of the specular color between [0.0, 1.0]. |
[in] | b | Blue component of the specular color between [0.0, 1.0]. |
[in] | a | Alpha component of the specular color between [0.0, 1.0]. |
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
[in] | obj | The object. |
[out] | r | Red component of the specular color between [0.0, 1.0]. |
[out] | g | Green component of the specular color between [0.0, 1.0]. |
[out] | b | Blue component of the specular color between [0.0, 1.0]. |
[out] | a | Alpha component of the specular color between [0.0, 1.0]. |
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
[in] | obj | The object. |
[in] | constant | Constant attenuation term.. |
[in] | linear | Linear attenuation term.. |
[in] | quadratic | Quadratic attenuation term.. |
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
[in] | obj | The object. |
[out] | constant | Constant attenuation term.. |
[out] | linear | Linear attenuation term.. |
[out] | quadratic | Quadratic attenuation term.. |
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
[in] | obj | The object. |
[in] | matrix | Projection Matrix. Pointer to the array of 16 Evas.Real values in column major order. |
Get the projection matrix of the given light source.
See also evas_canvas3d_light_projection_matrix_set
[in] | obj | The object. |
[out] | matrix | Projection Matrix |
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
[in] | obj | The object. |
[in] | fovy | Field of view angle in Y direction. |
[in] | aspect | Aspect ratio. |
[in] | dnear | Distance to near clipping plane. |
[in] | dfar | Distance to far clipping plane. |
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
[in] | obj | The object. |
[in] | left | Left X coordinate of the near clipping plane. |
[in] | right | Right X coordinate of the near clipping plane. |
[in] | bottom | Bottom Y coordinate of the near clipping plane. |
[in] | top | Top Y coordinate of the near clipping plane |
[in] | dnear | Distance to near clipping plane. |
[in] | dfar | Distance to far clipping plane. |
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
[in] | obj | The object. |
[in] | left | Left X coordinate of the near clipping plane. |
[in] | right | Right X coordinate of the near clipping plane. |
[in] | bottom | Bottom Y coordinate of the near clipping plane. |
[in] | top | Top Y coordinate of the near clipping plane |
[in] | dnear | Distance to near clipping plane. |
[in] | dfar | Distance to far clipping plane. |