Class MeshDebugPluginMaterial
Hierarchy
- MaterialPluginBase
- MeshDebugPluginMaterial
Index
Constructors
Properties
Accessors
Methods
- add
Fallbacks - bind
For Sub Mesh - collect
Defines - copy
To - dispose
- fill
Render Target Textures - get
Active Textures - get
Animatables - get
Attributes - get
Class Name - get
Custom Code - get
Samplers - get
Uniform Buffers Names - get
Uniforms - hard
Bind For Sub Mesh - has
Render Target Textures - has
Texture - is
Ready For Sub Mesh - parse
- prepare
Defines - prepare
Defines Before Attributes - serialize
- Prepare
Mesh For Triangles And Vertices Mode - Reset
Constructors
constructor
Creates a new MeshDebugPluginMaterial
Parameters
material: StandardMaterial | PBRBaseMaterial
Material to attach the mesh debug plugin to
Optional options: MeshDebugOptions
Options for the mesh debug plugin
Returns MeshDebugPluginMaterial
Properties
Readonly mark All Defines As DirtySearch playground for markAllDefinesAsDirty
Type declaration
Helper function to mark defines as being dirty.
Returns void
modeSearch playground for mode
The mesh debug visualization. Defaults to NONE.
multiplySearch playground for multiply
Whether the mesh debug visualization should multiply with color underneath. Defaults to true.
nameSearch playground for name
Defines the name of the plugin
prioritySearch playground for priority
Defines the priority of the plugin. Lower numbers run first.
register For Extra EventsSearch playground for registerForExtraEvents
Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
resolve IncludesSearch playground for resolveIncludes
Indicates that any #include directive in the plugin code must be replaced by the corresponding code.
shaded Diffuse ColorSearch playground for shadedDiffuseColor
Diffuse color used to shade the mesh. Defaults to (1.0, 1.0, 1.0).
shaded Specular ColorSearch playground for shadedSpecularColor
Specular color used to shade the mesh. Defaults to (0.8, 0.8, 0.8).
shaded Specular PowerSearch playground for shadedSpecularPower
Specular power used to shade the mesh. Defaults to 10.
uv Primary ColorSearch playground for uvPrimaryColor
1st color of checkerboard grid in UV1 or UV2 modes. Defaults to (1.0, 1.0, 1.0).
uv ScaleSearch playground for uvScale
Size of tiles in UV1 or UV2 modes. Defaults to 20.
uv Secondary ColorSearch playground for uvSecondaryColor
2nd color of checkerboard grid in UV1 or UV2 modes. Defaults to (0.5, 0.5, 0.5).
vertex ColorSearch playground for vertexColor
Color of vertices in TRIANGLES_VERTICES and VERTICES mode. Defaults to (0.0, 0.0, 0.0).
vertex RadiusSearch playground for vertexRadius
Radius of dots drawn over vertices in TRIANGLE_VERTICES and VERTICES mode. Defaults to 1.2.
wireframe ThicknessSearch playground for wireframeThickness
Width of edge lines in TRIANGLES and TRIANGLE_VERTICES modes. Defaults to 0.7.
wireframe Triangles ColorSearch playground for wireframeTrianglesColor
Color of edge lines in TRIANGLES mode. Defaults to (0.0, 0.0, 0.0).
wireframe Vertices ColorSearch playground for wireframeVerticesColor
Color of edge lines in TRIANGLES_VERTICES modes. Defaults to (0.8, 0.8, 0.8).
Static Material ColorsSearch playground for MaterialColors
Color palette used for MATERIALIDS mode.
Defaults to defaultMaterialColors
Accessors
is Enabled
Gets whether the mesh debug plugin is enabled in the material.
Returns boolean
Sets whether the mesh debug plugin is enabled in the material.
Parameters
value: boolean
enabled
Returns void
Methods
add FallbacksSearch playground for addFallbacks
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.
bind For Sub MeshSearch playground for bindForSubMesh
Bind the uniform buffer
Parameters
uniformBuffer: UniformBuffer
Uniform buffer
Returns void
collect DefinesSearch playground for collectDefines
Collects all defines.
Parameters
defines: {}
The object to append to.
[name: string]: { default: any; type: string }
default: any
type: string
Returns void
copy ToSearch playground for copyTo
Makes a duplicate of the current configuration into another one.
Parameters
plugin: MaterialPluginBase
define the config where to copy the info
Returns void
disposeSearch playground for dispose
Disposes the resources of the material.
Parameters
Optional forceDisposeTextures: boolean
Forces the disposal of all textures.
Returns void
fill Render Target TexturesSearch playground for fillRenderTargetTextures
Fills the list of render target textures.
Parameters
renderTargets: SmartArray<RenderTargetTexture>
the list of render targets to update
Returns void
get Active TexturesSearch playground for getActiveTextures
Returns an array of the actively used textures.
Parameters
activeTextures: BaseTexture[]
Array of BaseTextures
Returns void
get AnimatablesSearch playground for getAnimatables
Returns the animatable textures.
Parameters
animatables: IAnimatable[]
Array of animatable textures.
Returns void
get AttributesSearch playground for getAttributes
Get the shader attributes
Parameters
attributes: string[]
Array of attributes
Returns void
get Class NameSearch playground for getClassName
Get the class name
Returns string
Class name
get Custom CodeSearch playground for getCustomCode
Get shader code
Parameters
shaderType: string
"vertex" or "fragment"
Returns Nullable<{}>
Shader code
get SamplersSearch playground for getSamplers
Gets the samplers used by the plugin.
Parameters
samplers: string[]
list that the sampler names should be added to.
Returns void
get Uniform Buffers NamesSearch playground for getUniformBuffersNames
Gets the uniform buffers names added by the plugin.
Parameters
ubos: string[]
list that the ubo names should be added to.
Returns void
get UniformsSearch playground for getUniforms
Get the shader uniforms
Returns { fragment: string; ubo: { name: string; size: number; type: string }[] }
Uniforms
fragment: string
ubo: { name: string; size: number; type: string }[]
hard Bind For Sub MeshSearch playground for hardBindForSubMesh
Binds 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: Engine
defines the engine the material belongs to.
subMesh: SubMesh
the submesh to bind data for
Returns void
has Render Target TexturesSearch playground for hasRenderTargetTextures
Gets a boolean indicating that current material needs to register RTT
Returns boolean
true if this uses a render target otherwise false.
has TextureSearch playground for hasTexture
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.
is Ready For Sub MeshSearch playground for isReadyForSubMesh
Specifies 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: Engine
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.
parseSearch playground for 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
prepare DefinesSearch playground for prepareDefines
Prepare the defines
Parameters
defines: MeshDebugDefines
Mesh debug defines
scene: Scene
Scene
mesh: AbstractMesh
Mesh associated with material
Returns void
prepare Defines Before AttributesSearch playground for prepareDefinesBeforeAttributes
Sets the defines for the next rendering. Called before MaterialHelper.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
serializeSearch playground for serialize
Serializes this plugin configuration.
Returns any
- An object with the serialized config.
Static Prepare Mesh For Triangles And Vertices ModeSearch playground for PrepareMeshForTrianglesAndVerticesMode
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_VERTICES
modes. 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 optionalreturnRollback
flag.Parameters
mesh: Mesh
the mesh to target
Optional returnRollback: boolean
whether or not to return a function that reverts mesh to its initial state. Default: false.
Returns (() => void)
a rollback function if
returnRollback
is true, otherwise an empty function.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_VERTICES
modes. 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 optionalreturnRollback
flag.Returns void
a rollback function if
returnRollback
is true, otherwise an empty function.
Static ResetSearch playground for Reset
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.