Class RectAreaLight
Hierarchy (View Summary)
- WebXRSpatialLayerType
- RectAreaLight
Constructors
constructor
-
new RectAreaLight(
name: string,
position: Vector3,
width: number,
height: number,
scene?: any,
dontAddToScene?: boolean,
): RectAreaLightCreates a rectangular area light object. Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
Parameters
- name: string
The friendly name of the light
- position: Vector3
The position of the area light.
- width: number
The width of the area light.
- height: number
The height of the area light.
Optionalscene: anyThe scene the light belongs to
OptionaldontAddToScene: booleanTrue to not add the light to the scene
Returns RectAreaLight
- name: string
Accessors
emission Texture
-
get emissionTexture(): Nullable<BaseTexture>
Gets Rect Area Light emission texture. (Note: This texture needs pre-processing! Use AreaLightTextureTools to pre-process the texture).
Returns Nullable<BaseTexture>
-
set emissionTexture(value: Nullable<BaseTexture>): void
Sets Rect Area Light emission texture. (Note: This texture needs pre-processing! Use AreaLightTextureTools to pre-process the texture).
Parameters
- value: Nullable<BaseTexture>
Returns void
height
-
get height(): number
Rect Area Light height.
Returns number
-
set height(value: number): void
Rect Area Light height.
Parameters
- value: number
Returns void
width
-
get width(): number
Rect Area Light width.
Returns number
-
set width(value: number): void
Rect Area Light width.
Parameters
- value: number
Returns void
Methods
get Class Name
-
Returns the string "RectAreaLight"
Returns string
the class name
get Type ID
-
Returns the integer 4.
Returns number
The light Type id as a constant defines in Light.LIGHTTYPEID_x
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
serialize
-
Serializes the rect area light into a serialization object. The emission texture is normally produced at runtime by AreaLightTextureTools and has no source URL, so its pixels are embedded as a base64 string to keep the scene self-contained.
Returns any
the serialized object
transfer Textures To Effect
-
Parameters
- effect: Effect
- lightIndex: string
Returns Light
transfer To Effect
-
Sets the passed Effect "effect" with the PointLight transformed position (or position, if none) and passed name (string).
Parameters
- effect: Effect
The effect to update
- lightIndex: string
The index of the light in the effect to update
Returns RectAreaLight
The point light
- effect: Effect
transfer To Node Material Effect
-
Parameters
- effect: Effect
- lightDataUniformName: string
Returns RectAreaLight
A rectangular area light defined by an unique point in world space, a width and a height. The light is emitted from the rectangular area in the -Z direction.