Forráskód Böngészése

Update to latest libktx (#8497)

(custom built using gyp since new cmake build is broken)
Gary Hsu 5 éve
szülő
commit
6943da38ae

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
dist/preview release/libktx.js


BIN
dist/preview release/libktx.wasm


+ 3 - 5
sandbox/public/index-local.html

@@ -4,15 +4,13 @@
 <head>
     <title>Babylon.js Sandbox - View glTF, glb, obj and babylon files</title>
     <meta name="description" content="Viewer for glTF, glb, obj and babylon files powered by Babylon.js" />
-    <meta name="keywords"
-        content="Babylon.js, Babylon, BabylonJS, glTF, glb, obj, viewer, online viewer, 3D model viewer, 3D, webgl" />
+    <meta name="keywords" content="Babylon.js, Babylon, BabylonJS, glTF, glb, obj, viewer, online viewer, 3D model viewer, 3D, webgl" />
     <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
     <link rel="stylesheet" href="https://use.typekit.net/cta4xsb.css">
     <link rel="shortcut icon" href="https://www.babylonjs.com/favicon.ico">
     <script src="https://code.jquery.com/pep/0.4.2/pep.min.js"></script>
-
+    <script src="../../dist/preview%20release/libktx.js"></script>
     <script src="../../Tools/DevLoader/BabylonLoader.js"></script>
-    
     <style>
         html,
         body {
@@ -25,7 +23,7 @@
 
         #host-element {
             width: 100%;
-            height: 100%;            
+            height: 100%;
         }
     </style>
 </head>

+ 2 - 2
src/Misc/khronosTextureContainer2.ts

@@ -16,7 +16,7 @@ export class KhronosTextureContainer2 {
     public constructor(engine: ThinEngine) {
         if (!KhronosTextureContainer2._ModulePromise) {
             KhronosTextureContainer2._ModulePromise = new Promise((resolve) => {
-                LIBKTX().then((module: any) => {
+                LIBKTX({preinitializedWebGLContext: engine._gl}).then((module: any) => {
                     module.GL.makeContextCurrent(module.GL.registerContext(engine._gl, { majorVersion: engine._webGLVersion }));
                     KhronosTextureContainer2._TranscodeFormat = this._determineTranscodeFormat(module.TranscodeTarget, engine.getCaps());
                     resolve({ module: module });
@@ -31,7 +31,7 @@ export class KhronosTextureContainer2 {
 
             const ktxTexture = new module.ktxTexture(data);
             try {
-                if (ktxTexture.isBasisSupercompressed) {
+                if (ktxTexture.needsTranscoding) {
                     ktxTexture.transcodeBasis(KhronosTextureContainer2._TranscodeFormat, 0);
                 }