Passer au contenu principal

Light

ecs.Light

Description

The Light component manages lighting behavior of an entity.

Functions

See component schema.

Schema

PropertyTypeDefaultRequiredDescription
typestringdirectionaltrueThe type of light: directional, point, ambient
castShadowbooleantruefalseEnables light to cast shadows
intensitynumber0.5falseThe light's intensity, or strength.
rnumber255falseThe red component of the light’s color.
gnumber255falseThe green component of the light’s color.
bnumber255falseThe blue component of the light’s color.
targetXnumber0falseThe x coordinate of the point the light is targeting.
targetYnumberfalseThe y coordinate of the point the light is targeting.
targetZnumber0falseThe z coordinate of the point the light is targeting.
shadowBiasnumber -0.005falseHow much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
shadowNormalBiasnumber0falseDefines how much the position used to query the shadow map is offset along the object normal.
shadowRadiusnumber1false The radius of the shadow.
shadowAutoUpdatebooleantruefalseEnables automatic updates of the light's shadow. Default is true. If you do not require dynamic lighting / shadows, you may set this to false.
shadowBlurSamplesnumber8falseThe amount of samples to use when blurring a VSM shadow map.
shadowMapSizeheightnumber 1024 falseHeight of the shadow map. Higher values give better quality shadows at the cost of computation time. Values must be powers of 2
shadowMapSizeWidthnumber 1024falseWidth of the shadow map. Higher values give better quality shadows at the cost of computation time. Values must be powers of 2
shadowCameraNearnumber0.5falseCamera frustum near plane. The valid range is between 0 and the current value of the far plane.
shadowCameraFarnumber 200 false Camera frustum far plane. Must be greater than the current value of the near plane.
shadowCameraLeftnumber -50 false Camera frustum left plane.
shadowCameraRightnumber 50falseCamera frustum right plane.
shadowCameraTopnumber50falseCamera frustum top plane.
shadowCameraBottomnumber-50falseCamera frustum bottom plane.