Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Once instantiated in a scene, by default, all the emissive meshes will glow.

Documentation: https://doc.babylonjs.com/features/featuresDeepDive/mesh/glowLayer

Hierarchy

Index

Constructors

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

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

    Returns GlowLayer

Properties

customEmissiveColorSelector: ((mesh: Mesh, subMesh: SubMesh, material: Material, result: Color4) => void)

Type declaration

customEmissiveTextureSelector: ((mesh: Mesh, subMesh: SubMesh, material: Material) => Texture)

Type declaration

disableBoundingBoxesFromEffectLayer: boolean

Specifies if the bounding boxes should be rendered normally or if they should undergo the effect of 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.

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.

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.

DefaultBlurKernelSize: number

The default blur kernel size used for the glow.

DefaultTextureRatio: number

The default texture size ratio used for the glow.

EffectName: "GlowLayer" = "GlowLayer"

Effect Name of the layer.

Accessors

  • get blurKernelSize(): number
  • set blurKernelSize(value: number): void
  • Gets the kernel size of the blur.

    Returns number

  • Sets the kernel size of the blur.

    Parameters

    • value: number

    Returns void

  • Gets the camera attached to the layer.

    Returns Nullable<Camera>

  • get intensity(): number
  • set intensity(value: number): void
  • Gets the glow intensity.

    Returns number

  • Sets the glow intensity.

    Parameters

    • value: number

    Returns void

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

    Parameters

    • mesh: Mesh

      The mesh to exclude from the glow layer

    Returns void

  • 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(): 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 used in the glow layer

    Parameters

    Returns boolean

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

  • 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

  • Add a mesh to be rendered through its own material and not with emissive only.

    Parameters

    • mesh: AbstractMesh

      The mesh for which we need to use its material

    Returns void

  • 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(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(): 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 glow layer

    Returns any

    a serialized glow 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

    true if the glow layer should be rendered

  • unReferenceMeshFromUsingItsOwnMaterial(mesh: AbstractMesh): void
  • Remove a mesh from being rendered through its own material and not with emissive only.

    Parameters

    • mesh: AbstractMesh

      The mesh for which we need to not use its material

    Returns void

  • 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

Legend

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

Settings

Theme