原因:加载进来的资源路径报错
加载进来的所有资源,最好放在/public/文件夹下,否则会报错
资源所在位置:
public/textures/hdr/skybox.hdr
// 加载hdr环境图
const rgbeLoader = new RGBELoader();
rgbeLoader.loadAsync("/textures/hdr/skybox.hdr").then((texture) => {
texture.mapping = THREE.EquirectangularReflectionMapping;
scene.background = texture;
scene.environment = texture;
});