• Public
  • Public/Protected
  • All

Class EffectLayer

The effect layer Helps adding post process effect blended with the main pass.

This can be for instance use to generate glow or highlight effects on the scene.

The effect layer class can not be used directly and is intented to inherited from to be customized per effects.





  • Instantiates a new effect Layer and references it in the scene.


    • name: string

      The name of the layer

    • scene: Scene

      The scene to use the layer in

    Returns EffectLayer


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

isEnabledSearch playground for isEnabled

isEnabled: boolean

Specifies whether the highlight layer is enabled or not.

nameSearch playground for name

name: string

The name of the layer

neutralColorSearch playground for neutralColor

neutralColor: Color4

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

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.

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.



  • 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): any
  • Gets the rendering group id the layer should render in.

    Returns number

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


    • renderingGroupId: number

    Returns any


Abstract _disposeMeshSearch playground for _disposeMesh

  • _disposeMesh(mesh: Mesh): void
  • Free any resources and references associated to a mesh. Internal use


    • mesh: Mesh

      The mesh to free.

    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

Abstract 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 used in the current effect.


    Returns boolean

    true if the mesh will be used

Abstract isReadySearch playground for isReady

  • isReady(subMesh: SubMesh, useInstances: boolean): boolean
  • Checks for the readiness of the element composing the layer.


    • 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

Abstract needStencilSearch playground for needStencil

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

    Returns boolean

    true if the effect requires stencil during the main canvas render pass.

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

Optional Abstract serializeSearch playground for serialize

  • serialize(): any
  • Serializes this layer (Glow or Highlight for example)

    Returns any

    a serialized layer object

setMaterialForRenderingSearch playground for setMaterialForRendering

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


    • 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

    true if the glow layer should be rendered

Static ParseSearch playground for Parse

  • Creates an effect layer from parsed effect layer data


    • parsedEffectLayer: any

      defines effect layer data

    • scene: Scene

      defines the current scene

    • rootUrl: string

      defines the root URL containing the effect layer information

    Returns EffectLayer

    a parsed effect Layer


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