Przeglądaj źródła

Throw error when texture coordinate set index >= 2

Gary Hsu 6 lat temu
rodzic
commit
b67855ab0e
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      loaders/src/glTF/2.0/glTFLoader.ts

+ 4 - 0
loaders/src/glTF/2.0/glTFLoader.ts

@@ -1812,6 +1812,10 @@ export class GLTFLoader implements IGLTFLoader {
 
         this.logOpen(`${context}`);
 
+        if (textureInfo.texCoord! >= 2) {
+            throw new Error(`${context}/texCoord: Invalid value (${textureInfo.texCoord})`);
+        }
+
         const texture = ArrayItem.Get(`${context}/index`, this._gltf.textures, textureInfo.index);
         const promise = this._loadTextureAsync(`/textures/${textureInfo.index}`, texture, (babylonTexture) => {
             babylonTexture.coordinatesIndex = textureInfo.texCoord || 0;