瀏覽代碼

Merge pull request #2485 from sebavan/DDS

Safari
David Catuhe 8 年之前
父節點
當前提交
bda7e8bbd1
共有 2 個文件被更改,包括 13 次插入3 次删除
  1. 1 1
      src/Tools/babylon.dds.ts
  2. 12 2
      src/babylon.engine.ts

+ 1 - 1
src/Tools/babylon.dds.ts

@@ -476,7 +476,7 @@
                             else {
                                 if (bpp === 128) {
                                     floatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
-                                } else if (bpp === 64 && !engine.getCaps().textureHalfFloat) { // Let's fallback to full float
+                                } else if (bpp === 64 && (!engine.getCaps().textureHalfFloat || engine.badDesktopOS)) { // Let's fallback to full float if not half float or false report of it...
                                     floatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
 
                                     info.textureType = Engine.TEXTURETYPE_FLOAT;

+ 12 - 2
src/babylon.engine.ts

@@ -507,6 +507,11 @@
             return this._badOS;
         }
 
+        private _badDesktopOS = false;
+        public get badDesktopOS(): boolean {
+            return this._badDesktopOS;
+        }
+
         public static audioEngine: AudioEngine;
 
         private _onCanvasBlur: () => void;
@@ -866,9 +871,14 @@
             }
 
             //Detect if we are running on a faulty buggy OS.
-            var regexp = /AppleWebKit.*10.[\d] Mobile/
+            var regexpBadOs = /AppleWebKit.*10.[\d] Mobile/
+            //ua sniffing is the tool of the devil.
+            this._badOS = regexpBadOs.test(navigator.userAgent);
+
+            //Detect if we are running on a faulty buggy OS.
+            var regexpBadDesktopOS = /AppleWebKit.*10.[\d] /
             //ua sniffing is the tool of the devil.
-            this._badOS = regexp.test(navigator.userAgent);
+            this._badDesktopOS = regexpBadDesktopOS.test(navigator.userAgent);
 
             Tools.Log("Babylon.js engine (v" + Engine.Version + ") launched");
         }