ソースを参照

Merge pull request #13586 from Mugen87/dev11

WebGLTextures: Make .clampToMaxSize() more robust
Mr.doob 7 年 前
コミット
d40d310a99
1 ファイル変更7 行追加0 行削除
  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 ( '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
 			// premultiplied alpha.