Skip to main content

Interface: LightSettings

Properties

angle?

optional angle: number

Cone angle of the spot light in Radians. Used by Spot Light


autoCalcShadowZBounds?

optional autoCalcShadowZBounds: boolean

Automatically compute the shadowMinZ and shadowMaxZ for the projection matrix to best fit (including all the casters) on each frame. autoUpdateExtends must be set to true for this to work Used by Directional Light


autoUpdateExtends?

optional autoUpdateExtends: boolean

Automatically compute the projection matrix to best fit (including all the casters) on each frame. Used by Directional Light


color?

optional color: Color3

Diffuse gives the basic color to an object. Used by all light types


direction

direction: number[]

Type of direction depends on light type:

  1. Hemispheric - The light reflection direction, not the incoming direction.
  2. Point - In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback
  3. Spot and Directional - In 2d mode (needCube being false), gets the direction used to cast the shadow. Also use as the light direction on spot and directional lights. Used by all light types

exponent?

optional exponent: number

The light decay speed with the distance from the emission spot. Used by Spot Light


falloffType

falloffType: FalloffType

Defines the falloff type for this light. This lets overriding how punctual light are falling off base on range or angle. This can be set to any values in Light.FALLOFF_x.

Note: This is only useful for PBR Materials at the moment. This could be extended if required to other types of materials.


groundColor?

optional groundColor: Color3

The groundColor is the light in the opposite direction to the one specified during creation. You can think of the diffuse and specular light as coming from the centre of the object in the given direction and the groundColor light in the opposite direction. Used by following light types: Hemispheric


innerAngle?

optional innerAngle: number

Only used in gltf falloff mode, this defines the angle where the directional falloff will start before cutting at angle which could be seen as outer angle. Used by Spot Light


intensity

intensity: number

Strength of the light. Note: By default it is define in the framework own unit. Note: In PBR materials the intensityMode can be use to chose what unit the intensity is defined in. Used by all light types.


intensityMode

intensityMode: IntensityMode

Sets the photometric scale used to interpret the intensity. This is only relevant with PBR Materials where the light intensity can be defined in a physical way.


isEnabled?

optional isEnabled: boolean

If true, light is enabled


name?

optional name: string

Unique light name


position

position: number[]

Sets the position the shadow will be casted from. Also use as the light position for both point and spot lights. Used by following light types: Point, Spot, Directional


radius?

optional radius: number

Light radius used by PBR Materials to simulate soft area lights. Used by all lights


shadowEnabled?

optional shadowEnabled: boolean

Sets whether the shadows are enabled for this light. This can help turning off/on shadow without detaching the current shadow generator. Used by all light types.


shadowMaxZ?

optional shadowMaxZ: number

Sets the shadow projection clipping maximum z value. Used by following light types: Directional, Point, Spot


shadowMinZ?

optional shadowMinZ: number

Sets the shadow projection clipping minimum z value. Used by following light types: Directional, Point, Spot


specularColor?

optional specularColor: Color3

Specular produces a highlight color on an object. Note: This is not affecting PBR materials. Used by all light types


target

target: number[]

The target the direction should point to Used by all light types


type?

optional type: LightType

Light type