我是靠谱客的博主 细心黑夜,这篇文章主要介绍Threejs报错:RGBELoader Bad File Format: bad initial token,现在分享给大家,希望可以做个参考。

原因:加载进来的资源路径报错

加载进来的所有资源,最好放在/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;
});

最后

以上就是细心黑夜最近收集整理的关于Threejs报错:RGBELoader Bad File Format: bad initial token的全部内容,更多相关Threejs报错:RGBELoader内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(115)

评论列表共有 0 条评论

立即
投稿
返回
顶部