[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide XML Nodes
» Back to homepage
» Back to Developer's Guide Index
<light> XML Node
<light
name=""
type=""
render="FALSE"
display_tripod="FALSE"
auto_update_direction="FALSE"
constant_att="1.0"
linear_att="0.0"
quadratic_att="0.0"
spot_angle="30.0"
shadow_emitter="FALSE"
>
<ambient
r="0.2"
g="0.2"
b="0.2"
a="1.0"
>
</ambient>
<diffuse
r="1.0"
g="1.0"
b="1.0"
a="1.0"
>
</diffuse>
<specular
r="0.6"
g="0.6"
b="0.6"
a="1.0"
>
</specular>
<position
x="0.0"
y="200.0"
z="200.0"
>
</position>
<orientation
pitch="0.0"
yaw="0.0"
roll="0.0"
>
</orientation>
<lookat
x="0.0"
y="0.0"
z="0.0"
w="1.0"
>
</lookat>
<camera_params
fov="110.0"
aspect="1.0"
znear="1.0"
zfar="100.0"
>
</camera_params>
</light>
<light>
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 state 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.
light element has 10 attributes and 7 sub-element(s)
- name [STRING]: Name of the light object
- type [STRING]: Light'stype: omnidirectional, directional or spot. - Values = OMNI | DIRECTIONAL | SPOT
- render [BOOLEAN]: Enables or disables the rendering of the light position (omni light). - Default value = FALSE - Values = TRUE|FALSE
- display_tripod [BOOLEAN]: Displays or hides light's tripod. - Default value = FALSE - Values = TRUE|FALSE
- auto_update_direction [BOOLEAN]: Enables or disables the automatic update of the tripod's direction (Z axis). - Default value = FALSE - Values = TRUE|FALSE
- constant_att [REAL]: Specifies the constant attenuation factor of the light with the distance (more precisely, the distance between the light position and a vertex). - Default value = 1.0
- linear_att [REAL]: Specifies the linear attenuation factor of the light with the distance. - Default value = 0.0
- quadratic_att [REAL]: Specifies the quadratic attenuation factor of the light with the distance. - Default value = 0.0
- spot_angle [REAL]: Sets the aperture angle of light's cone. - Default value = 30.0
- shadow_emitter [BOOLEAN]: The light is a source of shadow or not. - Default value = FALSE - Values = TRUE|FALSE
:
<light name="light01" render="TRUE" >
<position x="100.0" y="100.0" z="100.0" />
<ambient r="0.2" g="0.2" b="0.2" a="1.0" />
<diffuse r="0.8" g="0.8" b="0.8" a="1.0" />
<specular r="0.9" g="0.9" b="0.9" a="1.0" />
</light>
<ambient>
Sets the light's ambient color.
ambient element has 4 attributes and 0 sub-element(s)
- r [REAL]: red channel - Default value = 0.2
- g [REAL]: green channel - Default value = 0.2
- b [REAL]: blue channel - Default value = 0.2
- a [REAL]: alpha channel - Default value = 1.0
<diffuse>
Sets the light's diffuse color.
diffuse element has 4 attributes and 0 sub-element(s)
- r [REAL]: red channel - Default value = 1.0
- g [REAL]: green channel - Default value = 1.0
- b [REAL]: blue channel - Default value = 1.0
- a [REAL]: alpha channel - Default value = 1.0
<specular>
Sets the light's specular color.
specular element has 4 attributes and 0 sub-element(s)
- r [REAL]: red channel - Default value = 0.6
- g [REAL]: green channel - Default value = 0.6
- b [REAL]: blue channel - Default value = 0.6
- a [REAL]: alpha channel - Default value = 1.0
<position>
Sets light's position in local space (relative position).
position element has 3 attributes and 0 sub-element(s)
- x [REAL]: x coordinate - Default value = 0.0
- y [REAL]: y coordinate - Default value = 200.0
- z [REAL]: z coordinate - Default value = 200.0
<orientation>
Sets light's orientation in local space (relative orientation).
orientation element has 3 attributes and 0 sub-element(s)
- pitch [REAL]: rotation in degrees around X axis - Default value = 0.0
- yaw [REAL]: rotation in degrees around Y axis - Default value = 0.0
- roll [REAL]: rotation in degrees around Z axis - Default value = 0.0
<lookat>
Sets light's lookat direction/point for shadow mapping.
lookat element has 4 attributes and 0 sub-element(s)
- x [REAL]: x coordinate of direction/point lookat - Default value = 0.0
- y [REAL]: y coordinate of direction/point lookat - Default value = 0.0
- z [REAL]: z coordinate of direction/point lookat - Default value = 0.0
- w [REAL]: w coordinate of direction/point lookat. If w=0.0, lookat is a direction vector and if w=1.0, lookat is a point. - Default value = 1.0
<camera_params>
Sets light's camera parameters for shadow mapping.
camera_params element has 4 attributes and 0 sub-element(s)
- fov [REAL]: field of view in degrees - Default value = 110.0
- aspect [REAL]: camera's viewport ratio - Default value = 1.0
- znear [REAL]: z near clipping plane - Default value = 1.0
- zfar [REAL]: z far clipping plane - Default value = 100.0
|