Acts as a source of light in the scene. See the Light and Shadows guide for more information about lighting.

// Sets the intensity of a light source
//@input Component.LightSource lightSource

script.lightSource.intensity = 0.0;
interface LightSource {
    autoLightSourcePosition: boolean;
    autoShadowFrustumSize: boolean;
    castsShadows: boolean;
    color: vec3;
    diffuseEnvmapTexture: Texture;
    enabled: boolean;
    envmapExposure: number;
    envmapRotation: number;
    intensity: number;
    renderLayer: LayerSet;
    sceneObject: SceneObject;
    shadowBlurRadius: number;
    shadowColor: vec4;
    shadowDensity: number;
    shadowFrustumFarClipPlane: number;
    shadowFrustumNearClipPlane: number;
    shadowFrustumSize: number;
    specularEnvmapTexture: Texture;
    uniqueIdentifier: string;
    useEnvmap: boolean;
    destroy(): void;
    getSceneObject(): SceneObject;
    getTransform(): Transform;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

autoLightSourcePosition: boolean

If enabled, the LightSource will be automatically positioned based on its orientation relative to any shadow casting meshes in the scene.

autoShadowFrustumSize: boolean

If enabled, shadowFrustumSize will be automatically updated based on its orientation relative to any shadow casting meshes in the scene.

castsShadows: boolean

If enabled, the LightSource will be able to cast shadows.

color: vec3

The color of the light.

diffuseEnvmapTexture: Texture

A color image applied to an imaginary skybox the LightSource will use for color information.

enabled: boolean

If disabled, the Component will stop enacting its behavior.

envmapExposure: number

A value used to increase the intensity of light information derived from the diffuseEnvmapTexture exponentially.

envmapRotation: number

Controls the amount of rotation applied to the diffuseEnvmapTexture.

intensity: number

The strength of the light on a scale of 0.0 1.0.

renderLayer: LayerSet

The set of layers this LightSource will affect.

sceneObject: SceneObject
shadowBlurRadius: number

Controls the blurring size used when casting shadows from this LightSource.

shadowColor: vec4

Controls the color used when casting shadows from this LightSource.

shadowDensity: number

The lightness and darkness value of the shadow cast by objects from this light source.

shadowFrustumFarClipPlane: number

The maximum distance at which shadows will be calculated for this LightSource.

shadowFrustumNearClipPlane: number

The minimum distance at which shadows will be calculated for this LightSource.

shadowFrustumSize: number

The simulated distance of the light source from objects to calculate the softness of the shadow.

specularEnvmapTexture: Texture

A color image applied to an imaginary skybox the light source will use for specular and reflection information.

uniqueIdentifier: string
useEnvmap: boolean

Enable if you would like the LightSource to use information from the diffuseEnvmapTexture for light color information.

Methods

  • Destroys the component.

    Returns void

  • Returns the name of this object's type.

    Returns string

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean