Options
All
  • Public
  • Public/Protected
  • All
Menu

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

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

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

Hierarchy

Index

Constructors

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

    Parameters

    • name: string

      The name of the layer

    • Optional 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

disableBoundingBoxesFromEffectLayer: boolean

Specifies if the bounding boxes should be rendered normally or if they should undergo the effect of the layer

innerGlow: boolean

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

isEnabled: boolean

Specifies whether the highlight layer is enabled or not.

name: string

The name of the layer

neutralColor: Color4

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

onAfterBlurObservable: Observable<HighlightLayer>

An event triggered when the highlight layer has been blurred.

onAfterComposeObservable: Observable<EffectLayer>

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

onAfterRenderMeshToEffect: Observable<AbstractMesh>

An event triggered after the mesh has been rendered into the effect render target.

onBeforeBlurObservable: Observable<HighlightLayer>

An event triggered when the highlight layer is being blurred.

onBeforeComposeObservable: Observable<EffectLayer>

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

onBeforeRenderMainTextureObservable: Observable<EffectLayer>

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

onBeforeRenderMeshToEffect: Observable<AbstractMesh>

An event triggered when the mesh is rendered into the effect render target.

onDisposeObservable: Observable<EffectLayer>

An event triggered when the effect layer has been disposed.

onSizeChangedObservable: Observable<EffectLayer>

An event triggered when the effect layer changes its size.

outerGlow: boolean

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

EffectName: "HighlightLayer" = "HighlightLayer"

Effect Name of the highlight layer.

GlowingMeshStencilReference: number

Stencil value used for glowing meshes.

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.

NormalMeshStencilReference: number

Stencil value used for the other meshes in the scene.

Accessors

  • get blurHorizontalSize(): number
  • set blurHorizontalSize(value: number): void
  • Gets the horizontal size of the blur.

    Returns number

  • Specifies the horizontal size of the blur.

    Parameters

    • value: number

    Returns void

  • get blurVerticalSize(): number
  • set blurVerticalSize(value: number): void
  • Gets the vertical size of the blur.

    Returns number

  • Specifies the vertical size of the blur.

    Parameters

    • value: number

    Returns void

  • Gets the camera attached to the layer.

    Returns Nullable<Camera>

  • Gets the main texture where the effect is rendered

    Returns RenderTargetTexture

  • get renderingGroupId(): number
  • set renderingGroupId(renderingGroupId: number): void
  • Gets the rendering group id the layer should render in.

    Returns number

  • Gets the rendering group id the layer should render in.

    Parameters

    • renderingGroupId: number

    Returns void

Methods

  • 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(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(): void
  • Dispose the highlight layer and free resources.

    Returns void

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

    Returns string

    the string with the class name of the effect layer

  • Gets the intensity of the effect for a specific mesh.

    Parameters

    • mesh: AbstractMesh

      The mesh to get the effect intensity for

    Returns number

    The intensity of the effect for the mesh

  • getEffectName(): string
  • Get the effect name of the layer.

    Returns string

    The effect name

  • 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(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 whether or not to use instances to render the mesh

    Returns boolean

    true if ready otherwise, false

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

    Returns boolean

  • removeAllMeshes(): void
  • Remove all the meshes currently referenced in the highlight layer

    Returns void

  • 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(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(): void
  • Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.

    Returns void

  • serialize(): any
  • Serializes this Highlight layer

    Returns any

    a serialized Highlight layer object

  • setEffectIntensity(mesh: AbstractMesh, intensity: number): void
  • Sets the intensity of the effect for a specific mesh.

    Parameters

    • mesh: AbstractMesh

      The mesh to set the effect intensity for

    • intensity: number

      The intensity of the effect for the mesh

    Returns void

  • Sets a specific material to be used to render a mesh/a list of meshes in the layer

    Parameters

    • mesh: AbstractMesh | AbstractMesh[]

      mesh or array of meshes

    • Optional material: Material

      material to use by the layer when rendering the mesh(es). If undefined is passed, the specific material created by the layer will be used.

    Returns void

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

    Returns boolean

  • 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

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method

Settings

Theme