API

Class MaterialPluginBaseSince

Base class for material plugins. 5.0

Hierarchy (View Summary)

Index
  • Creates a new material plugin

    Parameters

    • material: Material

      parent material of the plugin

    • name: string

      name of the plugin

    • priority: number

      priority of the plugin

    • Optionaldefines: { [key: string]: any }

      list of defines used by the plugin. The value of the property is the default value for this property

    • addToPluginList: boolean = true

      true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)

    • enable: boolean = false

      true to enable the plugin (it is handy if the plugin does not handle properties to switch its current activation)

    • resolveIncludes: boolean = false

      Indicates that any #include directive in the plugin code must be replaced by the corresponding code (default: false)

    Returns MaterialPluginBase

doNotSerialize: boolean = false

Specifies if the material plugin should be serialized, true to skip serialization

markAllDefinesAsDirty: () => void

Helper function to mark defines as being dirty.

name: string

Defines the name of the plugin

priority: number = 500

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

registerForExtraEvents: boolean = false

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

resolveIncludes: boolean = false

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

  • Returns a list of custom shader code fragments to customize the shader.

    Parameters

    • _shaderType: string

      "vertex" or "fragment"

    • _shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL

      The shader language to use.

    Returns Nullable<{ [pointName: string]: string }>

    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.

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

    Parameters

    • _shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL

      The shader language to use.

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

    the description of the uniforms