Three.js: يتجاوز GLTFLoader ImageBitmapLoader اللوادر لأنواع لا يمكنه التعامل معها

تم إنشاؤها على ٢٥ يونيو ٢٠٢٠  ·  3تعليقات  ·  مصدر: mrdoob/three.js

وصف المشكلة

نظرًا للاستخدام المضاف مؤخرًا لـ BitmapLoader في GLFTLoader (https://github.com/mrdoob/three.js/pull/19518) ، سيتم استبدال معالجات تنسيقات ملفات معينة من BitmapLoader.

في r117 لدعم القوام الأساسي لملفات gltf ، ستحتاج فقط إلى إضافته

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

لم يعد هذا ممكنًا ، حيث سيتم الكتابة فوق الحل هنا: https://github.com/mrdoob/three.js/blob/7df06a0e4054247f87a7b5aa555ca97cd6b15662/examples/jsm/loaders/GLTFLoader.js#L2077 -L2093

أتلقى الخطأ التالي:

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] كروم
  • [ ] ثعلب النار
  • [ ] حافة
نظام التشغيل
  • [x] كل منهم
  • [ ] شبابيك
  • [] macOS
  • [] لينكس
  • [ ] ذكري المظهر
  • [] iOS
متطلبات الأجهزة (بطاقة الرسومات ، جهاز VR ، ...)
Bug Loaders

التعليق الأكثر فائدة

@ Mugen87 نعم ، هذا

ال 3 كومينتر

يحدث الخطأ نفسه مع أحد الأمثلة الرسمية عند استخدام الامتداد glTF-dds :

https://threejs.org/examples/webgl_loader_gltf_extensions

JohannesDeml هل يمكنك التحقق مما إذا كانت العلاقات العامة المرتبطة تحل مشكلتك؟ على الأقل يمكنني إصلاح مثال DDS به ^ ^.

@ Mugen87 نعم ، هذا

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات