|
@@ -12,7 +12,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
//
|
|
//
|
|
|
|
|
|
- var useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined';
|
|
|
|
|
|
+ var useOffscreenCanvas = typeof document === 'undefined';
|
|
|
|
|
|
function createCanvas( width, height ) {
|
|
function createCanvas( width, height ) {
|
|
|
|
|
|
@@ -59,6 +59,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
canvas.height = height;
|
|
canvas.height = height;
|
|
|
|
|
|
var context = canvas.getContext( '2d' );
|
|
var context = canvas.getContext( '2d' );
|
|
|
|
+
|
|
|
|
+ // ImageBitmap is flipped vertically
|
|
|
|
+
|
|
|
|
+ if ( useOffscreenCanvas )
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ context.translate( 0, height );
|
|
|
|
+ context.scale( 1, -1 );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
context.drawImage( image, 0, 0, width, height );
|
|
context.drawImage( image, 0, 0, width, height );
|
|
|
|
|
|
console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').' );
|
|
console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').' );
|