Class MeshDebugPluginMaterial
Hierarchy (View Summary)
- MaterialPluginBase
- MeshDebugPluginMaterial
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new MeshDebugPluginMaterial(
material: StandardMaterial | PBRBaseMaterial,
options?: MeshDebugOptions,
): MeshDebugPluginMaterialCreates a new MeshDebugPluginMaterial
Parameters
- material: StandardMaterial | PBRBaseMaterial
Material to attach the mesh debug plugin to
- options: MeshDebugOptions = {}
Options for the mesh debug plugin
Returns MeshDebugPluginMaterial
- material: StandardMaterial | PBRBaseMaterial
Properties
do Not Serialize
Specifies if the material plugin should be serialized, true to skip serialization
Readonlymark All Defines As Dirty
Helper function to mark defines as being dirty.
name
Defines the name of the plugin
priority
Defines the priority of the plugin. Lower numbers run first.
register For Extra Events
Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
resolve Includes
Indicates that any #include directive in the plugin code must be replaced by the corresponding code.
shaded Diffuse Color
Diffuse color used to shade the mesh. Defaults to (1.0, 1.0, 1.0).
shaded Specular Color
Specular color used to shade the mesh. Defaults to (0.8, 0.8, 0.8).
shaded Specular Power
Specular power used to shade the mesh. Defaults to 10.
uv Primary Color
1st color of checkerboard grid in UV1 or UV2 modes. Defaults to (1.0, 1.0, 1.0).
uv Scale
Size of tiles in UV1 or UV2 modes. Defaults to 20.
uv Secondary Color
2nd color of checkerboard grid in UV1 or UV2 modes. Defaults to (0.5, 0.5, 0.5).
vertex Color
Color of vertices in TRIANGLES_VERTICES and VERTICES mode. Defaults to (0.0, 0.0, 0.0).
vertex Radius
Radius of dots drawn over vertices in TRIANGLE_VERTICES and VERTICES mode. Defaults to 1.2.
wireframe Thickness
Width of edge lines in TRIANGLES and TRIANGLE_VERTICES modes. Defaults to 0.7.
wireframe Triangles Color
Color of edge lines in TRIANGLES mode. Defaults to (0.0, 0.0, 0.0).
wireframe Vertices Color
Color of edge lines in TRIANGLES_VERTICES modes. Defaults to (0.8, 0.8, 0.8).
StaticMaterial Colors
Color palette used for MATERIALIDS mode.
Defaults to defaultMaterialColors
Accessors
is Enabled
-
get isEnabled(): boolean
Gets whether the mesh debug plugin is enabled in the material.
Returns boolean
-
set isEnabled(value: boolean): void
Sets whether the mesh debug plugin is enabled in the material.
Parameters
- value: boolean
enabled
Returns void
- value: boolean
mode
The mesh debug visualization. Defaults to NONE.
multiply
Whether the mesh debug visualization should multiply with color underneath. Defaults to true.
Methods
add Fallbacks
-
Add fallbacks to the effect fallbacks list.
Parameters
- defines: MaterialDefines
defines the Base texture to use.
- fallbacks: EffectFallbacks
defines the current fallback list.
- currentRank: number
defines the current fallback rank.
Returns number
the new fallback rank.
- defines: MaterialDefines
bind For Sub Mesh
collect Defines
-
Collects all defines.
Parameters
- defines: { [name: string]: { default: any; type: string } }
The object to append to.
Returns void
- defines: { [name: string]: { default: any; type: string } }
copy To
-
Makes a duplicate of the current configuration into another one.
Parameters
- plugin: MaterialPluginBase
define the config where to copy the info
Returns void
- plugin: MaterialPluginBase
dispose
-
Disposes the resources of the material.
Parameters
Optional_forceDisposeTextures: booleanForces the disposal of all textures.
Returns void
fill Render Target Textures
-
Fills the list of render target textures.
Parameters
- _renderTargets: SmartArray<RenderTargetTexture>
the list of render targets to update
Returns void
- _renderTargets: SmartArray<RenderTargetTexture>
get Active Textures
-
Returns an array of the actively used textures.
Parameters
- _activeTextures: BaseTexture[]
Array of BaseTextures
Returns void
- _activeTextures: BaseTexture[]
get Animatables
-
Returns the animatable textures.
Parameters
- _animatables: IAnimatable[]
Array of animatable textures.
Returns void
- _animatables: IAnimatable[]
get Attributes
-
Get the shader attributes
Parameters
- attributes: string[]
Array of attributes
Returns void
- attributes: string[]
get Class Name
-
Get the class name
Returns string
Class name
get Custom Code
-
getCustomCode(
shaderType: string,
shaderLanguage?: ShaderLanguage,
): Nullable<{ [pointName: string]: string }>Get shader code
Parameters
- shaderType: string
"vertex" or "fragment"
- shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL
The shader language to use.
Returns Nullable<{ [pointName: string]: string }>
Shader code
- shaderType: string
get Samplers
-
Gets the samplers used by the plugin.
Parameters
- _samplers: string[]
list that the sampler names should be added to.
Returns void
- _samplers: string[]
get Uniform Buffers Names
-
Gets the uniform buffers names added by the plugin.
Parameters
- _ubos: string[]
list that the ubo names should be added to.
Returns void
- _ubos: string[]
get Uniforms
-
getUniforms(
shaderLanguage?: ShaderLanguage,
): { fragment: string; ubo: { name: string; size: number; type: string }[] }Get the shader uniforms
Parameters
- shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL
The shader language to use.
Returns { fragment: string; ubo: { name: string; size: number; type: string }[] }
Uniforms
- shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL
hard Bind For Sub Mesh
-
hardBindForSubMesh(
_uniformBuffer: UniformBuffer,
_scene: Scene,
_engine: AbstractEngine,
_subMesh: SubMesh,
): voidBinds the material data (this function is called even if mustRebind() returns false)
Parameters
- _uniformBuffer: UniformBuffer
defines the Uniform buffer to fill in.
- _scene: Scene
defines the scene the material belongs to.
- _engine: AbstractEngine
defines the engine the material belongs to.
- _subMesh: SubMesh
the submesh to bind data for
Returns void
- _uniformBuffer: UniformBuffer
has Render Target Textures
-
Gets a boolean indicating that current material needs to register RTT
Returns boolean
true if this uses a render target otherwise false.
has Texture
-
Checks to see if a texture is used in the material.
Parameters
- _texture: BaseTexture
Base texture to use.
Returns boolean
- Boolean specifying if a texture is used in the material.
- _texture: BaseTexture
is Compatible
-
Gets a boolean indicating that the plugin is compatible with a given shader language.
Parameters
- shaderLanguage: ShaderLanguage
The shader language to use.
Returns boolean
true if the plugin is compatible with the shader language
- shaderLanguage: ShaderLanguage
is Ready For Sub Mesh
-
isReadyForSubMesh(
_defines: MaterialDefines,
_scene: Scene,
_engine: AbstractEngine,
_subMesh: SubMesh,
): booleanSpecifies that the submesh is ready to be used.
Parameters
- _defines: MaterialDefines
the list of "defines" to update.
- _scene: Scene
defines the scene the material belongs to.
- _engine: AbstractEngine
the engine this scene belongs to.
- _subMesh: SubMesh
the submesh to check for readiness
Returns boolean
- boolean indicating that the submesh is ready or not.
- _defines: MaterialDefines
parse
-
Parses a plugin configuration from a serialized object.
Parameters
- source: any
Serialized object.
- scene: Scene
Defines the scene we are parsing for
- rootUrl: string
Defines the rootUrl to load from
Returns void
- source: any
prepare Defines
-
Prepare the defines
Parameters
- defines: MeshDebugDefines
Mesh debug defines
- scene: Scene
Scene
- mesh: AbstractMesh
Mesh associated with material
Returns void
- defines: MeshDebugDefines
prepare Defines Before Attributes
-
prepareDefinesBeforeAttributes(
_defines: MaterialDefines,
_scene: Scene,
_mesh: AbstractMesh,
): voidSets the defines for the next rendering. Called before PrepareDefinesForAttributes is called.
Parameters
- _defines: MaterialDefines
the list of "defines" to update.
- _scene: Scene
defines the scene to the material belongs to.
- _mesh: AbstractMesh
the mesh being rendered
Returns void
- _defines: MaterialDefines
serialize
-
Serializes this plugin configuration.
Returns any
- An object with the serialized config.
StaticPrepare Mesh For Triangles And Vertices Mode
-
Renders triangles in a mesh 3 times by tripling the indices in the index buffer. Used to prepare a mesh to be rendered in
TRIANGLES,VERTICES, orTRIANGLES_VERTICESmodes. NOTE: This is a destructive operation. The mesh's index buffer and vertex buffers are modified, and a new vertex buffer is allocated. If you'd like the ability to revert these changes, toggle the optionalreturnRollbackflag.Parameters
- mesh: Mesh
the mesh to target
- returnRollback: boolean = false
whether or not to return a function that reverts mesh to its initial state. Default: false.
Returns () => void
a rollback function if
returnRollbackis true, otherwise an empty function. - mesh: Mesh
StaticReset
-
Resets static variables of the plugin to their original state
Returns void
Plugin that implements various mesh debug visualizations, List of available visualizations can be found in MeshDebugMode enum.