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

Find examples in Playground
  • 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

Find examples in Playground
blurHorizontalSize: number

Gets the horizontal size of the blur.

blurVerticalSize

Find examples in Playground
blurVerticalSize: number

Gets the vertical size of the blur.

camera

Find examples in Playground
camera: Nullable<Camera>

Gets the camera attached to the layer.

innerGlow

Find examples in Playground
innerGlow: boolean

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

isEnabled

Find examples in Playground
isEnabled: boolean

Specifies wether the highlight layer is enabled or not.

name

Find examples in Playground
name: string

neutralColor

Find examples in Playground
neutralColor: Color4

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

onAfterBlurObservable

Find examples in Playground
onAfterBlurObservable: Observable<HighlightLayer>

An event triggered when the highlight layer has been blurred.

onAfterComposeObservable

Find examples in Playground
onAfterComposeObservable: Observable<EffectLayer>

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

onBeforeBlurObservable

Find examples in Playground
onBeforeBlurObservable: Observable<HighlightLayer>

An event triggered when the highlight layer is being blurred.

onBeforeComposeObservable

Find examples in Playground
onBeforeComposeObservable: Observable<EffectLayer>

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

onBeforeRenderMainTextureObservable

Find examples in Playground
onBeforeRenderMainTextureObservable: Observable<EffectLayer>

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

onDisposeObservable

Find examples in Playground
onDisposeObservable: Observable<EffectLayer>

An event triggered when the effect layer has been disposed.

onSizeChangedObservable

Find examples in Playground
onSizeChangedObservable: Observable<EffectLayer>

An event triggered when the efffect layer changes its size.

outerGlow

Find examples in Playground
outerGlow: boolean

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

renderingGroupId

Find examples in Playground
renderingGroupId: number

Gets the rendering group id the layer should render in.

Static EffectName

Find examples in Playground
EffectName: string

Effect Name of the highlight layer.

Static GlowingMeshStencilReference

Find examples in Playground
GlowingMeshStencilReference: number

Stencil value used for glowing meshes.

Static NeutralColor

Find examples in Playground
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

Find examples in Playground
NormalMeshStencilReference: number

Stencil value used for the other meshes in the scene.

Methods

addExcludedMesh

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • dispose(): void
  • Dispose the highlight layer and free resources.

    Returns void

disposeMesh

Find examples in Playground
  • 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

Find examples in Playground
  • getClassName(): string
  • Gets the class name of the effect layer

    Returns string

    the string with the class name of the effect layer

getEffectName

Find examples in Playground
  • getEffectName(): string

hasMesh

Find examples in Playground
  • 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

Find examples in Playground
  • 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

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

    Returns boolean

removeExcludedMesh

Find examples in Playground
  • 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

Find examples in Playground
  • 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

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

    Returns void

serialize

Find examples in Playground
  • serialize(): any
  • Serializes this Highlight layer

    Returns any

    a serialized Highlight layer object

shouldRender

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

    Returns boolean

Static Parse

Find examples in Playground
  • 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