소스 검색

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

Avoids a lot of head-scratching.
Elias Hasle 6 년 전
부모
커밋
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 );