Browse Source

handle context restore

Trevor Baron 6 years ago
parent
commit
1aec037010
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Materials/Textures/Loaders/babylon.ktxTextureLoader.ts

+ 4 - 0
src/Materials/Textures/Loaders/babylon.ktxTextureLoader.ts

@@ -32,6 +32,10 @@ module BABYLON {
          */
         public transformUrl(rootUrl: string, textureFormatInUse: Nullable<string>): string {
             var lastDot = rootUrl.lastIndexOf('.');
+            if (lastDot != -1 && rootUrl.substring(lastDot + 1) == "ktx") {
+                // Already transformed
+                return rootUrl;
+            }
             return (lastDot > -1 ? rootUrl.substring(0, lastDot) : rootUrl) + textureFormatInUse;
         }