HighlightLayer

The highlight layer Helps adding a glow effect around a mesh.

Once instantiated in a scene, simply use the pushMesh or removeMesh method to add or remove glowy meshes to your scene.

!!! THIS REQUIRES AN ACTIVE STENCIL BUFFER ON THE CANVAS !!!

Hierarchy

Index

Constructors

constructor

  • Instantiates a new highlight Layer and references it to the scene..

    Parameters

    • name: string

      The name of the layer

    • scene: Scene

      The scene to use the layer in

    • Optional options: Partial<IHighlightLayerOptions>

      Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)

    Returns HighlightLayer

Properties

blurHorizontalSize

blurHorizontalSize: number

Specifies the horizontal size of the blur.

blurVerticalSize

blurVerticalSize: number

Specifies the vertical size of the blur.

camera

camera: Nullable<Camera>

Gets the camera attached to the layer.

innerGlow

innerGlow: boolean

Specifies whether or not the inner glow is ACTIVE in the layer.

isEnabled

isEnabled: boolean

Specifies wether the highlight layer is enabled or not.

name

name: string

neutralColor

neutralColor: Color4

The clear color of the texture used to generate the glow map.

onAfterBlurObservable

onAfterBlurObservable: Observable<HighlightLayer>

An event triggered when the highlight layer has been blurred.

onAfterComposeObservable

onAfterComposeObservable: Observable<EffectLayer>

An event triggered when the generated texture has been merged in the scene.

onBeforeBlurObservable

onBeforeBlurObservable: Observable<HighlightLayer>

An event triggered when the highlight layer is being blurred.

onBeforeComposeObservable

onBeforeComposeObservable: Observable<EffectLayer>

An event triggered when the generated texture is being merged in the scene.

onBeforeRenderMainTextureObservable

onBeforeRenderMainTextureObservable: Observable<EffectLayer>

An event triggered when the effect layer is about rendering the main texture with the glowy parts.

onDisposeObservable

onDisposeObservable: Observable<EffectLayer>

An event triggered when the effect layer has been disposed.

onSizeChangedObservable

onSizeChangedObservable: Observable<EffectLayer>

An event triggered when the efffect layer changes its size.

outerGlow

outerGlow: boolean

Specifies whether or not the outer glow is ACTIVE in the layer.

Static EffectName

EffectName: string

Effect Name of the highlight layer.

Static GlowingMeshStencilReference

GlowingMeshStencilReference: number

Stencil value used for glowing meshes.

Static NeutralColor

NeutralColor: Color4

The neutral color used during the preparation of the glow effect. This is black by default as the blend operation is a blend operation.

Static NormalMeshStencilReference

NormalMeshStencilReference: number

Stencil value used for the other meshes in the scene.

Methods

addExcludedMesh

  • addExcludedMesh(mesh: Mesh): void
  • Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.

    Parameters

    • mesh: Mesh

      The mesh to exclude from the highlight layer

    Returns void

addMesh

  • addMesh(mesh: Mesh, color: Color3, glowEmissiveOnly?: boolean): void
  • Add a mesh in the highlight layer in order to make it glow with the chosen color.

    Parameters

    • mesh: Mesh

      The mesh to highlight

    • color: Color3

      The color of the highlight

    • Optional glowEmissiveOnly: boolean

      Extract the glow from the emissive texture

    Returns void

dispose

  • dispose(): void
  • Dispose the highlight layer and free resources.

    Returns void

disposeMesh

  • disposeMesh(mesh: Mesh): void
  • Free any resources and references associated to a mesh. Internal use

    Parameters

    • mesh: Mesh

      The mesh to free.

    Returns void

getClassName

  • getClassName(): string
  • Gets the class name of the effect layer

    Returns string

    the string with the class name of the effect layer

getEffectName

  • getEffectName(): string

hasMesh

  • Determine if a given mesh will be highlighted by the current HighlightLayer

    Parameters

    Returns boolean

    true if the mesh will be highlighted by the current HighlightLayer

isReady

  • isReady(subMesh: SubMesh, useInstances: boolean): boolean
  • Checks for the readiness of the element composing the layer.

    Parameters

    • subMesh: SubMesh

      the mesh to check for

    • useInstances: boolean

      specify wether or not to use instances to render the mesh

    Returns boolean

    true if ready otherwise, false

needStencil

  • needStencil(): boolean
  • Returns wether or nood the layer needs stencil enabled during the mesh rendering.

    Returns boolean

removeExcludedMesh

  • removeExcludedMesh(mesh: Mesh): void
  • Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.

    Parameters

    • mesh: Mesh

      The mesh to highlight

    Returns void

removeMesh

  • removeMesh(mesh: Mesh): void
  • Remove a mesh from the highlight layer in order to make it stop glowing.

    Parameters

    • mesh: Mesh

      The mesh to highlight

    Returns void

render

  • render(): void
  • Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.

    Returns void

serialize

  • serialize(): any
  • Serializes this Highlight layer

    Returns any

    a serialized Highlight layer object

shouldRender

  • shouldRender(): boolean
  • Returns true if the layer contains information to display, otherwise false.

    Returns boolean

Static Parse

  • Creates a Highlight layer from parsed Highlight layer data

    Parameters

    • parsedHightlightLayer: any

      defines the Highlight layer data

    • scene: Scene

      defines the current scene

    • rootUrl: string

      defines the root URL containing the Highlight layer information

    Returns HighlightLayer

    a parsed Highlight layer

Generated using TypeDoc