» Back To Index
The <light> node
Function
The light node is the object which makes it possible to represent a dynamic light. In the case of a dynamic light,
lighting calculations are completely processed at each frame and for each object that
has its lighting attribute set to TRUE. Thus, the more lights there will be, the longer will be
the calculations and the more the FPS will decrease. The maximum number of dynamic lights is limited by the hardware.
They are generally eight. The
GPU Caps Viewer utility makes it possible to know this number.
<light
name=""
render="FALSE"
display_tripod="FALSE"
auto_update_direction="FALSE"
type="OMNI"
linear_att="0.0"
constant_att="1.0"
quadratic_att="0.0"
radius="10000.0"
spot_angle="30.0"
shadow_emitter="TRUE"
motion_path=""
play_motion_path="TRUE"
motion_path_time_step="0.001"
motion_path_time_offset="0.0"
display_motion_path_curve="FALSE"
display_motion_path_tangents="FALSE"
link_to_motion_path="FALSE" >
<position
x="0.0"
y="0.0"
z="0.0" />
<orientation
ang="0.0"
x="0.0"
y="0.0"
z="0.0"
pitch="0.0"
yaw="0.0"
roll="0.0" />
<ambient
r="0.2"
g="0.2"
b="0.2"
a="1.0" />
<diffuse
r="1.0"
g="1.0"
b="1.0"
a="1.0" />
<specular
r="0.1"
g="0.1"
b="0.1"
a="1.0" />
</light>
light element
light is the xml tag that defines a light node.
Attributes:
ambient element
ambient allows to set the ambient color of the light. Let us recall that the ambient light is a
light which seems to come from everywhere at the same time. To represent it, you just have to look at the shade
of an object. The color of the shade is in close relationship with the ambient light.
Attributes:
- r - [CLAMPED_REAL] - red component of the color. Float value ranging between 0.0 and 1.0 - default value: 0.2
- g - [CLAMPED_REAL] - green component of the color. Float value ranging between 0.0 and 1.0 - default value: 0.2
- b - [CLAMPED_REAL] - blue component of the color. Float value ranging between 0.0 and 1.0 - default value: 0.2
- a - [CLAMPED_REAL] - alpha component of the color. Float value ranging between 0.0 and 1.0 - default value: 1.0
diffuse element
diffuse allows to regulate the diffuse component of the light. Let us recall that the diffuse light is the
one which directly lights an object. There is a direct relation between the quantity of light received
by a face of an object and the angle formed by the normal to this face and the light position.
Attributes:
- r - [CLAMPED_REAL] - red component of the color. Float value ranging between 0.0 and 1.0 - default value: 1.0
- g - [CLAMPED_REAL] - green component of the color. Float value ranging between 0.0 and 1.0 - default value: 1.0
- b - [CLAMPED_REAL] - blue component of the color. Float value ranging between 0.0 and 1.0 - default value: 1.0
- a - [CLAMPED_REAL] - alpha component of the color. Float value ranging between 0.0 and 1.0 - default value: 1.0
orientation element
orientation specifies the orientation of the light around an arbitrary axis in its local reference mark.
This method works only for a SPOT or directionnal light type. There are 2 ways of using the
attributes of this element: either by using the [ang, x, y, z] quadruplets or by using the
[pitch, yaw, roll] triplets.
Attributes:
- ang - [REAL] - rotation angle in degrees around the axis formed by x, y and z - default value: 0.0
- x - [CLAMPED_REAL] - X component of the rotation axis - default value: 0.0
- y - [CLAMPED_REAL] - Y component of the rotation axis - default value: 0.0
- z - [CLAMPED_REAL] - Z component of the rotation axis - default value: 0.0
- pitch - [REAL] - rotation angle in degrees around the X axis - default value: 0.0
- yaw - [REAL] - rotation angle in degrees around the Y axis - default value: 0.0
- roll - [REAL] - rotation angle in degrees around the Z axis - default value: 0.0
position element
position specifies the position of the light in the 3d scene. This instruction is valid only for an OMNI or SPOT
type light.
Attributes:
- x - [REAL] - X coordinate of the position - default value: 0.0
- y - [REAL] - Y coordinate of the position - default value: 0.0
- z - [REAL] - Z coordinate of the position - default value: 0.0
specular element
specular makes it possible to set the specular component of the light. Let us recall that the specular light is
person in charge for the reflections (which one calls specular reflections) on the surface of an object. Specular reflections
vary with the position from the point of view and thus of the camera.
Attributes:
- r - [CLAMPED_REAL] - red component of the color. Float value ranging between 0.0 and 1.0 - default value: 0.1
- g - [CLAMPED_REAL] - green component of the color. Float value ranging between 0.0 and 1.0 - default value: 0.1
- b - [CLAMPED_REAL] - blue component of the color. Float value ranging between 0.0 and 1.0 - default value: 0.1
- a - [CLAMPED_REAL] - alpha component of the color. Float value ranging between 0.0 and 1.0 - default value: 1.0