Class DirectionalLight
Hierarchy
- ShadowLight
- DirectionalLight
Index
Constructors
Properties
- animations
- auto
Calc ShadowZBounds - auto
Update Extends - custom
Projection Matrix Builder - diffuse
- falloff
Type - id
- inspectable
Custom Properties - intensity
- metadata
- name
- on
Dispose Observable - on
Ready - render
Priority - reserved
Data Store - specular
- state
- transformed
Direction - transformed
Position - unique
Id - FALLOFF_
DEFAULT - FALLOFF_
GLTF - FALLOFF_
PHYSICAL - FALLOFF_
STANDARD - INTENSITYMODE_
AUTOMATIC - INTENSITYMODE_
ILLUMINANCE - INTENSITYMODE_
LUMINANCE - INTENSITYMODE_
LUMINOUSINTENSITY - INTENSITYMODE_
LUMINOUSPOWER - LIGHTMAP_
DEFAULT - LIGHTMAP_
SHADOWSONLY - LIGHTMAP_
SPECULAR - LIGHTTYPEID_
DIRECTIONALLIGHT - LIGHTTYPEID_
HEMISPHERICLIGHT - LIGHTTYPEID_
POINTLIGHT - LIGHTTYPEID_
SPOTLIGHT
Accessors
- animation
Properties Override - behaviors
- direction
- do
Not Serialize - exclude
With Layer Mask - excluded
Meshes - include
Only With Layer Mask - included
Only Meshes - intensity
Mode - lightmap
Mode - on
Cloned Observable - on
Dispose - on
Enabled State Changed Observable - ortho
Bottom - ortho
Left - ortho
Right - ortho
Top - parent
- position
- radius
- range
- shadow
Enabled - shadow
Frustum Size - shadow
MaxZ - shadow
MinZ - shadow
Ortho Scale - world
Matrix From Cache
Methods
- _bind
Light - add
Behavior - begin
Animation - can
Affect Mesh - clone
- compute
Transformed Information - compute
World Matrix - create
Animation Range - delete
Animation Range - dispose
- force
Projection Matrix Compute - get
Absolute Position - get
Animation By Name - get
Animation Range - get
Animation Ranges - get
Behavior By Name - get
Child Meshes - get
Children - get
Class Name - get
Depth MaxZ - get
Depth MinZ - get
Depth Scale - get
Descendants - get
Engine - get
Hierarchy Bounding Vectors - get
Rotation - get
Scaled Intensity - get
Scene - get
Shadow Direction - get
Shadow Generator - get
TypeID - get
World Matrix - is
Descendant Of - is
Disposed - is
Enabled - is
Ready - mark
As Dirty - need
Cube - need
Projection Matrix Compute - prepare
Light Specific Defines - remove
Behavior - serialize
- serialize
Animation Ranges - set
Direction To Target - set
Enabled - set
Shadow Projection Matrix - to
String - transfer
Textures To Effect - transfer
To Effect - transfer
To Node Material Effect - Add
Node Constructor - Construct
- Get
Constructor From Name - Parse
- Parse
Animation Ranges
Constructors
constructor
Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3). The directional light is emitted from everywhere in the given direction. It can cast shadows. Documentation : https://doc.babylonjs.com/babylon101/lights
Parameters
name: string
The friendly name of the light
direction: Vector3
The direction of the light
scene: Scene
The scene the light belongs to
Returns DirectionalLight
Properties
animationsSearch playground for animations
Gets a list of Animations associated with the node
auto Calc ShadowZBoundsSearch playground for autoCalcShadowZBounds
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
auto Update ExtendsSearch playground for autoUpdateExtends
Automatically compute the projection matrix to best fit (including all the casters) on each frame.
custom Projection Matrix BuilderSearch playground for customProjectionMatrixBuilder
Type declaration
Callback defining a custom Projection Matrix Builder. This can be used to override the default projection matrix computation.
Parameters
viewMatrix: Matrix
renderList: AbstractMesh[]
result: Matrix
Returns void
diffuseSearch playground for diffuse
Diffuse gives the basic color to an object.
falloff TypeSearch playground for 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.
idSearch playground for id
Gets or sets the id of the node
inspectable Custom PropertiesSearch playground for inspectableCustomProperties
List of inspectable custom properties (used by the Inspector)
intensitySearch playground for intensity
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.
metadataSearch playground for metadata
Gets or sets an object used to store user defined information for the node
nameSearch playground for name
Gets or sets the name of the node
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the mesh is disposed
on ReadySearch playground for onReady
Callback raised when the node is ready to be used
render PrioritySearch playground for renderPriority
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.
reserved Data StoreSearch playground for reservedDataStore
For internal use only. Please do not use.
specularSearch playground for specular
Specular produces a highlight color on an object. Note: This is not affecting PBR materials.
stateSearch playground for state
Gets or sets a string used to store user defined state for the node
transformed DirectionSearch playground for transformedDirection
The transformed direction. Direction of the light in world space taking parenting in account.
transformed PositionSearch playground for transformedPosition
The transformed position. Position of the light in world space taking parenting in account.
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node
Static Readonly FALLOFF_ DEFAULTSearch playground for FALLOFF_DEFAULT
Falloff Default: light is falling off following the material specification: standard material is using standard falloff whereas pbr material can request special falloff per materials.
Static Readonly FALLOFF_ GLTFSearch playground for FALLOFF_GLTF
Falloff gltf: light is falling off as described in the gltf moving to PBR document to enhance interoperability with other engines.
Static Readonly FALLOFF_ PHYSICALSearch playground for FALLOFF_PHYSICAL
Falloff Physical: light is falling off following the inverse squared distance law.
Static Readonly FALLOFF_ STANDARDSearch playground for FALLOFF_STANDARD
Falloff Standard: light is falling off like in the standard material to enhance interoperability with other materials.
Static Readonly INTENSITYMODE_ AUTOMATICSearch playground for INTENSITYMODE_AUTOMATIC
Each light type uses the default quantity according to its type: point/spot lights use luminous intensity directional lights use illuminance
Static Readonly INTENSITYMODE_ ILLUMINANCESearch playground for INTENSITYMODE_ILLUMINANCE
lux (lm/m^2)
Static Readonly INTENSITYMODE_ LUMINANCESearch playground for INTENSITYMODE_LUMINANCE
nit (cd/m^2)
Static Readonly INTENSITYMODE_ LUMINOUSINTENSITYSearch playground for INTENSITYMODE_LUMINOUSINTENSITY
candela (lm/sr)
Static Readonly INTENSITYMODE_ LUMINOUSPOWERSearch playground for INTENSITYMODE_LUMINOUSPOWER
lumen (lm)
Static Readonly LIGHTMAP_ DEFAULTSearch playground for LIGHTMAP_DEFAULT
If every light affecting the material is in this lightmapMode, material.lightmapTexture adds or multiplies (depends on material.useLightmapAsShadowmap) after every other light calculations.
Static Readonly LIGHTMAP_ SHADOWSONLYSearch playground for LIGHTMAP_SHADOWSONLY
material.lightmapTexture as only lighting no light calculation from this light only adds dynamic shadows from this light
Static Readonly LIGHTMAP_ SPECULARSearch playground for LIGHTMAP_SPECULAR
material.lightmapTexture as only diffuse lighting from this light adds only specular lighting from this light adds dynamic shadows
Static Readonly LIGHTTYPEID_ DIRECTIONALLIGHTSearch playground for LIGHTTYPEID_DIRECTIONALLIGHT
Light type var id of the directional light.
Static Readonly LIGHTTYPEID_ HEMISPHERICLIGHTSearch playground for LIGHTTYPEID_HEMISPHERICLIGHT
Light type var id of the hemispheric light.
Static Readonly LIGHTTYPEID_ POINTLIGHTSearch playground for LIGHTTYPEID_POINTLIGHT
Light type var id of the point light.
Static Readonly LIGHTTYPEID_ SPOTLIGHTSearch playground for LIGHTTYPEID_SPOTLIGHT
Light type var id of the spot light.
Accessors
animation Properties Override
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
Gets or sets the animation properties override
Parameters
value: Nullable<AnimationPropertiesOverride>
Returns void
behaviors
direction
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.
Returns Vector3
In 2d mode (needCube being false), sets the direction used to cast the shadow. Also use as the light direction on spot and directional lights.
Parameters
value: Vector3
Returns void
do Not Serialize
Gets or sets a boolean used to define if the node must be serialized
Returns boolean
Gets or sets a boolean used to define if the node must be serialized
Parameters
value: boolean
Returns void
exclude With Layer Mask
Gets the layer id use to find what meshes are not impacted by the light. Inactive if 0
Returns number
Sets the layer id use to find what meshes are not impacted by the light. Inactive if 0
Parameters
value: number
Returns void
excluded Meshes
Gets the meshes not impacted by this light.
Returns AbstractMesh[]
Sets the meshes not impacted by this light.
Parameters
value: AbstractMesh[]
Returns void
include Only With Layer Mask
Gets the layer id use to find what meshes are impacted by the light. Inactive if 0
Returns number
Sets the layer id use to find what meshes are impacted by the light. Inactive if 0
Parameters
value: number
Returns void
included Only Meshes
Gets the only meshes impacted by this light.
Returns AbstractMesh[]
Sets the only meshes impacted by this light.
Parameters
value: AbstractMesh[]
Returns void
intensity Mode
Gets 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.
Returns number
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.
Parameters
value: number
Returns void
lightmap Mode
Gets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x)
Returns number
Sets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x)
Parameters
value: number
Returns void
on Cloned Observable
An event triggered when the node is cloned
Returns Observable<Node>
on Dispose
Sets a callback that will be raised when the node will be disposed
Parameters
callback: (() => void)
Returns void
Returns void
on Enabled State Changed Observable
An event triggered when the enabled state of the node changes
Returns Observable<boolean>
ortho Bottom
Gets or sets the orthoBottom property used to build the light frustum
Returns number
Gets or sets the orthoBottom property used to build the light frustum
Parameters
bottom: number
Returns void
ortho Left
Gets or sets the orthoLeft property used to build the light frustum
Returns number
Gets or sets the orthoLeft property used to build the light frustum
Parameters
left: number
Returns void
ortho Right
Gets or sets the orthoRight property used to build the light frustum
Returns number
Gets or sets the orthoRight property used to build the light frustum
Parameters
right: number
Returns void
ortho Top
Gets or sets the orthoTop property used to build the light frustum
Returns number
Gets or sets the orthoTop property used to build the light frustum
Parameters
top: number
Returns void
parent
position
radius
Gets the light radius used by PBR Materials to simulate soft area lights.
Returns number
sets the light radius used by PBR Materials to simulate soft area lights.
Parameters
value: number
Returns void
range
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.
Returns number
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.
Parameters
value: number
Returns void
shadow Enabled
Gets whether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching the current shadow generator.
Returns boolean
Sets whether or not the shadows are enabled for this light. This can help turning off/on shadow without detaching the current shadow generator.
Parameters
value: boolean
Returns void
shadow Frustum Size
Fix frustum size for the shadow generation. This is disabled if the value is 0.
Returns number
Specifies a fix frustum size for the shadow generation.
Parameters
value: number
Returns void
shadow MaxZ
Sets the shadow projection clipping maximum z value.
Returns number
Gets the shadow projection clipping maximum z value.
Parameters
value: number
Returns void
shadow MinZ
Gets the shadow projection clipping minimum z value.
Returns number
Sets the shadow projection clipping minimum z value.
Parameters
value: number
Returns void
shadow Ortho Scale
Gets the shadow projection scale against the optimal computed one. 0.1 by default which means that the projection window is increase by 10% from the optimal size. This does not impact in fixed frustum size (shadowFrustumSize being set)
Returns number
Sets the shadow projection scale against the optimal computed one. 0.1 by default which means that the projection window is increase by 10% from the optimal size. This does not impact in fixed frustum size (shadowFrustumSize being set)
Parameters
value: number
Returns void
world Matrix From Cache
Returns directly the latest state of the mesh World matrix. A Matrix is returned.
Returns Matrix
Methods
_bind LightSearch playground for _bindLight
Binds the lights information from the scene to the effect for the given mesh.
Parameters
lightIndex: number
Light index
scene: Scene
The scene where the light belongs to
effect: Effect
The effect we are binding the data to
useSpecular: boolean
Defines if specular is supported
Optional receiveShadows: boolean
Defines if the effect (mesh) we bind the light for receives shadows
Returns void
add BehaviorSearch playground for addBehavior
begin AnimationSearch playground for beginAnimation
Will start the animation sequence
Parameters
name: string
defines the range frames for animation sequence
Optional loop: boolean
defines if the animation should loop (false by default)
Optional speedRatio: number
defines the speed factor in which to run the animation (1 by default)
Optional onAnimationEnd: (() => void)
defines a function to be executed when the animation ended (undefined by default)
Returns void
Returns Nullable<Animatable>
the object created for this animation. If range does not exist, it will return null
can Affect MeshSearch playground for canAffectMesh
Specifies if the light will affect the passed mesh.
Parameters
mesh: AbstractMesh
The mesh to test against the light
Returns boolean
true the mesh is affected otherwise, false.
cloneSearch playground for clone
compute Transformed InformationSearch playground for computeTransformedInformation
Computes the transformed information (transformedPosition and transformedDirection in World space) of the current light
Returns boolean
true if the information has been computed, false if it does not need to (no parenting)
compute World MatrixSearch playground for computeWorldMatrix
Computes the world matrix of the node
Parameters
Optional force: boolean
defines if the cache version should be invalidated forcing the world matrix to be created from scratch
Returns Matrix
the world matrix
create Animation RangeSearch playground for createAnimationRange
Creates an animation range for this node
Parameters
name: string
defines the name of the range
from: number
defines the starting key
to: number
defines the end key
Returns void
delete Animation RangeSearch playground for deleteAnimationRange
Delete a specific animation range
Parameters
name: string
defines the name of the range to delete
Optional deleteFrames: boolean
defines if animation frames from the range must be deleted as well
Returns void
disposeSearch playground for dispose
Releases resources associated with this node.
Parameters
Optional doNotRecurse: boolean
Set to true to not recurse into each children (recurse into each children by default)
Optional disposeMaterialAndTextures: boolean
Set to true to also dispose referenced materials and textures (false by default)
Returns void
force Projection Matrix ComputeSearch playground for forceProjectionMatrixCompute
Forces the shadow generator to recompute the projection matrix even if position and direction did not changed.
Returns void
get Absolute PositionSearch playground for getAbsolutePosition
Returns the ShadowLight absolute position in the World.
Returns Vector3
the position vector in world space
get Animation By NameSearch playground for getAnimationByName
get Animation RangeSearch playground for getAnimationRange
Get an animation range by name
Parameters
name: string
defines the name of the animation range to look for
Returns Nullable<AnimationRange>
null if not found else the requested animation range
get Animation RangesSearch playground for getAnimationRanges
Gets the list of all animation ranges defined on this node
Returns Nullable<AnimationRange>[]
an array
get Behavior By NameSearch playground for getBehaviorByName
get Child MeshesSearch playground for getChildMeshes
Get all child-meshes of this node
Type Parameters
T extends AbstractMesh<T>
Parameters
Optional directDescendantsOnly: boolean
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 (Default: false)
Optional predicate: ((node: Node) => node is T)
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
Parameters
node: Node
Returns node is T
Returns T[]
an array of AbstractMesh
Get all child-meshes of this node
Parameters
Optional directDescendantsOnly: boolean
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 (Default: false)
Optional predicate: ((node: Node) => boolean)
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
Parameters
node: Node
Returns boolean
Returns AbstractMesh[]
an array of AbstractMesh
get ChildrenSearch playground for getChildren
Get all direct children of this node
Type Parameters
T extends Node<T>
Parameters
Optional predicate: ((node: Node) => node is T)
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
Parameters
node: Node
Returns node is T
Optional directDescendantsOnly: boolean
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 (Default: true)
Returns T[]
an array of Node
Get all direct children of this node
Parameters
Optional predicate: ((node: Node) => boolean)
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
Parameters
node: Node
Returns boolean
Optional directDescendantsOnly: boolean
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 (Default: true)
Returns Node[]
an array of Node
get Class NameSearch playground for getClassName
Returns the string "DirectionalLight".
Returns string
The class name
get Depth MaxZSearch playground for getDepthMaxZ
Gets the maxZ used for shadow according to both the scene and the light.
Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5. (when not using reverse depth buffer / NDC half Z range)
Parameters
activeCamera: Camera
The camera we are returning the max for
Returns number
the depth max z
get Depth MinZSearch playground for getDepthMinZ
Gets the minZ used for shadow according to both the scene and the light.
Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5. (when not using reverse depth buffer / NDC half Z range)
Parameters
activeCamera: Camera
The camera we are returning the min for
Returns number
the depth min z
get Depth ScaleSearch playground for getDepthScale
Return the depth scale used for the shadow map.
Returns number
the depth scale.
get DescendantsSearch playground for getDescendants
Will return all nodes that have this node as ascendant
Type Parameters
T extends Node<T>
Parameters
Optional directDescendantsOnly: boolean
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
Optional predicate: ((node: Node) => node is T)
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
Parameters
node: Node
Returns node is T
Returns T[]
all children nodes of all types
Will return all nodes that have this node as ascendant
Parameters
Optional directDescendantsOnly: boolean
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
Optional predicate: ((node: Node) => boolean)
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
Parameters
node: Node
Returns boolean
Returns Node[]
all children nodes of all types
get EngineSearch playground for getEngine
Gets the engine of the node
Returns Engine
a Engine
get Hierarchy Bounding VectorsSearch playground for getHierarchyBoundingVectors
Return the minimum and maximum world vectors of the entire hierarchy under current node
Parameters
Optional includeDescendants: boolean
Include bounding info from descendants as well (true by default)
Optional predicate: Nullable<((abstractMesh: AbstractMesh) => boolean)>
defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors
Returns { max: Vector3; min: Vector3 }
the new bounding vectors
get RotationSearch playground for getRotation
Returns the light rotation in euler definition.
Returns Vector3
the x y z rotation in local space.
get Scaled IntensitySearch playground for getScaledIntensity
Returns the intensity scaled by the Photometric Scale according to the light type and intensity mode.
Returns number
the scaled intensity in intensity mode unit
get SceneSearch playground for getScene
Gets the scene of the node
Returns Scene
a scene
get Shadow DirectionSearch playground for getShadowDirection
Get the direction to use to render the shadow map. In case of cube texture, the face index can be passed.
Parameters
Optional faceIndex: number
The index of the face we are computed the direction to generate shadow
Returns Vector3
The set direction in 2d mode otherwise the direction to the cubemap face if needCube() is true
get Shadow GeneratorSearch playground for getShadowGenerator
Returns the Light associated shadow generator if any.
Returns Nullable<IShadowGenerator>
the associated shadow generator.
get TypeIDSearch playground for getTypeID
Returns the integer 1.
Returns number
The light Type id as a constant defines in Light.LIGHTTYPEID_x
get World MatrixSearch playground for getWorldMatrix
Returns the latest update of the World matrix
Returns Matrix
a Matrix
is Descendant OfSearch playground for isDescendantOf
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
Parameters
ancestor: Node
defines the parent node to inspect
Returns boolean
a boolean indicating if this node is a descendant of the given node
is DisposedSearch playground for isDisposed
Gets a boolean indicating if the node has been disposed
Returns boolean
true if the node was disposed
is EnabledSearch playground for isEnabled
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
Parameters
Optional checkAncestors: boolean
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
Returns boolean
whether this node (and its parent) is enabled
is ReadySearch playground for isReady
Is this node ready to be used/rendered
Parameters
Optional _completeCheck: boolean
defines if a complete check (including materials and lights) has to be done (false by default)
Returns boolean
true if the node is ready
mark As DirtySearch playground for markAsDirty
Flag the node as dirty (Forcing it to update everything)
Parameters
Optional _property: string
helps children apply precise "dirtyfication"
Returns Node
this node
need CubeSearch playground for needCube
Returns whether or not the shadow generation require a cube texture or a 2d texture.
Returns boolean
true if a cube texture needs to be use
need Projection Matrix ComputeSearch playground for needProjectionMatrixCompute
Detects if the projection matrix requires to be recomputed this frame.
Returns boolean
true if it requires to be recomputed otherwise, false.
prepare Light Specific DefinesSearch playground for prepareLightSpecificDefines
Prepares the list of defines specific to the light type.
Parameters
defines: any
the list of defines
lightIndex: number
defines the index of the light for the effect
Returns void
remove BehaviorSearch playground for removeBehavior
serializeSearch playground for serialize
Serializes the current light into a Serialization object.
Returns any
the serialized object.
serialize Animation RangesSearch playground for serializeAnimationRanges
Serialize animation ranges into a JSON compatible object
Returns any
serialization object
set Direction To TargetSearch playground for setDirectionToTarget
set EnabledSearch playground for setEnabled
Set the enabled state of this node.
Parameters
value: boolean
the new enabled state
Returns void
set Shadow Projection MatrixSearch playground for setShadowProjectionMatrix
Sets the shadow projection matrix in parameter to the generated projection matrix.
Parameters
matrix: Matrix
The matrix to updated with the projection information
viewMatrix: Matrix
The transform matrix of the light
renderList: AbstractMesh[]
The list of mesh to render in the map
Returns IShadowLight
The current light
to StringSearch playground for toString
Converts the light information to a readable string for debug purpose.
Parameters
Optional fullDetails: boolean
Supports for multiple levels of logging within scene loading
Returns string
the human readable light info
transfer Textures To EffectSearch playground for transferTexturesToEffect
transfer To EffectSearch playground for transferToEffect
Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.
Parameters
effect: Effect
The effect to update
lightIndex: string
The index of the light in the effect to update
Returns DirectionalLight
The directional light
transfer To Node Material EffectSearch playground for transferToNodeMaterialEffect
Static Add Node ConstructorSearch playground for AddNodeConstructor
Add a new node constructor
Parameters
type: string
defines the type name of the node to construct
constructorFunc: NodeConstructor
defines the constructor function
Returns void
Static ConstructSearch playground for Construct
Returns a node constructor based on type name
Parameters
type: string
defines the type name
name: string
defines the new node name
scene: Scene
defines the hosting scene
Optional options: any
defines optional options to transmit to constructors
Returns Nullable<(() => Node)>
the new constructor or null
Static Get Constructor From NameSearch playground for GetConstructorFromName
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.
Parameters
type: number
Type according to the types available in Light.LIGHTTYPEID_x
name: string
The friendly name of the light
scene: Scene
The scene the new light will belong to
Returns Nullable<(() => Light)>
the constructor function
A directional light is defined by a direction (what a surprise!). The light is emitted from everywhere in the specified direction, and has an infinite range. An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object. Documentation: https://doc.babylonjs.com/babylon101/lights