API

Class EffectLayerAbstract

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 (View Summary)

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

    Parameters

    • name: string

      The name of the layer

    • Optionalscene: Scene

      The scene to use the layer in

    • forceGLSL: boolean = false

      Use the GLSL code generation for the shader (even on WebGPU). Default is false

    • OptionalthinEffectLayer: ThinEffectLayer

      The thin instance of the effect layer (optional)

    Returns EffectLayer

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.

uniqueId: any = UniqueIdGenerator.UniqueId

The unique id of the layer

  • 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

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

  • 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