@pixi/3d
    Preparing search index...

    Variable loadCubemapConst Advanced

    loadCubemap: {
        extension: { name: string; type: LoadParser };
        id: string;
        name: string;
        load<T>(
            url: string,
            _resolvedAsset?: ResolvedAsset<any>,
            loader?: Loader,
        ): Promise<CubeTexture>;
        test(url: string): boolean;
        unload(
            cubeTexture: CubeTexture,
            _resolvedAsset?: ResolvedAsset<any>,
            loader?: Loader,
        ): Promise<void>;
    } = ...

    Loads a .cubemap JSON file as a CubeTexture

    The JSON names an image for each of the six faces, relative to the .cubemap file:

    {
    "right": "specular_posx.jpg",
    "left": "specular_negx.jpg",
    "top": "specular_posy.jpg",
    "bottom":"specular_negy.jpg",
    "front": "specular_posz.jpg",
    "back": "specular_negz.jpg"
    }

    @pixi/3d registers it with Assets on import. Assets.unload(url) destroys the cube and unloads its six images from the loader's cache, even when another loaded asset still uses one.

    Type Declaration

    • extension: { name: string; type: LoadParser }
    • id: string
    • name: string
    • load: function
    • test: function
      • Parameters

        • url: string

        Returns boolean

    • unload: function
      • Destroys the cube before unloading its faces, so it has stopped listening to them by then

        Parameters

        • cubeTexture: CubeTexture

          The cube texture load returned

        • Optional_resolvedAsset: ResolvedAsset<any>

          Unused

        • Optionalloader: Loader

          The loader that cached the face textures

        Returns Promise<void>

    import { Assets } from 'pixi.js';
    import '@pixi/3d';

    const env = await Assets.load<CubeTexture>('environment.cubemap');
    view3d.environment = env;