@@ -650,7 +650,7 @@ class GLTFMaterialsUnlitExtension {
650650 *
651651 * Specification: https://github.com/KhronosGroup/glTF/blob/5768b3ce0ef32bc39cdf1bef10b948586635ead3/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md
652652 */
653- class GLTFMaterialsEmissiveStrengthExtension {
653+ class GLTFMaterialsEmissiveStrengthExtension {
654654
655655 constructor ( parser ) {
656656
@@ -670,8 +670,8 @@ class GLTFMaterialsUnlitExtension {
670670
671671 }
672672
673- const emissiveStrength = materialDef . extensions [ this . name ] . emissiveStrength ;
674-
673+ const emissiveStrength = materialDef . extensions [ this . name ] . emissiveStrength ;
674+
675675 if ( emissiveStrength !== undefined ) {
676676
677677 materialParams . emissiveIntensity = emissiveStrength ;
@@ -2315,14 +2315,19 @@ class GLTFParser {
23152315
23162316 // Use an ImageBitmapLoader if imageBitmaps are supported. Moves much of the
23172317 // expensive work of uploading a texture to the GPU off the main thread.
2318- if ( typeof createImageBitmap !== 'undefined' && / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test ( navigator . userAgent ) === false ) {
23192318
2320- this . textureLoader = new ImageBitmapLoader ( this . options . manager ) ;
2319+ const isSafari = / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test ( navigator . userAgent ) === true ;
2320+ const isFirefox = navigator . userAgent . indexOf ( 'Firefox' ) > - 1 ;
2321+ const firefoxVersion = isFirefox ? navigator . userAgent . match ( / F i r e f o x \/ ( [ 0 - 9 ] + ) \. / ) [ 1 ] : - 1 ;
23212322
2322- } else {
2323+ if ( typeof createImageBitmap === 'undefined' || isSafari || ( isFirefox && firefoxVersion < 98 ) ) {
23232324
23242325 this . textureLoader = new TextureLoader ( this . options . manager ) ;
23252326
2327+ } else {
2328+
2329+ this . textureLoader = new ImageBitmapLoader ( this . options . manager ) ;
2330+
23262331 }
23272332
23282333 this . textureLoader . setCrossOrigin ( this . options . crossOrigin ) ;
@@ -2627,9 +2632,9 @@ class GLTFParser {
26272632
26282633 case 'animation' :
26292634 dependency = this . _invokeOne ( function ( ext ) {
2630-
2635+
26312636 return ext . loadAnimation && ext . loadAnimation ( index ) ;
2632-
2637+
26332638 } ) ;
26342639 break ;
26352640
0 commit comments