ThreePipe
    Preparing search index...

    Interface IMaterialUserData

    interface IMaterialUserData {
        __importData?: any;
        __isVariation?: boolean;
        __needsSourceBuffer?: boolean;
        __sourceBlob?: IFile;
        __sourceBuffer?: ArrayBuffer;
        _clearcoatTint?: {
            enableTint?: boolean;
            ior?: number;
            thickness?: number;
            tintColor?: string | number | Color;
        };
        _customBumpMap?: ITexture<TextureEventMap>
        | null;
        _customBumpScale?: number;
        _fragmentClippingExt?: {
            clipEnabled?: boolean;
            clipInvert?: boolean;
            clipMode?: FragmentClippingMode;
            clipParams?: Vector4 | Vector4Tuple;
            clipPosition?: Vector4 | Vector4Tuple;
        };
        _hasCustomBump?: boolean;
        _noiseBumpMat?: {
            bumpNoiseParams?: Vector2
            | Vector2Tuple;
            bumpScale?: number;
            flakeClamp?: number;
            flakeFallOffParams?: Vector3 | Vector3Tuple;
            flakeParams?: Vector4 | Vector4Tuple;
            flakeRadius?: number;
            flakeScale?: number;
            hasBump?: boolean;
            useColorFlakes?: boolean;
        };
        animationObjects?: AnimationObject<any>[];
        autoRegisterInManager?: boolean;
        cloneCount?: number;
        cloneId?: string;
        constraints?: ObjectConstraint<keyof ConstraintPropsTypes>[];
        disposeOnIdle?: boolean;
        envMapSlotKey?: string;
        forcedLinearDepth?: number;
        gBufferData?: {
            materialId?: number;
            tonemapEnabled?: boolean;
            [key: string]: any;
        };
        inverseAlphaMap?: boolean;
        isPlaceholder?: boolean;
        pluginsDisabled?: boolean;
        postTonemap?: boolean;
        renderToDepth?: boolean;
        renderToFlags?: boolean;
        renderToGBuffer?: boolean;
        rootPath?: string;
        rootPathOptions?: Record<string, any>;
        rootPathRefresh?: boolean;
        runtimeMaterial?: boolean;
        separateEnvMapIntensity?: boolean;
        setDirty?: (options?: IMaterialSetDirtyOptions) => void;
        sProperties?: string[];
        ssaoCastDisabled?: boolean;
        ssaoDisabled?: boolean;
        sscsDisabled?: boolean;
        ssreflDisabled?: boolean;
        ssreflNonPhysical?: boolean;
        uuid?: string;
        [key: string]: any;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: string]: any
    Index
    __importData?: any

    extra arbitrary data saved by the importer that can be used by the plugins (like gltf material variants)

    __isVariation?: boolean
    __needsSourceBuffer?: boolean

    This can be set to true in the importer to indicate that the source buffer should be loaded and cached in the userdata during processRaw

    __sourceBlob?: IFile

    Cached source blob for the asset

    __sourceBuffer?: ArrayBuffer

    Cached source buffer for the asset (only cached when __needsSourceBuffer is set)

    _clearcoatTint?: {
        enableTint?: boolean;
        ior?: number;
        thickness?: number;
        tintColor?: string | number | Color;
    }
    _customBumpMap?: ITexture<TextureEventMap> | null
    _customBumpScale?: number
    _fragmentClippingExt?: {
        clipEnabled?: boolean;
        clipInvert?: boolean;
        clipMode?: FragmentClippingMode;
        clipParams?: Vector4 | Vector4Tuple;
        clipPosition?: Vector4 | Vector4Tuple;
    }
    _hasCustomBump?: boolean
    _noiseBumpMat?: {
        bumpNoiseParams?: Vector2 | Vector2Tuple;
        bumpScale?: number;
        flakeClamp?: number;
        flakeFallOffParams?: Vector3 | Vector3Tuple;
        flakeParams?: Vector4 | Vector4Tuple;
        flakeRadius?: number;
        flakeScale?: number;
        hasBump?: boolean;
        useColorFlakes?: boolean;
    }
    animationObjects?: AnimationObject<any>[]
    autoRegisterInManager?: boolean

    Automatically register this material in the MaterialManager when added to the scene. This provides hook to other plugins to extend the material, add uiconfig etc.

    true
    
    cloneCount?: number
    cloneId?: string
    constraints?: ObjectConstraint<keyof ConstraintPropsTypes>[]
    disposeOnIdle?: boolean

    Automatically dispose material when not used by any object in the scene

    true
    
    envMapSlotKey?: string

    The environment map to use in the RootScene. To use this, object with the material must be in the RootScene, and the key should exist in the RootScene's textureSlots.

    only for materials that have envMap

    forcedLinearDepth?: number

    Force a depth value in GBuffer. This is useful to force center values like 0 to the depth.

    gBufferData?: {
        materialId?: number;
        tonemapEnabled?: boolean;
        [key: string]: any;
    }

    Type Declaration

    • [key: string]: any
    • OptionalmaterialId?: number
    • OptionaltonemapEnabled?: boolean
      true
      
    inverseAlphaMap?: boolean
    isPlaceholder?: boolean

    If this is a placeholder/dummy material. These materials are not saved in asset/glTF files.

    pluginsDisabled?: boolean

    General flag to disable multiple plugins on the material at once, like SSAO, SSR, Bloom etc.

    postTonemap?: boolean

    Use postTonemap.tonemapEnabled instead. This is kept because used in old files.

    renderToDepth?: boolean

    Same as renderToGBuffer, and takes precedence over it, for the passes that render depth: DepthBufferPlugin and GBufferPlugin, and the normal buffer of NormalBufferPlugin when its renderTransparent is false. When not set, renderToGBuffer is used.

    renderToFlags?: boolean

    Write the GBuffer flags (tone mapping, bloom, SSAO and the others of GBufferPlugin) for the pixels of the material even when it is not drawn into the GBuffer, for example with renderToGBuffer: false. Such a material then writes only the flags texture: no depth and no normal, so it does not change SSAO, SSR, depth of field or outlines. It is drawn after the other objects, without depth write, with its own depth test, and its pixels with an alpha (from map, alphaMap and alphaTest) of about 0 are left out.

    Overlays like the helper widgets use it with toneMapped: false, so that the screen pass does not tone map them and they keep their exact color.

    When not set, the flags are written where the material is drawn into the GBuffer (renderToDepth, then renderToGBuffer), as before. A material that is drawn into the GBuffer always writes its flags. Needs the flags texture (GBufferPlugin.renderFlagsBuffer, on by default) and a material that the GBufferMaterial draws: one with allowOverride true, or a fat line (its customGBufferMaterial). Not used with pluginsDisabled.

    renderToGBuffer?: boolean

    Draw the material into the GBuffer of GBufferPlugin (depth, normal and flags), the depth of DepthBufferPlugin, and the normal buffer of NormalBufferPlugin when its renderTransparent is false. SSAO, SSR, depth of field and outlines see only the materials drawn there. renderToDepth takes precedence over it when set.

    • true: drawn, also when transparent or transmissive.
    • false: not drawn, and no flags are written for its pixels (see renderToFlags). pluginsDisabled acts as false.
    • not set: an opaque material is drawn. A transparent material is drawn only when it looks opaque: an opacity above 0.99, and no map or alphaMap. A transmissive material is not drawn.

    A material that is drawn keeps the cut-out shape of its map and alphaMap alpha, as in the render: pixels with an alpha below its alphaTest are left out, and all the others write depth and normal. With alphaTest 0 nothing is cut. For foliage, lace and decals, use an opaque material with alphaTest (glTF alphaMode: MASK): it is drawn with its shape. A blended material (transparent: true with an alpha texture, glTF BLEND) is not drawn unless this is true, and then all its pixels write depth, also the transparent ones, so set alphaTest with it.

    rootPath?: string

    The path from which the asset was downloaded/imported.

    rootPathOptions?: Record<string, any>

    Incase files are loaded as different extensions(like for json), this will be set.

    rootPathRefresh?: boolean

    Whether to refresh this object from the asset manager when its loaded as an embedded object

    runtimeMaterial?: boolean
    separateEnvMapIntensity?: boolean

    Flag to tell the scene to prefer material.envMapIntensity over scene.environmentIntensity only for materials that have envMapIntensity

    setDirty?: (options?: IMaterialSetDirtyOptions) => void
    sProperties?: string[]

    List of properties that will be saved in the glb/material files when this material is saved. The other properties are expected to be loaded/filled at runtime by default values or from an external material loaded from IImportResultUserData.rootPath.

    ssaoCastDisabled?: boolean

    Cast SSAO on other objects. if casting is not working when this is false, ensure render to depth is true, like for transparent objects

    ssaoDisabled?: boolean

    Disable SSAOPlugin for this material.

    sscsDisabled?: boolean

    For SSCSPlugin

    ssreflDisabled?: boolean

    For SSRPlugin

    ssreflNonPhysical?: boolean

    For SSRPlugin

    uuid?: string