Main Directional Lights

Directional light is the most common type of lights, and can be understood as the dominant light in a scene. The lighting effect is not affected by the light position and orientation, and is suitable for achieving sunlight. However, rotation affects the direction of directional lights illumination, which in turn affects the range to which the model receives illumination and where the model produces shadows.

image

Note: Cocos Creator currently supports only one main directional light. If more than one is added at the same time, the last one added will prevail.

To add the directional light to the scene, refer to the Lighting documentation.

For the related interface of the directional light component, please refer to the DirectionalLight API.

Main Directional Lights Properties

image

PropertyDescription
ColorSet the light color
UseColorTemperatureWhether to enable color temperature
ColorTemperatureAdjust the color temperature
StaticSettingsSet up static lighting, see LightMap for details
IlluminationIllumination, unit lux (lx)