Class DirectionalLight
Hierarchy (View Summary)
- ShadowLight
- DirectionalLight
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new DirectionalLight(
name: string,
direction: Vector3,
scene?: Scene,
dontAddToScene?: boolean,
): DirectionalLightCreates 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/features/featuresDeepDive/lights/lights_introduction
Parameters
Returns DirectionalLight
Properties
animations
Gets a list of Animations associated with the node
auto Calc Shadow Z Bounds
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 Extends
Automatically compute the projection matrix to best fit (including all the casters) on each frame.
custom Projection Matrix Builder
viewMatrix: Matrix,
renderList: AbstractMesh[],
result: Matrix,
) => void
Callback defining a custom Projection Matrix Builder. This can be used to override the default projection matrix computation.
diffuse
Diffuse gives the basic color to an object.
falloff Type
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.
id
Gets or sets the id of the node
inspectable Custom Properties
List of inspectable custom properties (used by the Inspector)
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.
metadata
Gets or sets an object used to store user defined information for the node
name
Gets or sets the name of the node
on Accessibility Tag Changed Observable
Observable fired when an accessibility tag is changed
on Dispose Observable
An event triggered when the mesh is disposed
on Ready
Callback raised when the node is ready to be used
reserved Data Store
For internal use only. Please do not use.
specular
Specular produces a highlight color on an object. Note: This is not affecting PBR materials.
state
Gets or sets a string used to store user defined state for the node
transformed Direction
The transformed direction. Direction of the light in world space taking parenting in account.
transformed Position
The transformed position. Position of the light in world space taking parenting in account. Needs to be computed by calling computeTransformedInformation.
unique Id
Gets or sets the unique id of the node
Static ReadonlyFALLOFF_ 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 ReadonlyFALLOFF_ GLTF
Falloff gltf: light is falling off as described in the gltf moving to PBR document to enhance interoperability with other engines.
Static ReadonlyFALLOFF_ PHYSICAL
Falloff Physical: light is falling off following the inverse squared distance law.
Static ReadonlyFALLOFF_ STANDARD
Falloff Standard: light is falling off like in the standard material to enhance interoperability with other materials.
Static ReadonlyINTENSITYMODE_ AUTOMATIC
Each light type uses the default quantity according to its type: point/spot lights use luminous intensity directional lights use illuminance
Static ReadonlyINTENSITYMODE_ ILLUMINANCE
lux (lm/m^2)
Static ReadonlyINTENSITYMODE_ LUMINANCE
nit (cd/m^2)
Static ReadonlyINTENSITYMODE_ LUMINOUSINTENSITY
candela (lm/sr)
Static ReadonlyINTENSITYMODE_ LUMINOUSPOWER
lumen (lm)
Static ReadonlyLIGHTMAP_ 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 ReadonlyLIGHTMAP_ SHADOWSONLY
material.lightmapTexture as only lighting no light calculation from this light only adds dynamic shadows from this light
Static ReadonlyLIGHTMAP_ SPECULAR
material.lightmapTexture as only diffuse lighting from this light adds only specular lighting from this light adds dynamic shadows
Static ReadonlyLIGHTTYPEID_ DIRECTIONALLIGHT
Light type const id of the directional light.
Static ReadonlyLIGHTTYPEID_ HEMISPHERICLIGHT
Light type const id of the hemispheric light.
Static ReadonlyLIGHTTYPEID_ POINTLIGHT
Light type const id of the point light.
Static ReadonlyLIGHTTYPEID_ RECT_ AREALIGHT
Light type const id of the area light.
Static ReadonlyLIGHTTYPEID_ SPOTLIGHT
Light type const id of the spot light.
Accessors
accessibility Tag
animation Properties Override
-
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
-
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
-
get doNotSerialize(): boolean
Gets or sets a boolean used to define if the node must be serialized
Returns boolean
-
set doNotSerialize(value: boolean): void
Parameters
- value: boolean
Returns void
excluded Meshes
-
Gets the meshes not impacted by this light.
Returns AbstractMesh[]
exclude With Layer Mask
-
get excludeWithLayerMask(): number
Gets the layer id use to find what meshes are not impacted by the light. Inactive if 0
Returns number
-
set excludeWithLayerMask(value: number): void
Sets the layer id use to find what meshes are not 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[]
include Only With Layer Mask
-
get includeOnlyWithLayerMask(): number
Gets the layer id use to find what meshes are impacted by the light. Inactive if 0
Returns number
-
set includeOnlyWithLayerMask(value: number): void
Sets the layer id use to find what meshes are impacted by the light. Inactive if 0
Parameters
- value: number
Returns void
inherit Visibility
-
get inheritVisibility(): boolean
-
set inheritVisibility(value: boolean): void
Parameters
- value: boolean
Returns void
intensity Mode
-
get intensityMode(): number
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
-
set intensityMode(value: number): void
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
is Visible
-
get isVisible(): boolean
-
set isVisible(value: boolean): void
Parameters
- value: boolean
Returns void
lightmap Mode
-
get lightmapMode(): number
Gets the lightmap mode of this light (should be one of the constants defined by Light.LIGHTMAP_x)
Returns number
-
set lightmapMode(value: number): void
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
-
set onDispose(callback: () => void): void
Sets a callback that will be raised when the node will be disposed
Parameters
- callback: () => void
Returns void
on Effective Enabled State Changed Observable
-
An event triggered when the effective enabled state of the node changes, i.e. whenever the value returned by isEnabled changes. Unlike onEnabledStateChangedObservable, this fires for changes caused by an ancestor's enabled state as well as this node's own state. The observable is created on first access, so no cost is incurred for nodes that never observe it.
Returns Observable<boolean>
on Enabled State Changed Observable
-
An event triggered when the enabled state of the node changes. This only reflects changes to the node's own enabled flag (as set via setEnabled), not changes inherited from an ancestor. Use onEffectiveEnabledStateChangedObservable to also be notified when an ancestor's enabled state changes the effective enabled state.
Returns Observable<boolean>
ortho Bottom
-
get orthoBottom(): number
Gets or sets the orthoBottom property used to build the light frustum
Returns number
-
set orthoBottom(bottom: number): void
Parameters
- bottom: number
Returns void
ortho Left
-
get orthoLeft(): number
Gets or sets the orthoLeft property used to build the light frustum
Returns number
-
set orthoLeft(left: number): void
Parameters
- left: number
Returns void
ortho Right
-
get orthoRight(): number
Gets or sets the orthoRight property used to build the light frustum
Returns number
-
set orthoRight(right: number): void
Parameters
- right: number
Returns void
ortho Top
-
get orthoTop(): number
Gets or sets the orthoTop property used to build the light frustum
Returns number
-
set orthoTop(top: number): void
Parameters
- top: number
Returns void
parent
-
Gets or sets the parent of the node (without keeping the current position in the scene)
Returns void
position
radius
-
get radius(): number
Gets the light radius used by PBR Materials to simulate soft area lights.
Returns number
-
set radius(value: number): void
sets the light radius used by PBR Materials to simulate soft area lights.
Parameters
- value: number
Returns void
range
-
get range(): 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.
Returns number
-
set range(value: number): void
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
render Priority
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.
shadow Enabled
-
get shadowEnabled(): boolean
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
-
set shadowEnabled(value: boolean): void
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
-
get shadowFrustumSize(): number
Fix frustum size for the shadow generation. This is disabled if the value is 0.
Returns number
-
set shadowFrustumSize(value: number): void
Specifies a fix frustum size for the shadow generation.
Parameters
- value: number
Returns void
shadow Max Z
-
get shadowMaxZ(): number
Sets the shadow projection clipping maximum z value.
Returns number
-
set shadowMaxZ(value: number): void
Gets the shadow projection clipping maximum z value.
Parameters
- value: number
Returns void
shadow Min Z
-
get shadowMinZ(): number
Gets the shadow projection clipping minimum z value.
Returns number
-
set shadowMinZ(value: number): void
Sets the shadow projection clipping minimum z value.
Parameters
- value: number
Returns void
shadow Ortho Scale
-
get shadowOrthoScale(): number
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
-
set shadowOrthoScale(value: number): void
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 Light
add Behavior
are Light Textures Ready
-
Returns true when all texture resources used by this light are ready (e.g. projection textures). Override in subclasses that use texture resources.
Returns boolean
true if all light textures are ready
begin Animation
-
beginAnimation(
name: string,
loop?: boolean,
speedRatio?: number,
onAnimationEnd?: () => void,
): Nullable<Animatable>Will start the animation sequence
Parameters
- name: string
defines the range frames for animation sequence
Optionalloop: booleandefines if the animation should loop (false by default)
OptionalspeedRatio: numberdefines the speed factor in which to run the animation (1 by default)
OptionalonAnimationEnd: () => voiddefines a function to be executed when the animation ended (undefined by default)
Returns Nullable<Animatable>
the object created for this animation. If range does not exist, it will return null
- name: string
can Affect Mesh
-
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.
- mesh: AbstractMesh
clone
compute Transformed Information
-
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 Matrix
-
Computes the world matrix of the node
Parameters
Optionalforce: booleandefines if the cache version should be invalidated forcing the world matrix to be created from scratch
Returns Matrix
the world matrix
create Animation Range
-
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
- name: string
delete Animation Range
-
Delete a specific animation range
Parameters
- name: string
defines the name of the range to delete
- deleteFrames: boolean = true
defines if animation frames from the range must be deleted as well
Returns void
- name: string
dispose
-
Releases resources associated with this node.
Parameters
OptionaldoNotRecurse: booleanSet to true to not recurse into each children (recurse into each children by default)
- disposeMaterialAndTextures: boolean = false
Set to true to also dispose referenced materials and textures (false by default)
Returns void
force Projection Matrix Compute
-
Forces the shadow generator to recompute the projection matrix even if position and direction did not changed.
Returns void
get Absolute Position
-
If computeTransformedInformation has been called, returns the ShadowLight absolute position in the world. Otherwise, returns the local position.
Returns Vector3
the position vector in world space
get Animation By Name
get Animation Range
-
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
- name: string
get Animation Ranges
-
Gets the list of all animation ranges defined on this node
Returns Nullable<AnimationRange>[]
an array
get Behavior By Name
get Child Meshes
-
getChildMeshes<T extends AbstractMesh>(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => node is T,
): T[]Get all child-meshes of this node
Type Parameters
- T extends AbstractMesh
Parameters
OptionaldirectDescendantsOnly: booleandefines 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)
Optionalpredicate: (node: Node) => node is Tdefines 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
Returns T[]
an array of AbstractMesh
-
getChildMeshes(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => boolean,
): AbstractMesh[]Get all child-meshes of this node
Parameters
OptionaldirectDescendantsOnly: booleandefines 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)
Optionalpredicate: (node: Node) => booleandefines 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
Returns AbstractMesh[]
an array of AbstractMesh
get Children
-
getChildren<T extends Node>(
predicate?: (node: Node) => node is T,
directDescendantsOnly?: boolean,
): T[]Get all direct children of this node
Type Parameters
- T extends Node
Parameters
Optionalpredicate: (node: Node) => node is Tdefines 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
OptionaldirectDescendantsOnly: booleandefines 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
Optionalpredicate: (node: Node) => booleandefines 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
OptionaldirectDescendantsOnly: booleandefines 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 Name
-
Returns the string "DirectionalLight".
Returns string
The class name
get Depth Max Z
-
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)
Returns number
the depth max z
get Depth Min Z
-
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)
Returns number
the depth min z
get Depth Scale
-
Return the depth scale used for the shadow map.
Returns number
the depth scale.
get Descendants
-
getDescendants<T extends Node>(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => node is T,
): T[]Will return all nodes that have this node as ascendant
Type Parameters
- T extends Node
Parameters
OptionaldirectDescendantsOnly: booleandefines 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
Optionalpredicate: (node: Node) => node is Tdefines 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
Returns T[]
all children nodes of all types
-
Will return all nodes that have this node as ascendant
Parameters
OptionaldirectDescendantsOnly: booleandefines 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
Optionalpredicate: (node: Node) => booleandefines 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
Returns Node[]
all children nodes of all types
get Engine
get Hierarchy Bounding Vectors
-
getHierarchyBoundingVectors(
includeDescendants?: boolean,
predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>,
): { max: Vector3; min: Vector3 }Return the minimum and maximum world vectors of the entire hierarchy under current node
Parameters
- includeDescendants: boolean = true
Include bounding info from descendants as well (true by default)
- predicate: Nullable<(abstractMesh: AbstractMesh) => boolean> = null
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
- includeDescendants: boolean = true
get Projection Matrix
-
Returns the projection matrix. Note that viewMatrix and renderList are optional and are only used by lights that calculate the projection matrix from a list of meshes (e.g. directional lights with automatic extents calculation).
Parameters
OptionalviewMatrix: MatrixThe view transform matrix of the light (optional).
OptionalrenderList: AbstractMesh[]The list of meshes to take into account when calculating the projection matrix (optional).
Returns Nullable<Matrix>
The projection matrix. Can be null, if a projection matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
get Rotation
get Scaled Intensity
-
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 Scene
get Shadow Direction
-
Get the direction to use to render the shadow map. In case of cube texture, the face index can be passed.
Parameters
OptionalfaceIndex: numberThe 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 Generator
-
Returns the Light associated shadow generator if any.
Parameters
Returns Nullable<IShadowGenerator>
the associated shadow generator.
get Shadow Generators
-
Returns all the shadow generators associated to this light
Returns Nullable<Map<Nullable<Camera>, IShadowGenerator>>
get Type ID
-
Returns the integer 1.
Returns number
The light Type id as a constant defines in Light.LIGHTTYPEID_x
get View Matrix
-
Returns the view matrix.
Parameters
OptionalfaceIndex: numberThe index of the face for which we want to extract the view matrix. Only used for point light types.
Returns Nullable<Matrix>
The view matrix. Can be null, if a view matrix cannot be defined for the type of light considered (as for a hemispherical light, for example).
get World Matrix
is Descendant Of
-
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
- ancestor: Node
is Disposed
-
Gets a boolean indicating if the node has been disposed
Returns boolean
true if the node was disposed
is Enabled
-
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
- checkAncestors: boolean = 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
Returns boolean
whether this node (and its parent) is enabled
Remarks
To observe changes to the value returned when calling this with
checkAncestorsset to true (the default, i.e. the effective enabled state), subscribe to onEffectiveEnabledStateChangedObservable. To observe changes to the value returned when calling this withcheckAncestorsset to false (i.e. this node's own enabled state only), subscribe to onEnabledStateChangedObservable. - checkAncestors: boolean = true
is Ready
-
Is this node ready to be used/rendered
Parameters
- _completeCheck: boolean = false
defines if a complete check (including materials and lights) has to be done (false by default)
Returns boolean
true if the node is ready
- _completeCheck: boolean = false
mark As Dirty
-
Flag the node as dirty (Forcing it to update everything)
Parameters
Optional_property: stringhelps children apply precise "dirtyfication"
Returns Node
this node
need Cube
-
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 Compute
-
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 Defines
-
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
- defines: any
remove Behavior
serialize
-
Serializes the current light into a Serialization object.
Returns any
the serialized object.
serialize Animation Ranges
-
Serialize animation ranges into a JSON compatible object
Returns any
serialization object
set Direction To Target
set Enabled
-
Set the enabled state of this node.
Parameters
- value: boolean
the new enabled state
Returns void
- value: boolean
set Shadow Projection Matrix
-
setShadowProjectionMatrix(
matrix: Matrix,
viewMatrix: Matrix,
renderList: AbstractMesh[],
): IShadowLightSets 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
- matrix: Matrix
to String
-
Converts the light information to a readable string for debug purpose.
Parameters
OptionalfullDetails: booleanSupports for multiple levels of logging within scene loading
Returns string
the human readable light info
transfer Textures To Effect
transfer To Effect
-
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
- effect: Effect
transfer To Node Material Effect
StaticAdd Node Constructor
-
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
- type: string
StaticConstruct
StaticGet Constructor From Name
-
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
- type: number
StaticParse
-
Parses the passed "parsedLight" and returns a new instanced Light from this parsing.
Parameters
- parsedLight: any
The JSON representation of the light
- scene: Scene
The scene to create the parsed light in
- rootUrl: string = ""
The root url to use to load assets referenced by the light (e.g. textures)
Returns Nullable<Light>
the created light after parsing
- parsedLight: any
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/features/featuresDeepDive/lights/lights_introduction