Const AdvancedOptionalresolvedAsset: ResolvedAsset<HdrAssetData>Destroys the faces too, as destroying a cube's source only detaches them
The cube texture load returned
import { Assets } from 'pixi.js';
import type { CubeTexture } from 'pixi.js';
import '@pixi/3d';
const sky = await Assets.load<CubeTexture>('studio_2k.hdr');
view3d.environment = sky;
view3d.background = sky;
const sharp = await Assets.load<CubeTexture>({ src: 'sunset_4k.hdr', data: { faceSize: 1024 } });
Loads an equirectangular Radiance
.hdrimage as an HDR CubeTextureUse the cube as View3D#environment, View3D#background, or both. It keeps light brighter than white, such as the sun, bright in reflections and in the sky.
The conversion runs on the main thread while the asset loads: about 50 ms for a 1k panorama and 150 ms for a 2k one on a fast desktop, longer on a phone. HdrAssetData#faceSize trades memory for a sharper sky.
The centre of the panorama faces +X, so a camera looking down -Z, as the default camera does, is centred a quarter of the way in from the panorama's left edge. HDR panoramas are commonly shown this way on the web.
@pixi/3dregisters it withAssetson import, andAssets.unload(url)destroys the cube and its faces.