Pārlūkot izejas kodu

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 5 gadi atpakaļ
vecāks
revīzija
aa95f027de

+ 1 - 0
dist/preview release/what's new.md

@@ -271,6 +271,7 @@
 - Playground will now render the returned scene from createScene() when there are multiple scenes added to engine ([Kyle Belfort](https://github.com/belfortk))
 - Fixed bug so Playground will now download .env texture files to ./textures in .zip  ([Kyle Belfort](https://github.com/belfortk))
 - It was not possible to change the gaze and laser color in VR ([#7323](https://github.com/BabylonJS/Babylon.js/issues/7323)) ([RaananW](https://github.com/RaananW/))
+- Fixed issue where textures exported using Safari web browser are Y mirrored. ([#7352](https://github.com/BabylonJS/Babylon.js/issues/7352)) ([Drigax](https://github.com/drigax))
 
 ## Breaking changes
 

+ 2 - 2
serializers/src/glTF/2.0/glTFExporter.ts

@@ -327,7 +327,7 @@ export class _Exporter {
     }
 
     /**
-     * Lazy load a local engine with premultiplied alpha set to false
+     * Lazy load a local engine
      */
     public _getLocalEngine(): Engine {
         if (!this._localEngine) {
@@ -335,7 +335,7 @@ export class _Exporter {
             localCanvas.id = "WriteCanvas";
             localCanvas.width = 2048;
             localCanvas.height = 2048;
-            this._localEngine = new Engine(localCanvas, true, { premultipliedAlpha: false, preserveDrawingBuffer: true });
+            this._localEngine = new Engine(localCanvas, true, { premultipliedAlpha: Tools.IsSafari(), preserveDrawingBuffer: true });
             this._localEngine.setViewport(new Viewport(0, 0, 1, 1));
         }
 

+ 8 - 0
src/Misc/tools.ts

@@ -1098,6 +1098,14 @@ export class Tools {
             }, delay);
         });
     }
+
+    /**
+     * Utility function to detect if the current user agent is Safari
+     * @returns whether or not the current user agent is safari
+     */
+    public static IsSafari() : boolean {
+        return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
+    }
 }
 
 /**