Gets the cascade blend factor of the light, from 0 (no blending) to 1, which applies only to
directional lights with num-cascades greater than 1.
The cascade blend factor.
Sets the fraction of each shadow cascade that is blended into the next one, from 0 (no
blending) to 1, which applies only to directional lights with num-cascades greater than
The cascade blend factor.
Gets the cascade distribution of the light, from 0 (linear split) to 1 (logarithmic split,
concentrating shadow resolution near the camera), which applies only to directional lights
with num-cascades greater than 1.
The cascade distribution.
Sets the distribution of the camera frustum split between shadow cascades, from 0 (linear
split) to 1 (logarithmic split, concentrating shadow resolution near the camera), which
applies only to directional lights with num-cascades greater than 1. Defaults to 0.5.
The cascade distribution.
Gets the cast shadows flag of the light.
The cast shadows flag.
Sets the cast shadows flag of the light.
The cast shadows flag.
The nearest ancestor <pc-app> element, or null if this element has no <pc-app>
ancestor. The search starts at the parent, so an element never resolves to itself.
The closest app element, or null.
The nearest ancestor element that fronts an entity — <pc-entity>, <pc-model> or
<pc-node> — or null if this element has no such ancestor. The search starts at the
parent, so an element never resolves to itself.
The closest entity-fronting element, or null.
Gets the underlying PlayCanvas light component. null until the element is
ready — see ComponentElement.component.
The light component, or null.
Gets the enabled state of the component.
The enabled state of the component.
Sets the enabled state of the component.
The enabled state of the component.
Gets the inner cone angle of the light.
The inner cone angle.
Sets the inner cone angle of the light.
The inner cone angle.
Gets the intensity of the light.
The intensity.
Sets the intensity of the light.
The intensity.
Gets the normal offset bias of the light.
The normal offset bias.
Sets the normal offset bias of the light.
The normal offset bias.
Gets the number of shadow cascades of the light, an integer from 1 (no cascades) to 4, which
applies only to directional lights.
The number of shadow cascades.
Sets the number of shadow cascades of the light, an integer from 1 (no cascades) to 4, which
applies only to directional lights. Defaults to 1.
The number of shadow cascades.
Gets the outer cone angle of the light.
The outer cone angle.
Sets the outer cone angle of the light.
The outer cone angle.
Gets the penumbra falloff of the light.
The penumbra falloff.
Sets the penumbra falloff of the light. Used for PCSS shadows.
The penumbra falloff.
Gets the penumbra size of the light.
The penumbra size.
Sets the penumbra size of the light. Used for PCSS shadows.
The penumbra size.
Gets the range of the light.
The range.
Sets the range of the light.
The range.
Gets the shadow bias of the light.
The shadow bias.
Sets the shadow bias of the light.
The shadow bias.
Gets the number of shadow blocker samples.
The number of shadow blocker samples.
Sets the number of shadow blocker samples. Used for PCSS shadows.
The number of shadow blocker samples.
Gets the shadow distance of the light.
The shadow distance.
Sets the shadow distance of the light.
The shadow distance.
Gets the shadow intensity of the light.
The shadow intensity.
Sets the shadow intensity of the light.
The shadow intensity.
Gets the shadow resolution of the light.
The shadow resolution.
Sets the shadow resolution of the light.
The shadow resolution.
Gets the number of shadow samples.
The number of shadow samples.
Sets the number of shadow samples. Used for PCSS shadows.
The number of shadow samples.
Gets the shadow type of the light.
The shadow type.
Sets the shadow type of the light.
The shadow type. Can be:
pcf1-16f - 1-tap percentage-closer filtered shadow map with 16-bit depth.pcf1-32f - 1-tap percentage-closer filtered shadow map with 32-bit depth.pcf3-16f - 3-tap percentage-closer filtered shadow map with 16-bit depth.pcf3-32f - 3-tap percentage-closer filtered shadow map with 32-bit depth.pcf5-16f - 5-tap percentage-closer filtered shadow map with 16-bit depth.pcf5-32f - 5-tap percentage-closer filtered shadow map with 32-bit depth.vsm-16f - Variance shadow map with 16-bit depth.vsm-32f - Variance shadow map with 32-bit depth.pcss-32f - Percentage-closer soft shadow with 32-bit depth.Gets the shape of the light source: punctual, or an area light shaped as a rect, disk
or sphere that takes its size from the entity's scale and needs the lookup tables loaded by
area-light-luts on <pc-app>.
The light shape.
Sets the shape of the light source: punctual for a point, or an area light shaped as a
rect, disk or sphere that takes its size from the entity's scale and needs the lookup
tables loaded by area-light-luts on <pc-app>. Defaults to punctual.
The light shape. Can be:
punctual - An infinitesimally small point.rect - A rectangle in the entity's local XZ plane, 1 by 1 at unit scale.disk - A disk in the entity's local XZ plane, 1 across at unit scale.sphere - A sphere, 1 across at unit scale.Area shapes fall off with their size and distance, so range is only a cutoff for them.
Gets the type of the light.
The type.
Sets the type of the light. Can be directional, omni or spot. Defaults to
directional.
The type.
Gets the VSM bias of the light.
The VSM bias.
Sets the VSM bias of the light.
The VSM bias.
Gets the VSM blur size of the light.
The VSM blur size.
Sets the VSM blur size of the light. Minimum is 1, maximum is 25. Default is 11.
The VSM blur size.
Protected_Called when the element is fully initialized and ready. Subclasses should call this when
they're ready. Resolves the ready promise and dispatches a bubbling, composed ready
event. Signals at most once per readiness cycle: a repeat call before _resetReady
has re-armed the promise does nothing.
Protected_Returns the ready promise to its pending state. Subclasses should call this when the
resource their readiness announced is torn down (typically from disconnectedCallback),
so that a later re-initialization can signal readiness again. Does nothing while the
promise is still pending — an in-flight waiter carries over to the next readiness cycle
rather than being stranded on a promise nothing will ever resolve.
ProtectedgetReturns the data the component is created with. Overridden by subclasses to supply the initial values of their cached properties.
The initial component data.
ProtectedinitConfigures the newly added component. Overridden by subclasses whose setup goes beyond the initial data — child-element handling, asset resolution and the like.
Returns a promise that resolves with this element when it's ready. This is the low-level primitive underlying whenReady, which is the recommended way to wait for elements.
Readiness tracks the element's current lifecycle: once a ready element is torn down (for example by removing it from the document), this returns a fresh promise that resolves when the element is next ready. A promise obtained earlier stays resolved — call this again after re-inserting an element rather than reusing a promise from before its removal.
A promise that resolves with this element when it's ready.
The LightComponentElement interface provides properties and methods for manipulating
<pc-light>elements. The LightComponentElement interface also inherits the properties and methods of the HTMLElement interface.Engine component: LightComponent (
light).