Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HighlightLayer

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

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

disableBoundingBoxesFromEffectLayerSearch playground for disableBoundingBoxesFromEffectLayer

disableBoundingBoxesFromEffectLayer: boolean

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

innerGlowSearch playground for innerGlow

innerGlow: boolean

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

isEnabledSearch playground for isEnabled

isEnabled: boolean

Specifies whether the highlight layer is enabled or not.

nameSearch playground for name

name: string

neutralColorSearch playground for neutralColor

neutralColor: Color4

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

onAfterBlurObservableSearch playground for onAfterBlurObservable

onAfterBlurObservable: Observable<HighlightLayer>

An event triggered when the highlight layer has been blurred.

onAfterComposeObservableSearch playground for onAfterComposeObservable

onAfterComposeObservable: Observable<EffectLayer>

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

onAfterRenderMeshToEffectSearch playground for onAfterRenderMeshToEffect

onAfterRenderMeshToEffect: Observable<AbstractMesh>

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

onBeforeBlurObservableSearch playground for onBeforeBlurObservable

onBeforeBlurObservable: Observable<HighlightLayer>

An event triggered when the highlight layer is being blurred.

onBeforeComposeObservableSearch playground for onBeforeComposeObservable

onBeforeComposeObservable: Observable<EffectLayer>

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

onBeforeRenderMainTextureObservableSearch playground for onBeforeRenderMainTextureObservable

onBeforeRenderMainTextureObservable: Observable<EffectLayer>

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

onBeforeRenderMeshToEffectSearch playground for onBeforeRenderMeshToEffect

onBeforeRenderMeshToEffect: Observable<AbstractMesh>

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

onDisposeObservableSearch playground for onDisposeObservable

onDisposeObservable: Observable<EffectLayer>

An event triggered when the effect layer has been disposed.

onSizeChangedObservableSearch playground for onSizeChangedObservable

onSizeChangedObservable: Observable<EffectLayer>

An event triggered when the effect layer changes its size.

outerGlowSearch playground for outerGlow

outerGlow: boolean

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

Static Readonly EffectNameSearch playground for EffectName

EffectName: string

Effect Name of the highlight layer.

Static GlowingMeshStencilReferenceSearch playground for GlowingMeshStencilReference

GlowingMeshStencilReference: number

Stencil value used for glowing meshes.

Static NeutralColorSearch playground for 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 NormalMeshStencilReferenceSearch playground for NormalMeshStencilReference

NormalMeshStencilReference: number

Stencil value used for the other meshes in the scene.

Accessors

blurHorizontalSize

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

    Returns number

  • Specifies the horizontal size of the blur.

    Parameters

    • value: number

    Returns any

blurVerticalSize

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

    Returns number

  • Specifies the vertical size of the blur.

    Parameters

    • value: number

    Returns any

camera

mainTexture

renderingGroupId

  • get renderingGroupId(): number
  • set renderingGroupId(renderingGroupId: number): any
  • 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 any

Methods

addExcludedMeshSearch playground for 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

addMeshSearch playground for 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

disposeSearch playground for dispose

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

    Returns void

getClassNameSearch playground for getClassName

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

    Returns string

    the string with the class name of the effect layer

getEffectNameSearch playground for getEffectName

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

    Returns string

    The effect name

hasMeshSearch playground for 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

isReadySearch playground for 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

needStencilSearch playground for needStencil

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

    Returns boolean

removeAllMeshesSearch playground for removeAllMeshes

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

    Returns void

removeExcludedMeshSearch playground for 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

removeMeshSearch playground for 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

renderSearch playground for render

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

    Returns void

serializeSearch playground for serialize

  • serialize(): any
  • Serializes this Highlight layer

    Returns any

    a serialized Highlight layer object

setMaterialForRenderingSearch playground for setMaterialForRendering

  • 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

shouldRenderSearch playground for shouldRender

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

    Returns boolean

Static ParseSearch playground for 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

Legend

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