GlowLayer

The glow layer Helps adding a glow effect around the emissive parts of a mesh.

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

Documentation: https://doc.babylonjs.com/how_to/glow_layer

Hierarchy

Index

Constructors

constructor

  • Instantiates a new glow 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<IGlowLayerOptions>

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

    Returns GlowLayer

Properties

blurKernelSize

blurKernelSize: number

Gets the kernel size of the blur.

camera

camera: Nullable<Camera>

Gets the camera attached to the layer.

customEmissiveColorSelector

customEmissiveColorSelector: function

Callback used to let the user override the color selection on a per mesh basis

Type declaration

customEmissiveTextureSelector

customEmissiveTextureSelector: function

Callback used to let the user override the texture selection on a per mesh basis

Type declaration

intensity

intensity: number

Gets the glow intensity.

isEnabled

isEnabled: boolean

Specifies wether the highlight layer is enabled or not.

name

name: string

The name of the layer

neutralColor

neutralColor: Color4

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

onAfterComposeObservable

onAfterComposeObservable: Observable<EffectLayer>

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

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.

renderingGroupId

renderingGroupId: number

Gets the rendering group id the layer should render in.

Static DefaultBlurKernelSize

DefaultBlurKernelSize: number

The default blur kernel size used for the glow.

Static DefaultTextureRatio

DefaultTextureRatio: number

The default texture size ratio used for the glow.

Static EffectName

EffectName: string

Effect Name of the layer.

Methods

addExcludedMesh

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

    Parameters

    • mesh: Mesh

      The mesh to exclude from the glow layer

    Returns void

addIncludedOnlyMesh

  • addIncludedOnlyMesh(mesh: Mesh): void
  • Add a mesh in the inclusion list to impact or being impacted by the glow layer.

    Parameters

    • mesh: Mesh

      The mesh to include in the glow layer

    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 used in the glow layer

    Parameters

    Returns boolean

    true if the mesh will be highlighted by the current glow layer

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 glow layer.

    Parameters

    • mesh: Mesh

      The mesh to remove

    Returns void

removeIncludedOnlyMesh

  • removeIncludedOnlyMesh(mesh: Mesh): void
  • Remove a mesh from the Inclusion list to prevent it to impact or being impacted by the glow layer.

    Parameters

    • mesh: Mesh

      The mesh to remove

    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 glow layer

    Returns any

    a serialized glow layer object

shouldRender

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

    Returns boolean

    true if the glow layer should be rendered

Static Parse

  • Parse(parsedGlowLayer: any, scene: Scene, rootUrl: string): GlowLayer
  • Creates a Glow Layer from parsed glow layer data

    Parameters

    • parsedGlowLayer: any

      defines glow layer data

    • scene: Scene

      defines the current scene

    • rootUrl: string

      defines the root URL containing the glow layer information

    Returns GlowLayer

    a parsed Glow Layer

Generated using TypeDoc