Browse Source

Merge pull request #17491 from EliasHasle/patch-17

DataTexture: needsUpdate true by default
Mr.doob 5 years ago
parent
commit
89e516bafc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/textures/DataTexture.js

+ 3 - 1
src/textures/DataTexture.js

@@ -9,7 +9,7 @@ function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT,
 
 	Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
 
-	this.image = { data: data, width: width, height: height };
+	this.image = { data: data || null, width: width || 1, height: height || 1 };
 
 	this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
 	this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
@@ -18,6 +18,8 @@ function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT,
 	this.flipY = false;
 	this.unpackAlignment = 1;
 
+	this.needsUpdate = true;
+
 }
 
 DataTexture.prototype = Object.create( Texture.prototype );