浏览代码

Set DataTexture.needsUpdate = true if data are present at construction time

Avoids a lot of head-scratching.
Elias Hasle 5 年之前
父节点
当前提交
5ca1fd0b33
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      src/textures/DataTexture.js

+ 5 - 0
src/textures/DataTexture.js

@@ -18,6 +18,11 @@ function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT,
 	this.flipY = false;
 	this.unpackAlignment = 1;
 
+	if ( data ) {
+
+		this.needsUpdate = true;
+
+	}
 }
 
 DataTexture.prototype = Object.create( Texture.prototype );