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]クローム
  • [] Firefox
  • [ ] 縁
OS
  • [x]それらすべて
  • [ ] ウィンドウズ
  • [ ] マックOS
  • [] Linux
  • [] Android
  • [] iOS
ハードウェア要件(グラフィックカード、VRデバイスなど)
Bug Loaders

最も参考になるコメント

@ Mugen87はい、

全てのコメント3件

glTF-dds拡張子を使用すると、公式の例の1つでも同じエラーが発生します。

https://threejs.org/examples/webgl_loader_gltf_extensions

@JohannesDemlリンクされたPRが問題を解決するかどうかを確認できますか? 少なくとも、DDSの例はそれで修正できました^^。

@ Mugen87はい、

このページは役に立ちましたか?
0 / 5 - 0 評価