API

Class LensFlareSystem

This represents a Lens Flare System or the shiny effect created by the light reflection on the camera lenses. It is usually composed of several lensFlare.

Index
borderLimit: number = 300

Define a limit from the border the lens flare can be visible.

id: string

Define the id of the lens flare system in the scene. (equal to name by default)

layerMask: number = 0x0fffffff

Restricts the rendering of the effect to only the camera rendering this layer mask.

lensFlares: LensFlare[] = []

List of lens flares used in this system.

meshesSelectionPredicate: (mesh: AbstractMesh) => boolean

Define a predicate which could limit the list of meshes able to occlude the effect.

name: string

Define the name of the lens flare system

viewportBorder: number = 0

Define a viewport border we do not want to see the lens flare in.

ForceGLSL: boolean = false

Force all the lens flare systems to compile to glsl even on WebGPU engines. False by default. This is mostly meant for backward compatibility.

  • Set the emitter of the lens flare system. It defines the source of the lens flares (it can be a camera, a light or a mesh).

    Parameters

    • newEmitter: any

      Define the new emitter of the system

    Returns void

  • Parse a lens flare system from a JSON representation

    Parameters

    • parsedLensFlareSystem: any

      Define the JSON to parse

    • scene: Scene

      Define the scene the parsed system should be instantiated in

    • rootUrl: string

      Define the rootUrl of the load sequence to easily find a load relative dependencies such as textures

    Returns LensFlareSystem

    the parsed system