Browse Source

WebGLTextures: Fix empty image check. (#23421)

* WebGLTextures: Fix empty image check.

* Texture: Update value of DEFAULT_IMAGE.
Michael Herzog 3 years ago
parent
commit
a0b7f9394b
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/renderers/webgl/WebGLTextures.js
  2. 1 1
      src/textures/Texture.js

+ 2 - 2
src/renderers/webgl/WebGLTextures.js

@@ -431,9 +431,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
 
 			const image = texture.image;
 
-			if ( image === undefined ) {
+			if ( image === null ) {
 
-				console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is undefined' );
+				console.warn( 'THREE.WebGLRenderer: Texture marked for update but no image data found.' );
 
 			} else if ( image.complete === false ) {
 

+ 1 - 1
src/textures/Texture.js

@@ -298,7 +298,7 @@ class Texture extends EventDispatcher {
 
 }
 
-Texture.DEFAULT_IMAGE = undefined;
+Texture.DEFAULT_IMAGE = null;
 Texture.DEFAULT_MAPPING = UVMapping;
 
 Texture.prototype.isTexture = true;