Browse Source

Merge pull request #17578 from gero3/AddDefaultsToTextures

Texture: Add defaults to textures.
Michael Herzog 5 years ago
parent
commit
8bbea979ad
2 changed files with 2 additions and 2 deletions
  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 );
 
-	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.minFilter = NearestFilter;

+ 1 - 1
src/textures/DataTexture3D.js

@@ -17,7 +17,7 @@ function DataTexture3D( data, width, height, depth ) {
 
 	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.minFilter = NearestFilter;