Browse Source

Fix pg bug with debuglayer, fix delay load issue with prefiltered data

David Catuhe 5 năm trước cách đây
mục cha
commit
8e194f0fd9
2 tập tin đã thay đổi với 9 bổ sung2 xóa
  1. 1 1
      Playground/js/main.js
  2. 8 1
      src/Materials/Textures/cubeTexture.ts

+ 1 - 1
Playground/js/main.js

@@ -42,7 +42,7 @@ compileAndRun = function(parent, fpsLabel) {
         parent.menuPG.showBJSPGMenu();
         parent.monacoCreator.JsEditor.updateOptions({ readOnly: false });
 
-        if (BABYLON.Engine.LastCreatedScene && BABYLON.Engine.LastCreatedScene.debugLayer.isVisible()) {
+        if (BABYLON.Engine.LastCreatedScene && BABYLON.Engine.LastCreatedScene.debugLayer && BABYLON.Engine.LastCreatedScene.debugLayer.isVisible()) {
             showInspector = true;
         }
 

+ 8 - 1
src/Materials/Textures/cubeTexture.ts

@@ -124,7 +124,14 @@ export class CubeTexture extends BaseTexture {
      * @return the prefiltered texture
      */
     public static CreateFromPrefilteredData(url: string, scene: Scene, forcedExtension: any = null, createPolynomials: boolean = true) {
-        return new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);
+        const oldValue = scene.useDelayedTextureLoading;
+        scene.useDelayedTextureLoading = false;
+
+        const result = new CubeTexture(url, scene, null, false, null, null, null, undefined, true, forcedExtension, createPolynomials);
+        
+        scene.useDelayedTextureLoading = oldValue;
+
+        return result;
     }
 
     /**