EffectLayer

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

This can be for instance use to generate glow or higlight 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

constructor

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

    Parameters

    • name: string

      The name of the layer

    • scene: Scene

      The scene to use the layer in

    Returns EffectLayer

Properties

camera

Find examples in Playground
camera: Nullable<Camera>

Gets the camera attached to the layer.

isEnabled

Find examples in Playground
isEnabled: boolean

Specifies wether the highlight layer is enabled or not.

name

Find examples in Playground
name: string

The name of the layer

neutralColor

Find examples in Playground
neutralColor: Color4

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

onAfterComposeObservable

Find examples in Playground
onAfterComposeObservable: Observable<EffectLayer>

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

onBeforeComposeObservable

Find examples in Playground
onBeforeComposeObservable: Observable<EffectLayer>

An event triggered when the generated texture is being merged in the scene.

onBeforeRenderMainTextureObservable

Find examples in Playground
onBeforeRenderMainTextureObservable: Observable<EffectLayer>

An event triggered when the effect layer is about rendering the main texture with the glowy parts.

onDisposeObservable

Find examples in Playground
onDisposeObservable: Observable<EffectLayer>

An event triggered when the effect layer has been disposed.

onSizeChangedObservable

Find examples in Playground
onSizeChangedObservable: Observable<EffectLayer>

An event triggered when the efffect layer changes its size.

renderingGroupId

Find examples in Playground
renderingGroupId: number

Gets the rendering group id the layer should render in.

Methods

dispose

Find examples in Playground
  • dispose(): void
  • Dispose the highlight layer and free resources.

    Returns void

disposeMesh

Find examples in Playground
  • 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

Find examples in Playground
  • getClassName(): string
  • Gets the class name of the effect layer

    Returns string

    the string with the class name of the effect layer

Abstract getEffectName

Find examples in Playground
  • getEffectName(): string
  • Get the effect name of the layer.

    Returns string

    The effect name

hasMesh

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

    Parameters

    Returns boolean

    true if the mesh will be used

Abstract isReady

Find examples in Playground
  • 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

Abstract needStencil

Find examples in Playground
  • needStencil(): boolean
  • Returns wether or nood the layer needs stencil enabled during the mesh rendering.

    Returns boolean

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

render

Find examples in Playground
  • 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 serialize

Find examples in Playground
  • serialize(): any
  • Serializes this layer (Glow or Highlight for example)

    Returns any

    a serialized layer object

shouldRender

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Generated using TypeDoc