浏览代码

Merge pull request #17578 from gero3/AddDefaultsToTextures

Texture: Add defaults to textures.
Michael Herzog 5 年之前
父节点
当前提交
8bbea979ad
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/textures/DataTexture2DArray.js
  2. 1 1
      src/textures/DataTexture3D.js

+ 1 - 1
src/textures/DataTexture2DArray.js

@@ -9,7 +9,7 @@ function DataTexture2DArray( data, width, height, depth ) {
 
 
 	Texture.call( this, null );
 	Texture.call( this, null );
 
 
-	this.image = { data: data, width: width, height: height, depth: depth };
+	this.image = { data: data || null, width: width || 1, height: height || 1, depth: depth || 1 };
 
 
 	this.magFilter = NearestFilter;
 	this.magFilter = NearestFilter;
 	this.minFilter = NearestFilter;
 	this.minFilter = NearestFilter;

+ 1 - 1
src/textures/DataTexture3D.js

@@ -17,7 +17,7 @@ function DataTexture3D( data, width, height, depth ) {
 
 
 	Texture.call( this, null );
 	Texture.call( this, null );
 
 
-	this.image = { data: data, width: width, height: height, depth: depth };
+	this.image = { data: data || null, width: width || 1, height: height || 1, depth: depth || 1 };
 
 
 	this.magFilter = NearestFilter;
 	this.magFilter = NearestFilter;
 	this.minFilter = NearestFilter;
 	this.minFilter = NearestFilter;