Creates a Light object in the scene. Documentation : http://doc.babylonjs.com/tutorials/lights
The firendly name of the light
The scene the light belongs too
Gets or sets the animation properties override
Gets a list of Animations associated with the node
Gets the list of attached behaviors
Diffuse gives the basic color to an object.
Gets or sets a boolean used to define if the node must be serialized
Sets the layer id use to find what meshes are not impacted by the light. Inactive if 0
Sets the meshes not impacted by this light.
Gets or sets the id of the node
Sets the layer id use to find what meshes are impacted by the light. Inactive if 0
Sets the only meshes impacted by this light.
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.
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.
Sets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x)
Gets or sets an object used to store user defined information for the node
Gets or sets the name of the node
Sets a callback that will be raised when the node will be disposed
An event triggered when the mesh is disposed
Callback raised when the node is ready to be used
Gets or sets the parent of the node
sets the light radius used by PBR Materials to simulate soft area lights.
Defines how far from the source the light is impacting in scene units. Note: Unused in PBR material as the distance light falloff is defined following the inverse squared falloff.
Defines the rendering priority of the lights. It can help in case of fallback or number of lights exceeding the number allowed of the materials.
Defines wether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching the current shadow generator.
Specular produces a highlight color on an object. Note: This is note affecting PBR materials.
Gets or sets a string used to store user defined state for the node
Gets or sets the unique id of the node
Each light type uses the default quantity according to its type: point/spot lights use luminous intensity directional lights use illuminance
lux (lm/m^2)
nit (cd/m^2)
candela (lm/sr)
lumen (lm)
If every light affecting the material is in this lightmapMode, material.lightmapTexture adds or multiplies (depends on material.useLightmapAsShadowmap) after every other light calculations.
material.lightmapTexture as only lighting no light calculation from this light only adds dynamic shadows from this light
material.lightmapTexture as only diffuse lighting from this light adds only specular lighting from this light adds dynamic shadows
Light type const id of the directional light.
Light type const id of the hemispheric light.
Light type const id of the point light.
Light type const id of the spot light.
Will start the animation sequence
defines the range frames for animation sequence
defines if the animation should loop (false by default)
defines the speed factor in which to run the animation (1 by default)
defines a function to be executed when the animation ended (undefined by default)
the object created for this animation. If range does not exist, it will return null
Specifies if the light will affect the passed mesh.
The mesh to test against the light
true the mesh is affected otherwise, false.
Computes the world matrix of the node
defines if the cache version should be invalidated forcing the world matrix to be created from scratch
the world matrix
Creates an animation range for this node
defines the name of the range
defines the starting key
defines the end key
Delete a specific animation range
defines the name of the range to delete
defines if animation frames from the range must be deleted as well
Releases resources associated with this node.
Set to true to not recurse into each children (recurse into each children by default)
Set to true to also dispose referenced materials and textures (false by default)
Returns a Vector3, the absolute light position in the World.
the world space position of the light
Get an animation range by name
defines the name of the animation range to look for
null if not found else the requested animation range
Get all child-meshes of this node
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
an array of {BABYLON.AbstractMesh}
Get all child-transformNodes of this node
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
an array of {BABYLON.TransformNode}
Get all direct children of this node
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
an array of {BABYLON.Node}
Returns the string "Light".
the class name
Will return all nodes that have this node as ascendant
defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
all children nodes of all types
Gets the engine of the node
a {BABYLON.Engine}
Returns the intensity scaled by the Photometric Scale according to the light type and intensity mode.
the scaled intensity in intensity mode unit
Gets the scene of the node
a {BABYLON.Scene}
Returns the Light associated shadow generator if any.
the associated shadow generator.
Returns the light type ID (integer).
The light Type id as a constant defines in Light.LIGHTTYPEID_x
Is this node a descendant of the given node? The function will iterate up the hierarchy until the ancestor was found or no more parents defined
defines the parent node to inspect
a boolean indicating if this node is a descendant of the given node
Gets a boolean indicating if the node has been disposed
true if the node was disposed
Is this node enabled? If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true
indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors
whether this node (and its parent) is enabled
Is this node ready to be used/rendered
defines if a complete check (including materials and lights) has to be done (false by default)
true if the node is ready
Serializes the current light into a Serialization object.
the serialized object.
Serialize animation ranges into a JSON compatible object
serialization object
Set the enabled state of this node.
the new enabled state
Converts the light information to a readable string for debug purpose.
Supports for multiple levels of logging within scene loading
the human readable light info
Creates a new typed light from the passed type (integer) : point light = 0, directional light = 1, spot light = 2, hemispheric light = 3. This new light is named "name" and added to the passed scene.
Type according to the types available in Light.LIGHTTYPEID_x
The friendly name of the light
The scene the new light will belong to
the constructor function
Generated using TypeDoc
Base class of all the lights in Babylon. It groups all the generic information about lights. Lights are used, as you would expect, to affect how meshes are seen, in terms of both illumination and colour. All meshes allow light to pass through them unless shadow generation is activated. The default number of lights allowed is four but this can be increased.