2
0
Эх сурвалжийг харах

Merge pull request #21074 from TechnologicNick/gltfexporter-offscreencanvas

GLTFExporter: Support for textures using OffscreenCanvas
Mr.doob 4 жил өмнө
parent
commit
131ecd447a

+ 1 - 0
examples/js/exporters/GLTFExporter.js

@@ -795,6 +795,7 @@ THREE.GLTFExporter.prototype = {
 
 				if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||
 					( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||
+					( typeof OffscreenCanvas !== 'undefined' && image instanceof OffscreenCanvas ) ||
 					( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {
 
 					ctx.drawImage( image, 0, 0, canvas.width, canvas.height );

+ 1 - 0
examples/jsm/exporters/GLTFExporter.js

@@ -818,6 +818,7 @@ GLTFExporter.prototype = {
 
 				if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||
 					( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||
+					( typeof OffscreenCanvas !== 'undefined' && image instanceof OffscreenCanvas ) ||
 					( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {
 
 					ctx.drawImage( image, 0, 0, canvas.width, canvas.height );