Class HighlightLayer
Hierarchy (View Summary)
- EffectLayer
- HighlightLayer
Constructors
constructor
-
new HighlightLayer(
name: string,
scene?: Scene,
options?: Partial<IHighlightLayerOptions>,
): HighlightLayerInstantiates a new highlight Layer and references it to the scene..
Parameters
- name: string
The name of the layer
Optionalscene: SceneThe scene to use the layer in
Optionaloptions: Partial<IHighlightLayerOptions>Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)
Returns HighlightLayer
- name: string
Properties
on After Blur Observable
An event triggered when the highlight layer has been blurred.
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 Blur Observable
An event triggered when the highlight layer is being blurred.
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
Static ReadonlyEffect Name
Effect Name of the highlight layer.
Accessors
blur Horizontal Size
-
get blurHorizontalSize(): number
Gets the horizontal size of the blur.
Returns number
-
set blurHorizontalSize(value: number): void
Specifies the horizontal size of the blur.
Parameters
- value: number
Returns void
blur Vertical Size
-
get blurVerticalSize(): number
Gets the vertical size of the blur.
Returns number
-
set blurVerticalSize(value: number): void
Specifies the vertical size of the blur.
Parameters
- value: number
Returns void
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
inner Glow
-
get innerGlow(): boolean
Specifies whether or not the inner glow is ACTIVE in the layer.
Returns boolean
-
set innerGlow(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
num Stencil Bits
-
get numStencilBits(): number
Number of stencil bits used by the highlight layer (default: 8). The layer uses the numStencilBits highest bits of the stencil buffer.
Returns number
-
set numStencilBits(value: number): void
Parameters
- value: number
Returns void
outer Glow
-
get outerGlow(): boolean
Specifies whether or not the outer glow is ACTIVE in the layer.
Returns boolean
-
set outerGlow(value: boolean): void
Parameters
- value: boolean
Returns void
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
stencil Reference
-
get stencilReference(): number
Gets the stencil reference value used for the meshes rendered by the highlight layer.
Returns number
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
StaticNeutral Color
Methods
add Excluded Mesh
-
Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.
Parameters
- mesh: Mesh
The mesh to exclude from the highlight layer
Returns void
- mesh: Mesh
add 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
get Effect Name
-
Get the effect name of the layer.
Returns string
The effect name
has Mesh
-
Determine if a given mesh will be highlighted by the current HighlightLayer
Parameters
- mesh: AbstractMesh
mesh to test
Returns boolean
true if the mesh will be highlighted by the current HighlightLayer
- 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
is 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
need Stencil
-
Returns boolean
whether or not the layer needs stencil enabled during the mesh rendering.
remove All Meshes
-
Remove all the meshes currently referenced in the highlight layer
Returns void
remove Excluded Mesh
-
Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.
Parameters
- mesh: Mesh
The mesh to highlight
Returns void
- mesh: Mesh
remove Mesh
-
Remove a mesh from the highlight layer in order to make it stop glowing.
Parameters
- mesh: Mesh
The mesh to highlight
Returns void
- mesh: Mesh
render
-
Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.
Returns void
serialize
-
Serializes this Highlight layer
Returns any
a serialized Highlight 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 boolean
true if the layer contains information to display, otherwise false.
StaticParse
-
Creates a Highlight layer from parsed Highlight layer data
Parameters
- parsedHightlightLayer: any
defines the Highlight layer data
- scene: Scene
defines the current scene
- rootUrl: string
defines the root URL containing the Highlight layer information
Returns HighlightLayer
a parsed Highlight layer
- parsedHightlightLayer: any
The highlight layer Helps adding a glow effect around a mesh.
Once instantiated in a scene, simply use the addMesh or removeMesh method to add or remove glowy meshes to your scene.
!!! THIS REQUIRES AN ACTIVE STENCIL BUFFER ON THE CANVAS !!!