Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

Index

Constructors

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

    Parameters

    • name: string

      The name of the layer

    • Optional scene: Scene

      The scene to use the layer in

    Returns EffectLayer

Properties

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.

Accessors

  • 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

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

    Parameters

    • mesh: Mesh

      The mesh to free.

    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

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

    Returns string

    The effect name

  • Determine if a given mesh will be used in the current effect.

    Parameters

    Returns boolean

    true if the mesh will be used

  • 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

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

  • 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 layer (Glow or Highlight for example)

    Returns any

    a serialized layer object

  • 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

  • Creates an effect layer from parsed effect layer data

    Parameters

    • 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

Legend

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

Settings

Theme