Class EffectLayerAbstract
Hierarchy (View Summary)
- EffectLayer
Constructors
constructor
-
new EffectLayer(
name: string,
scene?: Scene,
forceGLSL?: boolean,
thinEffectLayer?: ThinEffectLayer,
): EffectLayerInstantiates a new effect Layer and references it in the scene.
Parameters
- name: string
The name of the layer
Optionalscene: SceneThe scene to use the layer in
- forceGLSL: boolean = false
Use the GLSL code generation for the shader (even on WebGPU). Default is false
OptionalthinEffectLayer: ThinEffectLayerThe thin instance of the effect layer (optional)
Returns EffectLayer
- name: string
Properties
on After Compose Observable
An event triggered when the generated texture has been merged in the scene.
on After Render Mesh To Effect
An event triggered after the mesh has been rendered into the effect render target.
on Before Compose Observable
An event triggered when the generated texture is being merged in the scene.
on Before Render Main Texture Observable
An event triggered when the effect layer is about rendering the main texture with the glowy parts.
on Before Render Mesh To Effect
An event triggered when the mesh is rendered into the effect render target.
on Dispose Observable
An event triggered when the effect layer has been disposed.
on Size Changed Observable
An event triggered when the effect layer changes its size.
Readonlyunique Id
The unique id of the layer
Accessors
camera
disable Bounding Boxes From Effect Layer
-
get disableBoundingBoxesFromEffectLayer(): boolean
Specifies if the bounding boxes should be rendered normally or if they should undergo the effect of the layer
Returns boolean
-
set disableBoundingBoxesFromEffectLayer(value: boolean): void
Parameters
- value: boolean
Returns void
is Enabled
-
get isEnabled(): boolean
Specifies whether the highlight layer is enabled or not.
Returns boolean
-
set isEnabled(value: boolean): void
Parameters
- value: boolean
Returns void
main Texture
-
Gets the main texture where the effect is rendered
Returns RenderTargetTexture
name
-
get name(): string
The name of the layer
Returns string
-
set name(value: string): void
Parameters
- value: string
Returns void
neutral Color
rendering Group Id
-
get renderingGroupId(): number
Gets the rendering group id the layer should render in.
Returns number
-
set renderingGroupId(renderingGroupId: number): void
Parameters
- renderingGroupId: number
Returns void
shader Language
-
get shaderLanguage(): ShaderLanguage
Gets the shader language used in this material.
Returns ShaderLanguage
StaticForce GLSL
-
get ForceGLSL(): boolean
Force all the effect layers to compile to glsl even on WebGPU engines. False by default. This is mostly meant for backward compatibility.
Returns boolean
-
set ForceGLSL(value: boolean): void
Parameters
- value: boolean
Returns void
Methods
Abstract_ dispose Mesh
-
Free any resources and references associated to a mesh. Internal use
Parameters
- mesh: Mesh
The mesh to free.
Returns void
- mesh: Mesh
dispose
-
Dispose the highlight layer and free resources.
Returns void
get Class Name
-
Gets the class name of the effect layer
Returns string
the string with the class name of the effect layer
get Effect Intensity
-
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
- mesh: AbstractMesh
Abstractget Effect Name
-
Get the effect name of the layer.
Returns string
The effect name
has Mesh
-
Determine if a given mesh will be used in the current effect.
Parameters
- mesh: AbstractMesh
mesh to test
Returns boolean
true if the mesh will be used
- mesh: AbstractMesh
is Layer Ready
-
Checks if the layer is ready to be used.
Returns boolean
true if the layer is ready to be used
Abstractis Ready
-
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
- subMesh: SubMesh
Abstractneed Stencil
-
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
-
Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.
Returns void
Optional Abstractserialize
-
Serializes this layer (Glow or Highlight for example)
Returns any
a serialized layer object
set Effect Intensity
-
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
- mesh: AbstractMesh
set Material For Rendering
-
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
Optionalmaterial: Materialmaterial 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
- mesh: AbstractMesh | AbstractMesh[]
should Render
-
Returns true if the layer contains information to display, otherwise false.
Returns boolean
true if the glow layer should be rendered
StaticParse
-
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
- parsedEffectLayer: any
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.