Skip to content

Commit

Permalink
Merge pull request #21074 from TechnologicNick/gltfexporter-offscreen…
Browse files Browse the repository at this point in the history
…canvas

GLTFExporter: Support for textures using OffscreenCanvas
  • Loading branch information
mrdoob authored Jan 13, 2021
2 parents 99b31b9 + c029278 commit 131ecd4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/js/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions examples/jsm/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 131ecd4

Please sign in to comment.