Browse Source

Accept texture.source/sampler=0 in GLTF2Loader

Takahiro 8 years ago
parent
commit
ebbe091bc4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/js/loaders/GLTF2Loader.js

+ 2 - 2
examples/js/loaders/GLTF2Loader.js

@@ -1063,7 +1063,7 @@ THREE.GLTF2Loader = ( function () {
 
 
 			return _each( json.textures, function ( texture ) {
 			return _each( json.textures, function ( texture ) {
 
 
-				if ( texture.source ) {
+				if ( texture.source !== undefined ) {
 
 
 					return new Promise( function ( resolve ) {
 					return new Promise( function ( resolve ) {
 
 
@@ -1103,7 +1103,7 @@ THREE.GLTF2Loader = ( function () {
 
 
 							_texture.type = texture.type !== undefined ? WEBGL_TEXTURE_DATATYPES[ texture.type ] : THREE.UnsignedByteType;
 							_texture.type = texture.type !== undefined ? WEBGL_TEXTURE_DATATYPES[ texture.type ] : THREE.UnsignedByteType;
 
 
-							if ( texture.sampler ) {
+							if ( texture.sampler !== undefined ) {
 
 
 								var sampler = json.samplers[ texture.sampler ];
 								var sampler = json.samplers[ texture.sampler ];