Class SelectionOutlineLayer
Hierarchy (View Summary)
- EffectLayer
- SelectionOutlineLayer
Constructors
constructor
-
new SelectionOutlineLayer(
name: string,
scene?: Scene,
options?: Partial<ISelectionOutlineLayerOptions>,
): SelectionOutlineLayerInstantiates a new selection outline 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<ISelectionOutlineLayerOptions>Sets of none mandatory options to use with the layer (see ISelectionOutlineLayerOptions for more information)
Returns SelectionOutlineLayer
- 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
occlusion Strength
-
get occlusionStrength(): number
The strength of the occlusion effect (default: 0.8)
Returns number
-
set occlusionStrength(value: number): void
Parameters
- value: number
Returns void
occlusion Threshold
-
get occlusionThreshold(): number
The occlusion threshold (default: 0.01)
Returns number
-
set occlusionThreshold(value: number): void
Parameters
- value: number
Returns void
outline Color
outline Thickness
-
get outlineThickness(): number
The thickness of the edges (default: 2.0)
Returns number
-
set outlineThickness(value: number): void
Parameters
- value: number
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
use Depth Occlusion
-
get useDepthOcclusion(): boolean
Whether to use depth when drawing selection outlines. Disable this to avoid depth renderer usage; selected outlines will not be clipped by scene or selected geometry.
Returns boolean
-
set useDepthOcclusion(value: boolean): void
Parameters
- value: boolean
Returns void
StaticEffect Name
-
get EffectName(): string
Effect Name of the selection outline layer.
Returns string
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
add Selection
-
Adds mesh or group of mesh to the current selection
If a group of meshes is provided, they will outline as a single unit
Parameters
- meshOrGroup: AbstractMesh | AbstractMesh[]
Meshes to add to the selection
Returns void
- meshOrGroup: AbstractMesh | AbstractMesh[]
clear Selection
-
Remove all the meshes currently referenced in the selection outline layer
Returns void
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 SelectionOutlineLayer
Parameters
- mesh: AbstractMesh
mesh to test
Returns boolean
true if the mesh will be highlighted by the current SelectionOutlineLayer
- mesh: AbstractMesh
is Layer Ready
-
Checks if the layer is ready to render. When selections are active and depth occlusion is enabled, this also lazily creates the depth renderer and checks that its depth map is ready.
Returns boolean
true if the layer is ready
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.
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 SelectionOutline layer
Returns any
a serialized SelectionOutline 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 SelectionOutline layer from parsed SelectionOutline layer data
Parameters
- parsedSelectionOutlineLayer: any
defines the SelectionOutline layer data
- scene: Scene
defines the current scene
- rootUrl: string
defines the root URL containing the SelectionOutline layer information
Returns SelectionOutlineLayer
a parsed SelectionOutline layer
- parsedSelectionOutlineLayer: any
The selection outline layer Helps adding a outline effect around a mesh.
Once instantiated in a scene, simply use the addMesh or removeMesh method to add or remove outlined meshes to your scene.