Three.js: GLTFLoader ImageBitmapLoader覆盖无法处理的类型的加载器

创建于 2020-06-25  ·  3评论  ·  资料来源: mrdoob/three.js

问题描述

由于最近在GLFTLoader(https://github.com/mrdoob/three.js/pull/19518)中增加了BitmapLoader的用法,使用特定文件格式的处理程序将从BitmapLoader中覆盖。

在r117中支持gltf文件的基础纹理,您只需添加

var basisLoader = new BasisTextureLoader();
basisLoader.setTranscoderPath( 'js/libs/basis/' );
basisLoader.detectSupport( renderer );
THREE.DefaultLoadingManager.addHandler( /\.basis$/, basisLoader );

这不再可能,因为解决方案将在此处覆盖: https :

我收到以下错误:

THREE.WebGLState: TypeError: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': No function was found that matched the signature provided.
    at Object.texImage2D (three.module.js:21828)
    at uploadTexture (three.module.js:22749)
    at setTexture2D (three.module.js:22274)
    at WebGLTextures.safeSetTexture2D (three.module.js:23169)
    at SingleUniform.setValueT1 [as setValue] (three.module.js:17755)
    at Function.WebGLUniforms.upload (three.module.js:18260)
    at setProgram (three.module.js:26406)
    at WebGLRenderer.renderBufferDirect (three.module.js:25441)
    at renderObject (three.module.js:25994)
    at renderObjects (three.module.js:25966)
Three.js版本
  • [x]开发
  • [x] r118
  • [] r117
浏览器
  • [ ] 他们都是
  • [x] Chrome
  • []火狐
  • [ ] 边缘
操作系统
  • [x]全部
  • [] Windows
  • [ ] 苹果系统
  • [] Linux
  • [ ] 安卓
  • [] iOS
硬件要求(图形卡,VR设备等)
Bug Loaders

最有用的评论

@ Mugen87是的,这确实为我解决了问题。 非常感谢您如此迅速地解决了该错误!

所有3条评论

使用glTF-dds扩展名时,其中一个官方示例发生相同的错误:

https://threejs.org/examples/webgl_loader_gltf_extensions

@JohannesDeml您能否检查链接的PR是否解决了您的问题? 至少我可以用它来修复DDS示例^^。

@ Mugen87是的,这确实为我解决了问题。 非常感谢您如此迅速地解决了该错误!

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

akshaysrin picture akshaysrin  ·  3评论

jlaquinte picture jlaquinte  ·  3评论

filharvey picture filharvey  ·  3评论

zsitro picture zsitro  ·  3评论

boyravikumar picture boyravikumar  ·  3评论