• Public
  • Public/Protected
  • All

Plugin that implements the decal map component of a material







isEnabled: boolean

Enables or disables the decal map on this material

markAllDefinesAsDirty: (() => void)

Helper function to mark defines as being dirty.

Type declaration

    • (): void
    • Helper function to mark defines as being dirty.

      Returns void

name: string

Defines the name of the plugin

priority: number

Defines the priority of the plugin. Lower numbers run first.

registerForExtraEvents: boolean

Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)

resolveIncludes: boolean

Indicates that any #include directive in the plugin code must be replaced by the corresponding code.

smoothAlpha: boolean

Enables or disables the smooth alpha mode on this material. Default: false. When enabled, the alpha value used to blend the decal map will be the squared value and will produce a smoother result.


  • Add fallbacks to the effect fallbacks list.


    • 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.

  • Binds the material data.


    • uniformBuffer: UniformBuffer

      defines the Uniform buffer to fill in.

    • scene: Scene

      defines the scene the material belongs to.

    • engine: Engine

      the engine this scene belongs to.

    • subMesh: SubMesh

      the submesh to bind data for

    Returns void

  • collectDefines(defines: {}): void
  • Collects all defines.


    • defines: {}

      The object to append to.

      • [name: string]: { default: any; type: string }
        • default: any
        • type: string

    Returns void

  • Makes a duplicate of the current configuration into another one.


    Returns void

  • dispose(forceDisposeTextures?: boolean): void
  • Disposes the resources of the material.


    • Optional forceDisposeTextures: boolean

      Forces the disposal of all textures.

    Returns void

  • Gets the attributes used by the plugin.


    • attributes: string[]

      list that the attribute names should be added to.

    • scene: Scene

      the scene that the material belongs to.

    • mesh: AbstractMesh

      the mesh being rendered.

    Returns void

  • getClassName(): string
  • Gets the current class name useful for serialization or dynamic coding.

    Returns string

  • getCustomCode(shaderType: string): Nullable<{}>
  • Returns a list of custom shader code fragments to customize the shader.


    • shaderType: string

      "vertex" or "fragment"

    Returns Nullable<{}>

    null if no code to be added, or a list of pointName => code. Note that pointName can also be a regular expression if it starts with a !. In that case, the string found by the regular expression (if any) will be replaced by the code provided.

  • getSamplers(samplers: string[]): void
  • Gets the samplers used by the plugin.


    • samplers: string[]

    Returns void

  • getUniformBuffersNames(ubos: string[]): void
  • Gets the uniform buffers names added by the plugin.


    • ubos: string[]

      list that the ubo names should be added to.

    Returns void

  • getUniforms(): { fragment?: string; ubo?: { name: string; size: number; type: string }[]; vertex?: string }
  • Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)

    Returns { fragment?: string; ubo?: { name: string; size: number; type: string }[]; vertex?: string }

    • Optional fragment?: string
    • Optional ubo?: { name: string; size: number; type: string }[]
    • Optional vertex?: string
  • Note that we override hardBindForSubMesh and not bindForSubMesh because the material can be shared by multiple meshes, in which case mustRebind could return false even though the decal map is different for each mesh: that's because the decal map is not part of the material but hosted by the decalMap of the mesh instead.


    Returns void

  • hasRenderTargetTextures(): boolean
  • Gets a boolean indicating that current material needs to register RTT

    Returns boolean

    true if this uses a render target otherwise false.

  • Checks to see if a texture is used in the material.


    Returns boolean

    • Boolean specifying if a texture is used in the material.
  • isReadyForSubMesh(defines: DecalMapDefines, scene: Scene, engine: Engine, subMesh: SubMesh): boolean
  • parse(source: any, scene: Scene, rootUrl: string): void
  • Parses a plugin configuration from a serialized object.


    • source: any

      Serialized object.

    • scene: Scene

      Defines the scene we are parsing for

    • rootUrl: string

      Defines the rootUrl to load from

    Returns void

  • Sets the defines for the next rendering. Called before MaterialHelper.PrepareDefinesForAttributes is called.


    • 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

  • serialize(): any
  • Serializes this plugin configuration.

    Returns any

    • An object with the serialized config.


  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method