Browse Source

Merge pull request #13586 from Mugen87/dev11

WebGLTextures: Make .clampToMaxSize() more robust
Mr.doob 7 years ago
parent
commit
d40d310a99
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/renderers/webgl/WebGLTextures.js

+ 7 - 0
src/renderers/webgl/WebGLTextures.js

@@ -17,6 +17,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 
 		if ( image.width > maxSize || image.height > maxSize ) {
 		if ( image.width > maxSize || image.height > maxSize ) {
 
 
+			if ( 'data' in image ) {
+
+				console.warn( 'THREE.WebGLRenderer: image in DataTexture is too big (' + image.width + 'x' + image.height + ').' );
+				return;
+
+			}
+
 			// Warning: Scaling through the canvas will only work with images that use
 			// Warning: Scaling through the canvas will only work with images that use
 			// premultiplied alpha.
 			// premultiplied alpha.