Spotlights

    In the editor, one can clearly see the position, color and light range of the light as well as its spot angle, as shown in the following image. With the Transform Gizmos in the upper left corner of the editor, it is possible to adjust the position and direction of the spotlight.

    See for how to add spotlights to a scene.

    For the Spotlight component interface, please refer to SpotLight API.

    image

    PropertyExplanation
    ShadowEnabledWhether to enable the shadow effect.
    ShadowPcfSet the anti-aliasing level of the shadow edge, currently including HARD, SOFT, SOFT_2X. Please refer to the section PCF Soft Shadow below for details.
    ShadowBiasSet the shadow offset value to prevent z-fitting.
    ShadowNormalBiasSet the normal offset value.

    PCF Soft Shadow

    Cocos Creator currently supports hard sampler (HARD mode), 4x sampler (SOFT mode), 9x sampler (SOFT_2X mode). The larger the magnification, the larger the sampling area and the more softer the shadow edges.