Interface MaterialExtension

Material extension interface This is used to extend a three.js material satisfying the IMaterial interface, with extra uniforms, defines, shader code, etc.

Hierarchy

  • MaterialExtension

Implemented by

Properties

__setDirty?: (() => void)

Type declaration

    • (): void
    • Returns void

computeCacheKey?: string | ((material) => string)

Custom cache key to use for this material extension. A different cache key will cause the shader to be recompiled. Check three.js docs for more info. Value can be a string or a function that returns a string This will only be checked if material.needsUpdate is true, not on every render.

extraDefines?: Record<string, ValOrFunc<undefined | string | number>>

Extra defines to copy to material

extraUniforms?: {
    [uniform: string]: ValOrFunc<IUniform>;
}

Extra uniforms to copy to material

Type declaration

getUiConfig?: ((material, refreshUi) => undefined | UiObjectConfig<any, string, any>)

Type declaration

isCompatible: ((material) => boolean)

Type declaration

    • (material): boolean
    • Function to check if this material extension is compatible with the given material. If not compatible, the material extension will not be applied. This is only checked when the extension is registered.

      Returns boolean

onAfterRender?: ((object, material, renderer) => void)

Type declaration

onObjectRender?: ((object, material, renderer) => void)

Type declaration

parsFragmentSnippet?: string | ((renderer?, material?) => string)

Extra code to add to the top of the fragment shader Value can be a string or a function that returns a string

parsVertexSnippet?: string | ((renderer?, material?) => string)

Extra code to add to the top of the vertex shader Value can be a string or a function that returns a string

priority?: number

Higher priority extensions are applied first.

setDirty?: (() => void)

Type declaration

    • (): void
    • Returns void

shaderExtender?: ((shader, material, renderer) => void)

Type declaration

updateVersion?: number

List of shader properties updaters to run on the material.

uuid?: string

Generated using TypeDoc