ThreePipe
    Preparing search index...

    Interface IMaterial<TE>

    interface IMaterial<TE extends IMaterialEventMap = IMaterialEventMap> {
        __matExtUiConfigs?: Record<
            string,
            undefined
            | UiObjectConfig<any, string, any>,
        >;
        __textureUpdate?: (e: Event<"update", Texture<TextureEventMap>>) => void;
        _mapRefs?: Set<ITexture<TextureEventMap>>;
        alphaMap?: null | ITexture<TextureEventMap>;
        aoMap?: null | ITexture<TextureEventMap>;
        aoMapIntensity?: number;
        appliedMeshes: Set<
            IObject3D<
                IObject3DEventMap,
                undefined
                | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
                undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
            >,
        >;
        assetType: "material";
        bumpMap?: null | ITexture<TextureEventMap>;
        color?: Color;
        constructor: {
            InterpolateProperties?: string[];
            MapProperties?: string[];
            MaterialProperties?: Record<string, any>;
            MaterialTemplate?: IMaterialTemplate<IMaterial<IMaterialEventMap>, any>;
            TYPE: string;
            TypeSlug: string;
        };
        displacementMap?: null
        | ITexture<TextureEventMap>;
        emissive?: Color;
        emissiveIntensity?: number;
        emissiveMap?: null | ITexture<TextureEventMap>;
        envMap?: null | ITexture<TextureEventMap>;
        envMapIntensity?: number;
        extraUniformsToUpload: Record<string, IUniform>;
        flatShading?: boolean;
        generator?: IMaterialGenerator<IMaterial<IMaterialEventMap>>;
        isGBufferMaterial?: boolean;
        isLineMaterial?: boolean;
        isLineMaterial2?: boolean;
        isPhysicalMaterial?: boolean;
        isRawShaderMaterial?: boolean;
        isUnlitLineMaterial?: boolean;
        isUnlitMaterial?: boolean;
        lastShader?: WebGLProgramParametersWithUniforms;
        lightMap?: null | ITexture<TextureEventMap>;
        lightMapIntensity?: number;
        linewidth?: number;
        map?: null | ITexture<TextureEventMap>;
        materialExtensions: MaterialExtension[];
        metalness?: number;
        metalnessMap?: null | ITexture<TextureEventMap>;
        needsUpdate: boolean;
        normalMap?: null | ITexture<TextureEventMap>;
        registerMaterialExtensions: (
            customMaterialExtensions: MaterialExtension[],
        ) => void;
        roughness?: number;
        roughnessMap?: null | ITexture<TextureEventMap>;
        transmission?: number;
        transmissionMap?: null | ITexture<TextureEventMap>;
        unregisterMaterialExtensions: (
            customMaterialExtensions: MaterialExtension[],
        ) => void;
        userData: IMaterialUserData;
        wireframe?: boolean;
        clone(track?: boolean): this;
        dispose(force?: boolean): void;
        fromJSON(
            json: any,
            meta?: SerializationMetaType,
            _internal?: boolean,
        ): null | IMaterial<TE>;
        setDirty(options?: IMaterialSetDirtyOptions): void;
        setValues(
            parameters:
                | Material<MaterialEventMap>
                | MaterialParameters & { type?: string },
            allowInvalidType?: boolean,
            clearCurrentUserData?: boolean,
            time?: AnimateTimeMaterial,
        ): this;
        toJSON(meta?: SerializationMetaType, _internal?: boolean): any;
    }

    Type Parameters

    Hierarchy

    Implemented by

    Index

    Properties

    __matExtUiConfigs?: Record<string, undefined | UiObjectConfig<any, string, any>>
    __textureUpdate?: (e: Event<"update", Texture<TextureEventMap>>) => void
    _mapRefs?: Set<ITexture<TextureEventMap>>
    alphaMap?: null | ITexture<TextureEventMap>
    aoMap?: null | ITexture<TextureEventMap>
    aoMapIntensity?: number
    appliedMeshes: Set<
        IObject3D<
            IObject3DEventMap,
            undefined
            | IGeometry<NormalBufferAttributes, BufferGeometryEventMap>,
            undefined | IMaterial<IMaterialEventMap> | IMaterial<IMaterialEventMap>[],
        >,
    >

    Objects in the scene that are using this material. This is set in the Object3DManager when the objects are added/removed from the scene. Do not modify this set directly.

    assetType: "material"
    bumpMap?: null | ITexture<TextureEventMap>
    color?: Color
    constructor: {
        InterpolateProperties?: string[];
        MapProperties?: string[];
        MaterialProperties?: Record<string, any>;
        MaterialTemplate?: IMaterialTemplate<IMaterial<IMaterialEventMap>, any>;
        TYPE: string;
        TypeSlug: string;
    }

    The initial value of Object.prototype.constructor is the standard built-in Object constructor.

    displacementMap?: null | ITexture<TextureEventMap>
    emissive?: Color
    emissiveIntensity?: number
    emissiveMap?: null | ITexture<TextureEventMap>
    envMap?: null | ITexture<TextureEventMap>
    envMapIntensity?: number
    extraUniformsToUpload: Record<string, IUniform>
    flatShading?: boolean

    Managed internally, do not change manually

    isGBufferMaterial?: boolean
    isLineMaterial?: boolean
    isLineMaterial2?: boolean
    isPhysicalMaterial?: boolean
    isRawShaderMaterial?: boolean
    isUnlitLineMaterial?: boolean
    isUnlitMaterial?: boolean
    lightMap?: null | ITexture<TextureEventMap>
    lightMapIntensity?: number
    linewidth?: number
    materialExtensions: MaterialExtension[]
    metalness?: number
    metalnessMap?: null | ITexture<TextureEventMap>
    needsUpdate: boolean

    Specifies that the material needs to be updated, WebGL wise. Set it to true if you made changes that need to be reflected in WebGL. This property is automatically set to true when instancing a new material.

    false
    
    normalMap?: null | ITexture<TextureEventMap>
    registerMaterialExtensions: (
        customMaterialExtensions: MaterialExtension[],
    ) => void
    roughness?: number
    roughnessMap?: null | ITexture<TextureEventMap>
    transmission?: number
    transmissionMap?: null | ITexture<TextureEventMap>
    unregisterMaterialExtensions: (
        customMaterialExtensions: MaterialExtension[],
    ) => void

    An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.

    {}
    
    wireframe?: boolean

    Methods

    • Clones the Material. This is a shallow clone, so the properties are copied by reference.

      Parameters

      • Optionaltrack: boolean

        if true, the clone id and count will be tracked in the userData and a suffix will be appended to the name. default - false

      Returns this

    • Disposes the material from the GPU. Set force to false if not sure the material is used by any object in the scene. // todo add check for visible in scene also? or is that overkill

      Parameters

      • Optionalforce: boolean

        when true, same as three.js dispose. when false, only disposes if disposeOnIdle not false and not used by any object in the scene. default: true

      Returns void