Browse Source

Merge upstream master

Borut 7 năm trước cách đây
mục cha
commit
1f56710cbb
65 tập tin đã thay đổi với 12950 bổ sung12656 xóa
  1. 3903 3890
      Playground/babylon.d.txt
  2. 12 0
      Playground/debug.html
  3. 12 0
      Playground/index-local.html
  4. 408 396
      Playground/index.html
  5. 12 3
      Playground/indexStable.html
  6. 17 2
      Playground/js/index.js
  7. 40 0
      Playground/js/pbt.js
  8. 1 0
      Playground/scenes/candle.babylon
  9. 2 1
      Tools/Gulp/gulpfile.js
  10. 41 41
      Tools/Gulp/package.json
  11. 5771 5778
      dist/preview release/babylon.d.ts
  12. 45 45
      dist/preview release/babylon.js
  13. 217 136
      dist/preview release/babylon.max.js
  14. 48 48
      dist/preview release/babylon.worker.js
  15. 1423 1430
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  16. 42 42
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  17. 176 128
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  18. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  19. 1 5
      dist/preview release/inspector/babylon.inspector.d.ts
  20. 50 44
      dist/preview release/inspector/babylon.inspector.js
  21. 4 4
      dist/preview release/inspector/babylon.inspector.min.js
  22. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  23. 1 1
      dist/preview release/loaders/babylonjs.loaders.min.js
  24. 1 1
      dist/preview release/materialsLibrary/babylon.skyMaterial.js
  25. 1 1
      dist/preview release/materialsLibrary/babylon.skyMaterial.min.js
  26. 1 1
      dist/preview release/materialsLibrary/babylonjs.materials.js
  27. 1 1
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  28. 3 0
      inspector/src/Inspector.ts
  29. 5 5
      inspector/src/helpers/Helpers.ts
  30. 3 5
      inspector/src/scheduler/Scheduler.ts
  31. 6 2
      inspector/src/tabs/SceneTab.ts
  32. 189 189
      inspector/src/tabs/StatsTab.ts
  33. 2 4
      inspector/src/treetools/Info.ts
  34. 0 2
      inspector/src/treetools/SoundInteractions.ts
  35. 2 2
      loaders/src/glTF/1.0/babylon.glTFLoader.ts
  36. 1 1
      loaders/src/glTF/2.0/babylon.glTFLoader.ts
  37. 2 2
      materialsLibrary/src/sky/sky.fragment.fx
  38. 13 0
      package-lock.json
  39. 1 1
      package.json
  40. 4 6
      src/Audio/babylon.sound.ts
  41. 1 6
      src/Cameras/Inputs/babylon.arcRotateCameraVRDeviceOrientationInput.ts
  42. 2 3
      src/Cameras/Inputs/babylon.freeCameraTouchInput.ts
  43. 32 25
      src/Cameras/VR/babylon.vrExperienceHelper.ts
  44. 2 5
      src/Collisions/babylon.collisionCoordinator.ts
  45. 122 58
      src/Engine/babylon.engine.ts
  46. 10 8
      src/Materials/Textures/babylon.cubeTexture.ts
  47. 8 10
      src/Materials/Textures/babylon.multiRenderTarget.ts
  48. 8 4
      src/Materials/Textures/babylon.texture.ts
  49. 24 26
      src/Materials/babylon.effect.ts
  50. 22 2
      src/Materials/babylon.imageProcessingConfiguration.ts
  51. 3 1
      src/Materials/babylon.standardMaterial.ts
  52. 1 1
      src/Mesh/babylon.geometry.ts
  53. 35 38
      src/Mesh/babylon.meshSimplification.ts
  54. 28 35
      src/PostProcess/RenderPipeline/Pipelines/babylon.ssao2RenderingPipeline.ts
  55. 11 18
      src/PostProcess/RenderPipeline/Pipelines/babylon.ssaoRenderingPipeline.ts
  56. 2 5
      src/PostProcess/RenderPipeline/babylon.postProcessRenderEffect.ts
  57. 1 1
      src/PostProcess/babylon.passPostProcess.ts
  58. 2 1
      src/PostProcess/babylon.postProcess.ts
  59. 12 16
      src/Rendering/babylon.renderingManager.ts
  60. 2 2
      src/Tools/babylon.assetsManager.ts
  61. 22 17
      src/Tools/babylon.dds.ts
  62. 111 114
      src/Tools/babylon.performanceMonitor.ts
  63. 3 4
      src/Tools/babylon.tga.ts
  64. 14 14
      src/Tools/babylon.tools.ts
  65. 6 20
      src/Tools/babylon.virtualJoystick.ts

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3903 - 3890
Playground/babylon.d.txt


+ 12 - 0
Playground/debug.html

@@ -129,6 +129,9 @@
                     <div class="option" id="fullscreenButton1600">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1600">Editor Fullscreen</div>
                     <div class="option" id="formatButton1600">Format code</div>
+                    <div class="option" id="minimapToggle1600">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                 </div>
             </div>
 
@@ -205,6 +208,9 @@
                     <div class="option" id="fullscreenButton1475">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1475">Editor Fullscreen</div>
                     <div class="option" id="formatButton1475">Format code</div>
+                    <div class="option" id="minimapToggle1475">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton1475">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton1475">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion1475">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
@@ -271,6 +277,9 @@
                     <div class="option" id="fullscreenButton1030">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1030">Editor Fullscreen</div>
                     <div class="option" id="formatButton1030">Format code</div>
+                    <div class="option" id="minimapToggle1030">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton1030">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton1030">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion1030">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
@@ -334,6 +343,9 @@
                     <div class="option" id="fullscreenButton750">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton750">Editor Fullscreen</div>
                     <div class="option" id="formatButton750">Format code</div>
+                    <div class="option" id="minimapToggle750">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton750">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton750">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion750">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>

+ 12 - 0
Playground/index-local.html

@@ -71,6 +71,9 @@
                     <div class="option" id="fullscreenButton1600">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1600">Editor Fullscreen</div>
                     <div class="option" id="formatButton1600">Format code</div>
+                    <div class="option" id="minimapToggle1600">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                 </div>
             </div>
 
@@ -146,6 +149,9 @@
                     <div class="option" id="fullscreenButton1475">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1475">Editor Fullscreen</div>
                     <div class="option" id="formatButton1475">Format code</div>
+                    <div class="option" id="minimapToggle1475">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton1475">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton1475">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion1475">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
@@ -212,6 +218,9 @@
                     <div class="option" id="fullscreenButton1030">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1030">Editor Fullscreen</div>
                     <div class="option" id="formatButton1030">Format code</div>
+                    <div class="option" id="minimapToggle1030">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton1030">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton1030">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion1030">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
@@ -275,6 +284,9 @@
                     <div class="option" id="fullscreenButton750">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton750">Editor Fullscreen</div>
                     <div class="option" id="formatButton750">Format code</div>
+                    <div class="option" id="minimapToggle750">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton750">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton750">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion750">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>

+ 408 - 396
Playground/index.html

@@ -1,487 +1,499 @@
 <!DOCTYPE html>
 <html>
 
-    <head>
-        <title>Babylon.js Playground</title>
-        <meta charset='utf-8' />
-        <meta name="viewport" content="width=device-width, user-scalable=no">
-        <link rel="shortcut icon" href="https://www.babylonjs.com/img/favicon/favicon.ico">
-        <link rel="apple-touch-icon" sizes="57x57" href="https://www.babylonjs.com/img/favicon/apple-icon-57x57.png">
-        <link rel="apple-touch-icon" sizes="60x60" href="https://www.babylonjs.com/img/favicon/apple-icon-60x60.png">
-        <link rel="apple-touch-icon" sizes="72x72" href="https://www.babylonjs.com/img/favicon/apple-icon-72x72.png">
-        <link rel="apple-touch-icon" sizes="76x76" href="https://www.babylonjs.com/img/favicon/apple-icon-76x76.png">
-        <link rel="apple-touch-icon" sizes="114x114" href="https://www.babylonjs.com/img/favicon/apple-icon-114x114.png">
-        <link rel="apple-touch-icon" sizes="120x120" href="https://www.babylonjs.com/img/favicon/apple-icon-120x120.png">
-        <link rel="apple-touch-icon" sizes="144x144" href="https://www.babylonjs.com/img/favicon/apple-icon-144x144.png">
-        <link rel="apple-touch-icon" sizes="152x152" href="https://www.babylonjs.com/img/favicon/apple-icon-152x152.png">
-        <link rel="apple-touch-icon" sizes="180x180" href="https://www.babylonjs.com/img/favicon/apple-icon-180x180.png">
-        <link rel="icon" type="image/png" sizes="192x192" href="https://www.babylonjs.com/img/favicon/android-icon-192x192.png">
-        <link rel="icon" type="image/png" sizes="32x32" href="https://www.babylonjs.com/img/favicon/favicon-32x32.png">
-        <link rel="icon" type="image/png" sizes="96x96" href="https://www.babylonjs.com/img/favicon/favicon-96x96.png">
-        <link rel="icon" type="image/png" sizes="16x16" href="https://www.babylonjs.com/img/favicon/favicon-16x16.png">
-        <link rel="manifest" href="https://www.babylonjs.com/img/favicon/manifest.json">
-        <meta name="msapplication-TileColor" content="#ffffff">
-        <meta name="msapplication-TileImage" content="https://www.babylonjs.com/img/favicon/ms-icon-144x144.png">
-        <meta name="msapplication-config" content="https://www.babylonjs.com/img/favicon/browserconfig.xml">
-        <meta name="theme-color" content="#ffffff">
-
-        <script src="https://code.jquery.com/pep/0.4.2/pep.min.js"></script>
-        <!--For canvas/code separator-->
-        <script src="js/libs/split.js"></script>
-
-        <script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.2/dat.gui.min.js"></script>
-        <!-- jszip -->
-        <script src="js/libs/jszip.min.js"></script>
-        <script src="js/libs/fileSaver.js"></script>
-        <!--Monaco-->
-        <script src="node_modules/monaco-editor/min/vs/loader.js"></script>
-        <!-- Babylon.js -->
-        <script src="https://preview.babylonjs.com/cannon.js"></script>
-        <script src="https://preview.babylonjs.com/Oimo.js"></script>
-        <script src="https://preview.babylonjs.com/babylon.js"></script>
-        <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
-
-        <script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
-
-        <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
-
-        <script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
-
-        <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.js"></script>
-
-        <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
-
-        <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js"></script>
-        <script src="https://rawgit.com/BabylonJS/Extensions/master/canvas2D/dist/preview%20release/babylon.canvas2d.min.js"></script>
-        <script src="https://rawgit.com/BabylonJS/Extensions/master/CompoundShader/src/babylonx.CompoundShader.js"></script>
-        <link href="css/index.css" rel="stylesheet" />
-    </head>
-
-    <body>
-        <div class="navbar navBar1600">
-            <div class="title">
-                Babylon.js Playground
-            </div>
-            <div class="version" id="mainTitle">
-            </div>
-
-            <div class="category">
-                <div class="button run" id="runButton1600">Run
-                    <i class="fa fa-play" aria-hidden="true"></i>
-                </div>
+<head>
+    <title>Babylon.js Playground</title>
+    <meta charset='utf-8' />
+    <meta name="viewport" content="width=device-width, user-scalable=no">
+    <link rel="shortcut icon" href="https://www.babylonjs.com/img/favicon/favicon.ico">
+    <link rel="apple-touch-icon" sizes="57x57" href="https://www.babylonjs.com/img/favicon/apple-icon-57x57.png">
+    <link rel="apple-touch-icon" sizes="60x60" href="https://www.babylonjs.com/img/favicon/apple-icon-60x60.png">
+    <link rel="apple-touch-icon" sizes="72x72" href="https://www.babylonjs.com/img/favicon/apple-icon-72x72.png">
+    <link rel="apple-touch-icon" sizes="76x76" href="https://www.babylonjs.com/img/favicon/apple-icon-76x76.png">
+    <link rel="apple-touch-icon" sizes="114x114" href="https://www.babylonjs.com/img/favicon/apple-icon-114x114.png">
+    <link rel="apple-touch-icon" sizes="120x120" href="https://www.babylonjs.com/img/favicon/apple-icon-120x120.png">
+    <link rel="apple-touch-icon" sizes="144x144" href="https://www.babylonjs.com/img/favicon/apple-icon-144x144.png">
+    <link rel="apple-touch-icon" sizes="152x152" href="https://www.babylonjs.com/img/favicon/apple-icon-152x152.png">
+    <link rel="apple-touch-icon" sizes="180x180" href="https://www.babylonjs.com/img/favicon/apple-icon-180x180.png">
+    <link rel="icon" type="image/png" sizes="192x192" href="https://www.babylonjs.com/img/favicon/android-icon-192x192.png">
+    <link rel="icon" type="image/png" sizes="32x32" href="https://www.babylonjs.com/img/favicon/favicon-32x32.png">
+    <link rel="icon" type="image/png" sizes="96x96" href="https://www.babylonjs.com/img/favicon/favicon-96x96.png">
+    <link rel="icon" type="image/png" sizes="16x16" href="https://www.babylonjs.com/img/favicon/favicon-16x16.png">
+    <link rel="manifest" href="https://www.babylonjs.com/img/favicon/manifest.json">
+    <meta name="msapplication-TileColor" content="#ffffff">
+    <meta name="msapplication-TileImage" content="https://www.babylonjs.com/img/favicon/ms-icon-144x144.png">
+    <meta name="msapplication-config" content="https://www.babylonjs.com/img/favicon/browserconfig.xml">
+    <meta name="theme-color" content="#ffffff">
+
+    <script src="https://code.jquery.com/pep/0.4.2/pep.min.js"></script>
+    <!--For canvas/code separator-->
+    <script src="js/libs/split.js"></script>
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.2/dat.gui.min.js"></script>
+    <!-- jszip -->
+    <script src="js/libs/jszip.min.js"></script>
+    <script src="js/libs/fileSaver.js"></script>
+    <!--Monaco-->
+    <script src="node_modules/monaco-editor/min/vs/loader.js"></script>
+    <!-- Babylon.js -->
+    <script src="https://preview.babylonjs.com/cannon.js"></script>
+    <script src="https://preview.babylonjs.com/Oimo.js"></script>
+    <script src="https://preview.babylonjs.com/babylon.js"></script>
+    <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
+
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
+
+    <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.js"></script>
+
+    <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
+
+    <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js"></script>
+    <script src="https://rawgit.com/BabylonJS/Extensions/master/canvas2D/dist/preview%20release/babylon.canvas2d.min.js"></script>
+    <script src="https://rawgit.com/BabylonJS/Extensions/master/CompoundShader/src/babylonx.CompoundShader.js"></script>
+    <link href="css/index.css" rel="stylesheet" />
+</head>
+
+<body>
+    <div class="navbar navBar1600">
+        <div class="title">
+            Babylon.js Playground
+        </div>
+        <div class="version" id="mainTitle">
+        </div>
+
+        <div class="category">
+            <div class="button run" id="runButton1600">Run
+                <i class="fa fa-play" aria-hidden="true"></i>
             </div>
+        </div>
 
 
-            <div class="category">
-                <div class="button" id="newButton1600">New
-                    <i class="fa fa-file" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="clearButton1600">Clear
-                    <i class="fa fa-trash" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="newButton1600">New
+                <i class="fa fa-file" aria-hidden="true"></i>
+            </div>
+            <div class="button removeOnPhone" id="clearButton1600">Clear
+                <i class="fa fa-trash" aria-hidden="true"></i>
             </div>
+        </div>
 
-            <div class="category">
-                <div class="button" id="saveButton1600">Save
-                    <i class="fa fa-floppy-o" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="zipButton1600">Zip
-                    <i class="fa fa-download" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="saveButton1600">Save
+                <i class="fa fa-floppy-o" aria-hidden="true"></i>
+            </div>
+            <div class="button removeOnPhone" id="zipButton1600">Zip
+                <i class="fa fa-download" aria-hidden="true"></i>
             </div>
+        </div>
 
-            <div class="category">
-                <div class="button select">Settings
-                    <div class="toDisplay">
-                        <div class="option subSelect">Theme
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" id="darkTheme1600">Dark</div>
-                                <div class="option" id="lightTheme1600">Light</div>
-                            </div>
-                        </div>
-                        <div class="option subSelect">
-                            <span id="currentFontSize1600">Font: 14</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setFontSize(12);">12</div>
-                                <div class="option" onclick="setFontSize(14);">14</div>
-                                <div class="option" onclick="setFontSize(16);">16</div>
-                                <div class="option" onclick="setFontSize(18);">18</div>
-                                <div class="option" onclick="setFontSize(20);">20</div>
-                                <div class="option" onclick="setFontSize(22);">22</div>
-                            </div>
-                        </div>
-                        <div class="option" id="safemodeToggle1600">Safe mode
-                            <i class="fa fa-square-o" aria-hidden="true"></i>
+        <div class="category">
+            <div class="button select">Settings
+                <div class="toDisplay">
+                    <div class="option subSelect">Theme
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme1600">Dark</div>
+                            <div class="option" id="lightTheme1600">Light</div>
                         </div>
-                        <div class="option checked" id="editorButton1600">Editor
-                            <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option subSelect">
+                        <span id="currentFontSize1600">Font: 14</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
                         </div>
-                        <div class="option" id="fullscreenButton1600">Fullscreen</div>
-                        <div class="option" id="editorFullscreenButton1600">Editor Fullscreen</div>
-                        <div class="option" id="formatButton1600">Format code</div>
+                    </div>
+                    <div class="option" id="safemodeToggle1600">Safe mode
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option checked" id="editorButton1600">Editor
+                        <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="fullscreenButton1600">Fullscreen</div>
+                    <div class="option" id="editorFullscreenButton1600">Editor Fullscreen</div>
+                    <div class="option" id="formatButton1600">Format code</div>
+                    <div class="option" id="minimapToggle1600">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
                     </div>
                 </div>
+            </div>
 
-                <div class="button uncheck" id="debugButton1600">Debug layer
-                    <i class="fa fa-square-o" aria-hidden="true"></i>
-                </div>
-                <div class="button" id="metadataButton1600">Metadata</div>
+            <div class="button uncheck" id="debugButton1600">Debug layer
+                <i class="fa fa-square-o" aria-hidden="true"></i>
             </div>
+            <div class="button" id="metadataButton1600">Metadata</div>
+        </div>
 
 
 
-            <div class="category right">
-                <div class="button select">
-                    <span id="currentVersion1600">Version: Latest</span>
-                    <div class="toDisplay">
-                        <div class="option" onclick="setVersion('latest');">Latest</div>
-                        <div class="option" onclick="setVersion('stable');">Stable</div>
-                    </div>
-                </div>
-                <div class="button select">
-                    <span id="currentScript1600">Scenes</span>
-                    <div class="toDisplayBig">
-                        <ul id="scriptsList1600">
-                        </ul>
-                    </div>
+        <div class="category right">
+            <div class="button select">
+                <span id="currentVersion1600">Version: Latest</span>
+                <div class="toDisplay">
+                    <div class="option" onclick="setVersion('latest');">Latest</div>
+                    <div class="option" onclick="setVersion('stable');">Stable</div>
                 </div>
             </div>
-            <div class="save-message" id="saveMessage">
-                This PG has missing metadata. Click save to add them.
+            <div class="button select">
+                <span id="currentScript1600">Scenes</span>
+                <div class="toDisplayBig">
+                    <ul id="scriptsList1600">
+                    </ul>
+                </div>
             </div>
         </div>
+        <div class="save-message" id="saveMessage">
+            This PG has missing metadata. Click save to add them.
+        </div>
+    </div>
 
-        <div class="navbar navBar1475">
-            <div class="title">
-                Babylon.js Playground
-            </div>
-            <div class="version" id="mainTitle">
-            </div>
+    <div class="navbar navBar1475">
+        <div class="title">
+            Babylon.js Playground
+        </div>
+        <div class="version" id="mainTitle">
+        </div>
 
-            <div class="category">
-                <div class="button run" id="runButton1475">Run
-                    <i class="fa fa-play" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button run" id="runButton1475">Run
+                <i class="fa fa-play" aria-hidden="true"></i>
             </div>
+        </div>
 
 
-            <div class="category">
-                <div class="button" id="newButton1475">New
-                    <i class="fa fa-file" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="clearButton1475">Clear
-                    <i class="fa fa-trash" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="newButton1475">New
+                <i class="fa fa-file" aria-hidden="true"></i>
             </div>
+            <div class="button removeOnPhone" id="clearButton1475">Clear
+                <i class="fa fa-trash" aria-hidden="true"></i>
+            </div>
+        </div>
 
-            <div class="category">
-                <div class="button" id="saveButton1475">Save
-                    <i class="fa fa-floppy-o" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="zipButton1475">Zip
-                    <i class="fa fa-download" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="saveButton1475">Save
+                <i class="fa fa-floppy-o" aria-hidden="true"></i>
             </div>
+            <div class="button removeOnPhone" id="zipButton1475">Zip
+                <i class="fa fa-download" aria-hidden="true"></i>
+            </div>
+        </div>
 
-            <div class="category">
-                <div class="button select">Settings
-                    <div class="toDisplay">
-                        <div class="option subSelect">Theme
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" id="darkTheme1475">Dark</div>
-                                <div class="option" id="lightTheme1475">Light</div>
-                            </div>
-                        </div>
-                        <div class="option subSelect">
-                            <span id="currentFontSize1475">Font: 14</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setFontSize(12);">12</div>
-                                <div class="option" onclick="setFontSize(14);">14</div>
-                                <div class="option" onclick="setFontSize(16);">16</div>
-                                <div class="option" onclick="setFontSize(18);">18</div>
-                                <div class="option" onclick="setFontSize(20);">20</div>
-                                <div class="option" onclick="setFontSize(22);">22</div>
-                            </div>
-                        </div>
-                        <div class="option" id='safemodeToggle1475'>Safe mode
-                            <i class="fa fa-square-o" aria-hidden="true"></i>
-                        </div>
-                        <div class="option checked" id="editorButton1475">Editor
-                            <i class="fa fa-check-square" aria-hidden="true"></i>
+        <div class="category">
+            <div class="button select">Settings
+                <div class="toDisplay">
+                    <div class="option subSelect">Theme
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme1475">Dark</div>
+                            <div class="option" id="lightTheme1475">Light</div>
                         </div>
-                        <div class="option" id="fullscreenButton1475">Fullscreen</div>
-                        <div class="option" id="editorFullscreenButton1475">Editor Fullscreen</div>
-                        <div class="option" id="formatButton1475">Format code</div>
-                        <div class="option" id="debugButton1475">Debug layer
-                            <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option subSelect">
+                        <span id="currentFontSize1475">Font: 14</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
                         </div>
-                        <div class="option" id="metadataButton1475">Metadata</div>
-                        <div class="option subSelect">
-                            <span id="currentVersion1475">Vers. : Latest</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setVersion('latest');">Latest</div>
-                                <div class="option" onclick="setVersion('stable');">Stable</div>
-                            </div>
+                    </div>
+                    <div class="option" id='safemodeToggle1475'>Safe mode
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option checked" id="editorButton1475">Editor
+                        <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="fullscreenButton1475">Fullscreen</div>
+                    <div class="option" id="editorFullscreenButton1475">Editor Fullscreen</div>
+                    <div class="option" id="formatButton1475">Format code</div>
+                    <div class="option" id="minimapToggle1475">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="debugButton1475">Debug layer
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="metadataButton1475">Metadata</div>
+                    <div class="option subSelect">
+                        <span id="currentVersion1475">Vers. : Latest</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setVersion('latest');">Latest</div>
+                            <div class="option" onclick="setVersion('stable');">Stable</div>
                         </div>
                     </div>
                 </div>
             </div>
+        </div>
 
-            <div class="category right">
-                <div class="button select">
-                    <span id="currentScript1475">Scenes</span>
-                    <div class="toDisplayBig">
-                        <ul id="scriptsList1475">
-                        </ul>
-                    </div>
+        <div class="category right">
+            <div class="button select">
+                <span id="currentScript1475">Scenes</span>
+                <div class="toDisplayBig">
+                    <ul id="scriptsList1475">
+                    </ul>
                 </div>
             </div>
-            <div class="save-message" id="saveMessage">
-                This PG has missing metadata. Click save to add them.
-            </div>
         </div>
+        <div class="save-message" id="saveMessage">
+            This PG has missing metadata. Click save to add them.
+        </div>
+    </div>
 
-        <div class="navbar navBar1030">
-            <div class="category">
-                <div class="button run" id="runButton1030">Run
-                    <i class="fa fa-play" aria-hidden="true"></i>
-                </div>
+    <div class="navbar navBar1030">
+        <div class="category">
+            <div class="button run" id="runButton1030">Run
+                <i class="fa fa-play" aria-hidden="true"></i>
             </div>
+        </div>
 
 
-            <div class="category">
-                <div class="button" id="newButton1030">New
-                    <i class="fa fa-file" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="clearButton1030">Clear
-                    <i class="fa fa-trash" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="newButton1030">New
+                <i class="fa fa-file" aria-hidden="true"></i>
             </div>
+            <div class="button removeOnPhone" id="clearButton1030">Clear
+                <i class="fa fa-trash" aria-hidden="true"></i>
+            </div>
+        </div>
 
-            <div class="category">
-                <div class="button" id="saveButton1030">Save
-                    <i class="fa fa-floppy-o" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="zipButton1030">Zip
-                    <i class="fa fa-download" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="saveButton1030">Save
+                <i class="fa fa-floppy-o" aria-hidden="true"></i>
             </div>
+            <div class="button removeOnPhone" id="zipButton1030">Zip
+                <i class="fa fa-download" aria-hidden="true"></i>
+            </div>
+        </div>
 
-            <div class="category">
-                <div class="button select">Settings
-                    <div class="toDisplay">
-                        <div class="option subSelect">Theme
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" id="darkTheme1030">Dark</div>
-                                <div class="option" id="lightTheme1030">Light</div>
-                            </div>
-                        </div>
-                        <div class="option subSelect">
-                            <span id="currentFontSize1030">Font: 14</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setFontSize(12);">12</div>
-                                <div class="option" onclick="setFontSize(14);">14</div>
-                                <div class="option" onclick="setFontSize(16);">16</div>
-                                <div class="option" onclick="setFontSize(18);">18</div>
-                                <div class="option" onclick="setFontSize(20);">20</div>
-                                <div class="option" onclick="setFontSize(22);">22</div>
-                            </div>
-                        </div>
-                        <div class="option" id="safemodeToggle1030">Safe mode
-                            <i class="fa fa-square-o" aria-hidden="true"></i>
+        <div class="category">
+            <div class="button select">Settings
+                <div class="toDisplay">
+                    <div class="option subSelect">Theme
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme1030">Dark</div>
+                            <div class="option" id="lightTheme1030">Light</div>
                         </div>
-                        <div class="option checked" id="editorButton1030">Editor
-                            <i class="fa fa-check-square" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="fullscreenButton1030">Fullscreen</div>
-                        <div class="option" id="editorFullscreenButton1030">Editor Fullscreen</div>
-                        <div class="option" id="formatButton1030">Format code</div>
-                        <div class="option" id="debugButton1030">Debug layer
-                            <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option subSelect">
+                        <span id="currentFontSize1030">Font: 14</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
                         </div>
-                        <div class="option" id="metadataButton1030">Metadata</div>
-                        <div class="option subSelect">
-                            <span id="currentVersion1030">Vers. : Latest</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setVersion('latest');">Latest</div>
-                                <div class="option" onclick="setVersion('stable');">Stable</div>
-                            </div>
+                    </div>
+                    <div class="option" id="safemodeToggle1030">Safe mode
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option checked" id="editorButton1030">Editor
+                        <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="fullscreenButton1030">Fullscreen</div>
+                    <div class="option" id="editorFullscreenButton1030">Editor Fullscreen</div>
+                    <div class="option" id="formatButton1030">Format code</div>
+                    <div class="option" id="minimapToggle1030">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="debugButton1030">Debug layer
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="metadataButton1030">Metadata</div>
+                    <div class="option subSelect">
+                        <span id="currentVersion1030">Vers. : Latest</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setVersion('latest');">Latest</div>
+                            <div class="option" onclick="setVersion('stable');">Stable</div>
                         </div>
                     </div>
                 </div>
             </div>
+        </div>
 
-            <div class="category right">
-                <div class="button select">
-                    <span id="currentScript1030">Scenes</span>
-                    <div class="toDisplayBig">
-                        <ul id="scriptsList1030">
-                        </ul>
-                    </div>
+        <div class="category right">
+            <div class="button select">
+                <span id="currentScript1030">Scenes</span>
+                <div class="toDisplayBig">
+                    <ul id="scriptsList1030">
+                    </ul>
                 </div>
             </div>
-            <div class="save-message" id="saveMessage">
-                This PG has missing metadata. Click save to add them.
-            </div>
         </div>
-
-        <div class="navbar navBar750">
-            <div class="category">
-                <div class="button select">File
-                    <div class="toDisplay">
-                        <div class="option" id="runButton750">Run
-                            <i class="fa fa-play" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="newButton750">New
-                            <i class="fa fa-file" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="clearButton750">Clear
-                            <i class="fa fa-trash" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="saveButton750">Save
-                            <i class="fa fa-floppy-o" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="zipButton750">Zip
-                            <i class="fa fa-download" aria-hidden="true"></i>
-                        </div>
+        <div class="save-message" id="saveMessage">
+            This PG has missing metadata. Click save to add them.
+        </div>
+    </div>
+
+    <div class="navbar navBar750">
+        <div class="category">
+            <div class="button select">File
+                <div class="toDisplay">
+                    <div class="option" id="runButton750">Run
+                        <i class="fa fa-play" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="newButton750">New
+                        <i class="fa fa-file" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="clearButton750">Clear
+                        <i class="fa fa-trash" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="saveButton750">Save
+                        <i class="fa fa-floppy-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="zipButton750">Zip
+                        <i class="fa fa-download" aria-hidden="true"></i>
                     </div>
                 </div>
             </div>
+        </div>
 
-            <div class="category">
-                <div class="button select">Settings
-                    <div class="toDisplay">
-                        <div class="option subSelect">Theme
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" id="darkTheme750">Dark</div>
-                                <div class="option" id="lightTheme750">Light</div>
-                            </div>
-                        </div>
-                        <div class="option subSelect">
-                            <span id="currentFontSize750">Font: 14</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setFontSize(12);">12</div>
-                                <div class="option" onclick="setFontSize(14);">14</div>
-                                <div class="option" onclick="setFontSize(16);">16</div>
-                                <div class="option" onclick="setFontSize(18);">18</div>
-                                <div class="option" onclick="setFontSize(20);">20</div>
-                                <div class="option" onclick="setFontSize(22);">22</div>
-                            </div>
-                        </div>
-                        <div class="option" id="safemodeToggle750">Safe mode
-                            <i class="fa fa-square-o" aria-hidden="true"></i>
-                        </div>
-                        <div style="display:none;" class="option checked" id="editorButton750">Editor
-                            <i class="fa fa-check-square" aria-hidden="true"></i>
+        <div class="category">
+            <div class="button select">Settings
+                <div class="toDisplay">
+                    <div class="option subSelect">Theme
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme750">Dark</div>
+                            <div class="option" id="lightTheme750">Light</div>
                         </div>
-                        <div class="option" id="fullscreenButton750">Fullscreen</div>
-                        <div class="option" id="editorFullscreenButton750">Editor Fullscreen</div>
-                        <div class="option" id="formatButton750">Format code</div>
-                        <div class="option" id="debugButton750">Debug layer
-                            <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option subSelect">
+                        <span id="currentFontSize750">Font: 14</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
                         </div>
-                        <div class="option" id="metadataButton750">Metadata</div>
-                        <div class="option subSelect">
-                            <span id="currentVersion750">Vers. : Latest</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setVersion('latest');">Latest</div>
-                                <div class="option" onclick="setVersion('stable');">Stable</div>
-                            </div>
+                    </div>
+                    <div class="option" id="safemodeToggle750">Safe mode
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div style="display:none;" class="option checked" id="editorButton750">Editor
+                        <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="fullscreenButton750">Fullscreen</div>
+                    <div class="option" id="editorFullscreenButton750">Editor Fullscreen</div>
+                    <div class="option" id="formatButton750">Format code</div>
+                    <div class="option" id="minimapToggle750">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="debugButton750">Debug layer
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="metadataButton750">Metadata</div>
+                    <div class="option subSelect">
+                        <span id="currentVersion750">Vers. : Latest</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setVersion('latest');">Latest</div>
+                            <div class="option" onclick="setVersion('stable');">Stable</div>
                         </div>
                     </div>
                 </div>
             </div>
+        </div>
 
-            <div class="category right">
-                <div class="button select">
-                    <span id="currentScript750">Scenes</span>
-                    <div class="toDisplayBig">
-                        <ul id="scriptsList750">
-                        </ul>
-                    </div>
+        <div class="category right">
+            <div class="button select">
+                <span id="currentScript750">Scenes</span>
+                <div class="toDisplayBig">
+                    <ul id="scriptsList750">
+                    </ul>
                 </div>
             </div>
-            <div class="save-message" id="saveMessage">
-                This PG has missing metadata. Click save to add them.
-            </div>
         </div>
+        <div class="save-message" id="saveMessage">
+            This PG has missing metadata. Click save to add them.
+        </div>
+    </div>
 
-        <div class="wrapper">
-            <div id="jsEditor"></div>
-            <div id="canvasZone">
-                <canvas touch-action="none" id="renderCanvas"></canvas>
-            </div>
+    <div class="wrapper">
+        <div id="jsEditor"></div>
+        <div id="canvasZone">
+            <canvas touch-action="none" id="renderCanvas"></canvas>
         </div>
+    </div>
 
-        <span class="label" id="fpsLabel">FPS</span>
+    <span class="label" id="fpsLabel">FPS</span>
 
-        <div id="errorZone">
-        </div>
+    <div id="errorZone">
+    </div>
 
-        <div class="navbarBottom">
-            <div id="statusBar"></div>
-            <div class="links">
-                <div class='link'>
-                    <a target='_new' href="https://www.netlify.com/">Deployed by Netlify</a>
-                </div>
-                <div class='link'>
-                    <a target='_new' href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a>
-                </div>
-                <div class='link'>
-                    <a target='_new' href="https://www.babylonjs.com/sandbox">Sandbox</a>
-                </div>
-                <div class='link'>
-                    <a target='_new' href="https://doc.babylonjs.com">Documentation</a>
-                </div>
-                <div class='link'>
-                    <a target='_new' href="https://doc.babylonjs.com/playground">Search</a>
-                </div>
+    <div class="navbarBottom">
+        <div id="statusBar"></div>
+        <div class="links">
+            <div class='link'>
+                <a target='_new' href="https://www.netlify.com/">Deployed by Netlify</a>
+            </div>
+            <div class='link'>
+                <a target='_new' href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a>
+            </div>
+            <div class='link'>
+                <a target='_new' href="https://www.babylonjs.com/sandbox">Sandbox</a>
+            </div>
+            <div class='link'>
+                <a target='_new' href="https://doc.babylonjs.com">Documentation</a>
+            </div>
+            <div class='link'>
+                <a target='_new' href="https://doc.babylonjs.com/playground">Search</a>
             </div>
         </div>
+    </div>
 
-        <div id="saveLayer" class="save-layer">
-            <div class="save-form">
-                <label for="saveFormTitle">TITLE</label>
-                <div class="separator"></div>
-                <input type="text" maxlength="120" id="saveFormTitle" class="save-form-title">
+    <div id="saveLayer" class="save-layer">
+        <div class="save-form">
+            <label for="saveFormTitle">TITLE</label>
+            <div class="separator"></div>
+            <input type="text" maxlength="120" id="saveFormTitle" class="save-form-title">
 
-                <label for="saveFormDescription">DESCRIPTION</label>
-                <div class="separator"></div>
-                <textarea id="saveFormDescription" rows="4" cols="10"></textarea>
+            <label for="saveFormDescription">DESCRIPTION</label>
+            <div class="separator"></div>
+            <textarea id="saveFormDescription" rows="4" cols="10"></textarea>
 
-                <label for="saveFormTags">TAGS (separated by comma)</label>
-                <div class="separator"></div>
-                <textarea id="saveFormTags" rows="4" cols="10"></textarea>
+            <label for="saveFormTags">TAGS (separated by comma)</label>
+            <div class="separator"></div>
+            <textarea id="saveFormTags" rows="4" cols="10"></textarea>
 
-                <div class="save-form-buttons" id="saveFormButtons">
+            <div class="save-form-buttons" id="saveFormButtons">
 
-                    <div id="saveFormButtonOk" class="button">OK</div>
-                    <div id="saveFormButtonCancel" class="button">Cancel</div>
-                </div>
+                <div id="saveFormButtonOk" class="button">OK</div>
+                <div id="saveFormButtonCancel" class="button">Cancel</div>
             </div>
         </div>
-
-        <div id="waitDiv">
-            <span id="waitTitle">Babylon.js Playground
-                <BR>
-                <BR>
-                <BR>
-            </span>
-            <img src="waitlogo.png" id="waitLogo" />
-        </div>
-
-        <script src="https://code.jquery.com/jquery.js"></script>
+    </div>
+
+    <div id="waitDiv">
+        <span id="waitTitle">Babylon.js Playground
+            <BR>
+            <BR>
+            <BR>
+        </span>
+        <img src="waitlogo.png" id="waitLogo" />
+    </div>
+
+    <script src="https://code.jquery.com/jquery.js"></script>
 
     <script src="js/actions.js"></script>
     <script src="js/pbt.js"></script>

+ 12 - 3
Playground/indexStable.html

@@ -99,6 +99,9 @@
                     <div class="option" id="fullscreenButton1600">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1600">Editor Fullscreen</div>
                     <div class="option" id="formatButton1600">Format code</div>
+                    <div class="option" id="minimapToggle1600">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                 </div>
             </div>
 
@@ -171,7 +174,9 @@
                     </div>
                     <div class="option" id="fullscreenButton1475">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1475">Editor Fullscreen</div>
-                    <div class="option" id="formatButton1475">Format code</div>
+                    <div class="option" id="formatButton1475">Format code</div><div class="option" id="minimapToggle1475">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton1475">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton1475">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion1475">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
@@ -237,7 +242,9 @@
                     </div>
                     <div class="option" id="fullscreenButton1030">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton1030">Editor Fullscreen</div>
-                    <div class="option" id="formatButton1030">Format code</div>
+                    <div class="option" id="formatButton1030">Format code</div><div class="option" id="minimapToggle1030">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton1030">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton1030">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion1030">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>
@@ -300,7 +307,9 @@
                     </div>
                     <div class="option" id="fullscreenButton750">Fullscreen</div>
                     <div class="option" id="editorFullscreenButton750">Editor Fullscreen</div>
-                    <div class="option" id="formatButton750">Format code</div>
+                    <div class="option" id="formatButton750">Format code</div><div class="option" id="minimapToggle750">Minimap
+                        <i class="fa fa-square-o" aria-hidden="true"></i>
+                    </div>
                     <div class="option" id="debugButton750">Debug layer<i class="fa fa-square-o" aria-hidden="true"></i></div>
                     <div class="option" id="metadataButton750">Metadata</div>
                     <div class="option subSelect"><span id="currentVersion750">Vers. : Latest</span><i class="fa fa-chevron-right" aria-hidden="true"></i>

+ 17 - 2
Playground/js/index.js

@@ -67,6 +67,7 @@
 
             setToMultipleID("currentScript", "innerHTML", "Custom");
             setToMultipleID("safemodeToggle", "addClass", "checked");
+            setToMultipleID("minimapToggle", "addClass", "checked");
 
             setToMultipleID('safemodeToggle', 'innerHTML', 'Safe mode <i class="fa fa-check-square" aria-hidden="true"></i>');
         }
@@ -326,7 +327,7 @@
                 var showDebugLayer = false;
                 var initialTabIndex = 0;
                 showBJSPGMenu();
-                jsEditor.updateOptions({readOnly: false});
+                jsEditor.updateOptions({ readOnly: false });
 
                 if (document.getElementsByClassName('insp-wrapper').length > 0) {
                     for (var i = 0; i < engine.scenes.length; i++) {
@@ -640,7 +641,7 @@
         // Fonts
         setFontSize = function (size) {
             fontSize = size;
-            jsEditor.updateOptions({fontSize: size});
+            jsEditor.updateOptions({ fontSize: size });
             setToMultipleID("currentFontSize", "innerHTML", "Font: " + size);
         };
 
@@ -762,6 +763,18 @@
             jsEditor.getAction('editor.action.format').run();
         }
 
+        var toggleMinimap = function () {
+            var minimapToggle = document.getElementById("minimapToggle1600");
+            if (minimapToggle.classList.contains('checked')) {
+                jsEditor.updateOptions({ minimap: { enabled: false } });
+                setToMultipleID("minimapToggle", "innerHTML", 'Minimap <i class="fa fa-square-o" aria-hidden="true"></i>');
+            } else {
+                jsEditor.updateOptions({ minimap: { enabled: true } });
+                setToMultipleID("minimapToggle", "innerHTML", 'Minimap <i class="fa fa-check-square" aria-hidden="true"></i>');
+            }
+            minimapToggle.classList.toggle('checked');
+        }
+
 
         //Navigation Overwrites
         var exitPrompt = function (e) {
@@ -971,6 +984,8 @@
         setToMultipleID("editorFullscreenButton", "click", editorGoFullscreen);
         // Format
         setToMultipleID("formatButton", "click", formatCode);
+        // Format
+        setToMultipleID("minimapToggle", "click", toggleMinimap);
         // Debug
         setToMultipleID("debugButton", "click", toggleDebug);
         // Metadata

+ 40 - 0
Playground/js/pbt.js

@@ -2,6 +2,7 @@
 var PBT = function() {
     this.decorationStyles = new Array();
     this.decorations = new Array();
+    this.lineRanges = new Array();
     var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI");
     
     this.clearDecorLines = function() {
@@ -41,12 +42,51 @@ var PBT = function() {
 
     this.hideLines = function(lineRanges) {
         var ranges = [];
+        this.lineRanges = lineRanges;
         for(var i = 0; i < lineRanges.length; i +=2) {
             ranges.push(new monaco.Range(lineRanges[i], 1, lineRanges[i + 1], 100000));                
         }
         jsEditor.setHiddenAreas(ranges);
     }
 
+    this.hideRange = function(lineRanges) {       
+        var ranges = [];
+        lineRanges = this.lineRanges.concat(lineRanges);
+        this.lineRanges = lineRanges;
+        for(var i = 0; i < lineRanges.length; i +=2) {
+            ranges.push(new monaco.Range(lineRanges[i], 1, lineRanges[i + 1], 100000));                
+        }
+        jsEditor.setHiddenAreas(ranges);
+    }
+
+    this.showRange = function(lineRanges) {
+        var rangePairs = [];
+        var linePairs = [];       
+        for(var i = 0; i < this.lineRanges.length; i +=2) {
+            rangePairs.push(this.lineRanges[i] + "=" + this.lineRanges[i + 1]);                
+        }        
+        for(var i = 0; i < lineRanges.length; i +=2) {
+            linePairs.push(lineRanges[i] + "=" + lineRanges[i + 1]);                
+        }       
+        var rangeString = rangePairs.join("-");         
+        for(var i = 0; i < linePairs.length; i++) {           
+            rangeString = rangeString.replace(linePairs[i]+"-", "");
+            rangeString = rangeString.replace("-" + linePairs[i], ""); //when last element
+        }        
+        rangeString = rangeString.replace(/-/g, ",");       
+        rangeString = rangeString.replace(/=/g, ",");       
+        lineRanges = rangeString.split(",");      
+        lineRanges = lineRanges.map(function(n){
+            return parseInt(n);
+        });       
+        var ranges = [];
+        for(var i = 0; i < lineRanges.length; i +=2) {
+            ranges.push(new monaco.Range(lineRanges[i], 1, lineRanges[i + 1], 100000));                
+        }
+        this.lineRanges = lineRanges;        
+        jsEditor.setHiddenAreas(ranges);
+    }
+
     this.editOn = function() {
         jsEditor.updateOptions({readOnly: false});
     }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
Playground/scenes/candle.babylon


+ 2 - 1
Tools/Gulp/gulpfile.js

@@ -48,7 +48,8 @@ var tsConfig = {
     noImplicitReturns: true,
     noImplicitThis: true,
     noUnusedLocals: true,
-    strictNullChecks: true
+    strictNullChecks: true,
+    strictFunctionTypes: false
 };
 var tsProject = typescript.createProject(tsConfig);
 

+ 41 - 41
Tools/Gulp/package.json

@@ -1,43 +1,43 @@
 {
-  "name": "BabylonJS",
-  "version": "3.0.0",
-  "description": "Babylon.js is a 3D engine based on webgl and javascript",
-  "main": "",
-  "repository": {
-    "url": "https://github.com/BabylonJS/Babylon.js/"
-  },
-  "readme": "https://github.com/BabylonJS/Babylon.js/edit/master/readme.md",
-  "license": "(Apache-2.0)",
-  "devDependencies": {
-    "css-loader": "^0.25.0",
-    "del": "2.2.2",
-    "exports-loader": "^0.6.3",
-    "gulp": "^3.8.11",
-    "gulp-changed-in-place": "2.0.3",
-    "gulp-clean-ts-extends": "~0.1.1",
-    "gulp-concat": "~2.5.2",
-    "gulp-content-to-variable": "^0.1.0",
-    "gulp-debug": "^3.0.0",
-    "gulp-expect-file": "^0.0.7",
-    "gulp-optimize-js": "^1.0.2",
-    "gulp-rename": "~1.2.2",
-    "gulp-replace": "~0.5.3",
-    "gulp-sass": "3.1.0",
-    "gulp-sourcemaps": "~1.9.1",
-    "gulp-typescript": "^3.2.2",
-    "gulp-uglify": "^2.1.2",
-    "gulp-util": "~3.0.4",
-    "gulp-webserver": "^0.9.1",
-    "imports-loader": "^0.7.0",
-    "merge2": "~0.3.5",
-    "minimist": "^1.2.0",
-    "run-sequence": "~1.1.0",
-    "style-loader": "^0.13.1",
-    "through2": "~0.6.5",
-    "typescript": "~2.5.3",
-    "webpack-stream": "^3.2.0"
-  },
-  "scripts": {
-    "install": "npm --prefix ../../Playground/ install ../../Playground/ && gulp typescript-compile && gulp typescript-libraries && gulp deployLocalDev"
-  }
+    "name": "BabylonJS",
+    "version": "3.0.0",
+    "description": "Babylon.js is a 3D engine based on webgl and javascript",
+    "main": "",
+    "repository": {
+        "url": "https://github.com/BabylonJS/Babylon.js/"
+    },
+    "readme": "https://github.com/BabylonJS/Babylon.js/edit/master/readme.md",
+    "license": "(Apache-2.0)",
+    "devDependencies": {
+        "css-loader": "^0.25.0",
+        "del": "2.2.2",
+        "exports-loader": "^0.6.3",
+        "gulp": "^3.8.11",
+        "gulp-changed-in-place": "2.0.3",
+        "gulp-clean-ts-extends": "~0.1.1",
+        "gulp-concat": "~2.5.2",
+        "gulp-content-to-variable": "^0.1.0",
+        "gulp-debug": "^3.0.0",
+        "gulp-expect-file": "^0.0.7",
+        "gulp-optimize-js": "^1.0.2",
+        "gulp-rename": "~1.2.2",
+        "gulp-replace": "~0.5.3",
+        "gulp-sass": "3.1.0",
+        "gulp-sourcemaps": "~1.9.1",
+        "gulp-typescript": "^3.2.2",
+        "gulp-uglify": "^2.1.2",
+        "gulp-util": "~3.0.4",
+        "gulp-webserver": "^0.9.1",
+        "imports-loader": "^0.7.0",
+        "merge2": "~0.3.5",
+        "minimist": "^1.2.0",
+        "run-sequence": "~1.1.0",
+        "style-loader": "^0.13.1",
+        "through2": "~0.6.5",
+        "typescript": "~2.6.1",
+        "webpack-stream": "^3.2.0"
+    },
+    "scripts": {
+        "install": "npm --prefix ../../Playground/ install ../../Playground/ && gulp typescript-compile && gulp typescript-libraries && gulp deployLocalDev"
+    }
 }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 5771 - 5778
dist/preview release/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 45 - 45
dist/preview release/babylon.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 217 - 136
dist/preview release/babylon.max.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 48 - 48
dist/preview release/babylon.worker.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1423 - 1430
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 42 - 42
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 176 - 128
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -6412,9 +6412,9 @@ var BABYLON;
                 if (!screenshotCanvas.toBlob) {
                     //  low performance polyfill based on toDataURL (https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob)
                     screenshotCanvas.toBlob = function (callback, type, quality) {
-                        var canvas = this;
+                        var _this = this;
                         setTimeout(function () {
-                            var binStr = atob(canvas.toDataURL(type, quality).split(',')[1]), len = binStr.length, arr = new Uint8Array(len);
+                            var binStr = atob(_this.toDataURL(type, quality).split(',')[1]), len = binStr.length, arr = new Uint8Array(len);
                             for (var i = 0; i < len; i++) {
                                 arr[i] = binStr.charCodeAt(i);
                             }
@@ -6446,6 +6446,8 @@ var BABYLON;
                     }
                     else {
                         var newWindow = window.open("");
+                        if (!newWindow)
+                            return;
                         var img = newWindow.document.createElement("img");
                         img.onload = function () {
                             // no longer need to read the blob so it's revoked
@@ -7821,7 +7823,7 @@ var BABYLON;
             mag: magFilter
         };
     };
-    var partialLoad = function (url, index, loadedImages, scene, onfinish, onErrorCallBack) {
+    var partialLoadImg = function (url, index, loadedImages, scene, onfinish, onErrorCallBack) {
         if (onErrorCallBack === void 0) { onErrorCallBack = null; }
         var img;
         var onload = function () {
@@ -7847,12 +7849,36 @@ var BABYLON;
             scene._addPendingData(img);
         }
     };
-    var cascadeLoad = function (rootUrl, scene, onfinish, files, onError) {
+    var cascadeLoadImgs = function (rootUrl, scene, onfinish, files, onError) {
         if (onError === void 0) { onError = null; }
         var loadedImages = [];
         loadedImages._internalCount = 0;
         for (var index = 0; index < 6; index++) {
-            partialLoad(files[index], index, loadedImages, scene, onfinish, onError);
+            partialLoadImg(files[index], index, loadedImages, scene, onfinish, onError);
+        }
+    };
+    var partialLoadFile = function (url, index, loadedFiles, scene, onfinish, onErrorCallBack) {
+        if (onErrorCallBack === void 0) { onErrorCallBack = null; }
+        var onload = function (data) {
+            loadedFiles[index] = data;
+            loadedFiles._internalCount++;
+            if (loadedFiles._internalCount === 6) {
+                onfinish(loadedFiles);
+            }
+        };
+        var onerror = function (request, exception) {
+            if (onErrorCallBack) {
+                onErrorCallBack(request.status + " " + request.statusText, exception);
+            }
+        };
+        BABYLON.Tools.LoadFile(url, onload, undefined, undefined, true, onerror);
+    };
+    var cascadeLoadFiles = function (rootUrl, scene, onfinish, files, onError) {
+        if (onError === void 0) { onError = null; }
+        var loadedFiles = [];
+        loadedFiles._internalCount = 0;
+        for (var index = 0; index < 6; index++) {
+            partialLoadFile(files[index], index, loadedFiles, scene, onfinish, onError);
         }
     };
     var BufferPointer = /** @class */ (function () {
@@ -11027,47 +11053,66 @@ var BABYLON;
                     _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
                     gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 1);
                     ktx.uploadLevels(_this._gl, !noMipmap);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-                    _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
-                    _this.resetTextureCache();
+                    _this.setCubeMapTextureParams(gl, loadMipmap);
                     texture.width = ktx.pixelWidth;
                     texture.height = ktx.pixelHeight;
                     texture.isReady = true;
                 }, undefined, undefined, true, onerror);
             }
             else if (isDDS) {
-                BABYLON.Tools.LoadFile(rootUrl, function (data) {
-                    var info = BABYLON.Internals.DDSTools.GetDDSInfo(data);
-                    var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap;
-                    _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
-                    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, info.isCompressed ? 1 : 0);
-                    BABYLON.Internals.DDSTools.UploadDDSLevels(_this, _this._gl, data, info, loadMipmap, 6);
-                    if (!noMipmap && !info.isFourCC && info.mipmapCount === 1) {
-                        gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
-                    }
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-                    _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
-                    _this.resetTextureCache();
-                    texture.width = info.width;
-                    texture.height = info.height;
-                    texture.isReady = true;
-                    texture.type = info.textureType;
-                    if (onLoad) {
-                        onLoad({ isDDS: true, width: info.width, info: info, data: data, texture: texture });
-                    }
-                }, undefined, undefined, true, onerror);
+                if (files && files.length === 6) {
+                    cascadeLoadFiles(rootUrl, scene, function (imgs) {
+                        var info;
+                        var loadMipmap = false;
+                        var width = 0;
+                        for (var index = 0; index < imgs.length; index++) {
+                            var data = imgs[index];
+                            info = BABYLON.Internals.DDSTools.GetDDSInfo(data);
+                            loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap;
+                            _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
+                            gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, info.isCompressed ? 1 : 0);
+                            BABYLON.Internals.DDSTools.UploadDDSLevels(_this, _this._gl, data, info, loadMipmap, 6, -1, index);
+                            if (!noMipmap && !info.isFourCC && info.mipmapCount === 1) {
+                                gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+                            }
+                            texture.width = info.width;
+                            texture.height = info.height;
+                            texture.type = info.textureType;
+                            width = info.width;
+                        }
+                        _this.setCubeMapTextureParams(gl, loadMipmap);
+                        texture.isReady = true;
+                        if (onLoad) {
+                            onLoad({ isDDS: true, width: width, info: info, imgs: imgs, texture: texture });
+                        }
+                    }, files, onError);
+                }
+                else {
+                    BABYLON.Tools.LoadFile(rootUrl, function (data) {
+                        var info = BABYLON.Internals.DDSTools.GetDDSInfo(data);
+                        var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap;
+                        _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
+                        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, info.isCompressed ? 1 : 0);
+                        BABYLON.Internals.DDSTools.UploadDDSLevels(_this, _this._gl, data, info, loadMipmap, 6);
+                        if (!noMipmap && !info.isFourCC && info.mipmapCount === 1) {
+                            gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+                        }
+                        _this.setCubeMapTextureParams(gl, loadMipmap);
+                        texture.width = info.width;
+                        texture.height = info.height;
+                        texture.isReady = true;
+                        texture.type = info.textureType;
+                        if (onLoad) {
+                            onLoad({ isDDS: true, width: info.width, info: info, data: data, texture: texture });
+                        }
+                    }, undefined, undefined, true, onerror);
+                }
             }
             else {
                 if (!files) {
                     throw new Error("Cannot load cubemap because files were not defined");
                 }
-                cascadeLoad(rootUrl, scene, function (imgs) {
+                cascadeLoadImgs(rootUrl, scene, function (imgs) {
                     var width = _this.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(imgs[0].width, _this._caps.maxCubemapTextureSize) : imgs[0].width;
                     var height = width;
                     _this._prepareWorkingCanvas();
@@ -11090,12 +11135,7 @@ var BABYLON;
                     if (!noMipmap) {
                         gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
                     }
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, noMipmap ? gl.LINEAR : gl.LINEAR_MIPMAP_LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-                    _this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
-                    _this.resetTextureCache();
+                    _this.setCubeMapTextureParams(gl, !noMipmap);
                     texture.width = width;
                     texture.height = height;
                     texture.isReady = true;
@@ -11112,6 +11152,14 @@ var BABYLON;
             this._internalTexturesCache.push(texture);
             return texture;
         };
+        Engine.prototype.setCubeMapTextureParams = function (gl, loadMipmap) {
+            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
+            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+            this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
+            this.resetTextureCache();
+        };
         Engine.prototype.updateRawCubeTexture = function (texture, data, format, type, invertY, compression, level) {
             if (compression === void 0) { compression = null; }
             if (level === void 0) { level = 0; }
@@ -11168,10 +11216,8 @@ var BABYLON;
             }
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
-            var needConversion = false;
             if (internalFormat === gl.RGB) {
                 internalFormat = gl.RGBA;
-                needConversion = true;
             }
             var width = size;
             var height = width;
@@ -17138,7 +17184,6 @@ var BABYLON;
                 var renderingGroup = this._renderingGroups[index];
                 if (!renderingGroup && !observable)
                     continue;
-                this._currentIndex = index;
                 var renderingGroupMask = 0;
                 // Fire PRECLEAR stage
                 if (observable && info) {
@@ -22776,24 +22821,28 @@ var BABYLON;
                 return null;
             }
             var texture = BABYLON.SerializationHelper.Parse(function () {
+                var generateMipMaps = true;
+                if (parsedTexture.noMipmap) {
+                    generateMipMaps = false;
+                }
                 if (parsedTexture.mirrorPlane) {
-                    var mirrorTexture = new BABYLON.MirrorTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene);
+                    var mirrorTexture = new BABYLON.MirrorTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
                     mirrorTexture._waitingRenderList = parsedTexture.renderList;
                     mirrorTexture.mirrorPlane = BABYLON.Plane.FromArray(parsedTexture.mirrorPlane);
                     return mirrorTexture;
                 }
                 else if (parsedTexture.isRenderTarget) {
-                    var renderTargetTexture = new BABYLON.RenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene);
+                    var renderTargetTexture = new BABYLON.RenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
                     renderTargetTexture._waitingRenderList = parsedTexture.renderList;
                     return renderTargetTexture;
                 }
                 else {
                     var texture;
                     if (parsedTexture.base64String) {
-                        texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene);
+                        texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene, !generateMipMaps);
                     }
                     else {
-                        texture = new Texture(rootUrl + parsedTexture.name, scene);
+                        texture = new Texture(rootUrl + parsedTexture.name, scene, !generateMipMaps);
                     }
                     return texture;
                 }
@@ -26175,7 +26224,6 @@ var BABYLON;
             this._defines[rank].push(define);
         };
         EffectFallbacks.prototype.addCPUSkinningFallback = function (rank, mesh) {
-            this._meshRank = rank;
             this._mesh = mesh;
             if (rank < this._currentRank) {
                 this._currentRank = rank;
@@ -32501,7 +32549,6 @@ var BABYLON;
             this._enabled = false;
             //clear last sample to avoid interpolating over the disabled period when next enabled
             this._lastFrameTimeMs = null;
-            this._lastChangeTimeMs = null;
         };
         Object.defineProperty(PerformanceMonitor.prototype, "isEnabled", {
             /**
@@ -32520,7 +32567,6 @@ var BABYLON;
         PerformanceMonitor.prototype.reset = function () {
             //clear last sample to avoid interpolating over the disabled period when next enabled
             this._lastFrameTimeMs = null;
-            this._lastChangeTimeMs = null;
             //wipe record
             this._rollingFrameTime.reset();
         };
@@ -32663,6 +32709,7 @@ var BABYLON;
             this._vignetteBlendMode = ImageProcessingConfiguration.VIGNETTEMODE_MULTIPLY;
             this._vignetteEnabled = false;
             this._applyByPostProcess = false;
+            this._isEnabled = true;
             /**
             * An event triggered when the configuration changes and requires Shader to Update some parameters.
             * @type {BABYLON.Observable}
@@ -32869,6 +32916,26 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(ImageProcessingConfiguration.prototype, "isEnabled", {
+            /**
+             * Gets wether the image processing is enabled or not.
+             */
+            get: function () {
+                return this._isEnabled;
+            },
+            /**
+             * Sets wether the image processing is enabled or not.
+             */
+            set: function (value) {
+                if (this._isEnabled === value) {
+                    return;
+                }
+                this._isEnabled = value;
+                this._updateParameters();
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Method called each time the image processing information changes requires to recompile the effect.
          */
@@ -32918,7 +32985,7 @@ var BABYLON;
          */
         ImageProcessingConfiguration.prototype.prepareDefines = function (defines, forPostProcess) {
             if (forPostProcess === void 0) { forPostProcess = false; }
-            if (forPostProcess !== this.applyByPostProcess) {
+            if (forPostProcess !== this.applyByPostProcess || !this._isEnabled) {
                 defines.VIGNETTE = false;
                 defines.TONEMAPPING = false;
                 defines.CONTRAST = false;
@@ -32927,7 +32994,7 @@ var BABYLON;
                 defines.COLORGRADING = false;
                 defines.COLORGRADING3D = false;
                 defines.IMAGEPROCESSING = false;
-                defines.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess;
+                defines.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess && this._isEnabled;
                 return;
             }
             defines.VIGNETTE = this.vignetteEnabled;
@@ -33094,6 +33161,9 @@ var BABYLON;
         __decorate([
             BABYLON.serialize()
         ], ImageProcessingConfiguration.prototype, "_applyByPostProcess", void 0);
+        __decorate([
+            BABYLON.serialize()
+        ], ImageProcessingConfiguration.prototype, "_isEnabled", void 0);
         return ImageProcessingConfiguration;
     }());
     BABYLON.ImageProcessingConfiguration = ImageProcessingConfiguration;
@@ -34789,7 +34859,9 @@ var BABYLON;
                 // Log. depth
                 BABYLON.MaterialHelper.BindLogDepth(defines, effect, scene);
                 // image processing
-                this._imageProcessingConfiguration.bind(this._activeEffect);
+                if (!this._imageProcessingConfiguration.applyByPostProcess) {
+                    this._imageProcessingConfiguration.bind(this._activeEffect);
+                }
             }
             this._uniformBuffer.update();
             this._afterBind(mesh, this._activeEffect);
@@ -44496,7 +44568,6 @@ var BABYLON;
                         _this._runningUpdated--;
                         break;
                     case WorkerTaskType.COLLIDE:
-                        _this._runningCollisionTask = false;
                         var returnPayload = returnData.payload;
                         if (!_this._collisionsCallbackArray[returnPayload.collisionId])
                             return;
@@ -44515,7 +44586,6 @@ var BABYLON;
             this._collisionsCallbackArray = [];
             this._init = false;
             this._runningUpdated = 0;
-            this._runningCollisionTask = false;
             this._addUpdateMeshesList = {};
             this._addUpdateGeometriesList = {};
             this._toRemoveGeometryArray = [];
@@ -49112,7 +49182,6 @@ var BABYLON;
             this._position = BABYLON.Vector3.Zero();
             this._localDirection = new BABYLON.Vector3(1, 0, 0);
             this._volume = 1;
-            this._isLoaded = false;
             this._isReadyToPlay = false;
             this.isPlaying = false;
             this.isPaused = false;
@@ -49305,7 +49374,6 @@ var BABYLON;
         };
         Sound.prototype._soundLoaded = function (audioData) {
             var _this = this;
-            this._isLoaded = true;
             if (!BABYLON.Engine.audioEngine.audioContext) {
                 return;
             }
@@ -49994,17 +50062,20 @@ var BABYLON;
                 return _this;
             }
             _this._texture = _this._getFromCache(rootUrl, noMipmap);
+            var lastDot = rootUrl.lastIndexOf(".");
+            var extension = forcedExtension ? forcedExtension : (lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : "");
+            var isDDS = (extension === ".dds");
             if (!files) {
-                if (!extensions) {
+                if (!isDDS && !extensions) {
                     extensions = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"];
                 }
                 files = [];
-                for (var index = 0; index < extensions.length; index++) {
-                    files.push(rootUrl + extensions[index]);
+                if (extensions) {
+                    for (var index = 0; index < extensions.length; index++) {
+                        files.push(rootUrl + extensions[index]);
+                    }
                 }
-                _this._extensions = extensions;
             }
-            _this._files = files;
             if (!_this._texture) {
                 if (!scene.useDelayedTextureLoading) {
                     if (prefiltered) {
@@ -50725,7 +50796,6 @@ var BABYLON;
             }
             var generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
             var generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer;
-            _this._count = count;
             _this._size = size;
             _this._multiRenderTargetOptions = {
                 samplingModes: samplingModes,
@@ -51404,6 +51474,7 @@ var BABYLON;
             this.height = -1;
             this.autoClear = true;
             this.alphaMode = BABYLON.Engine.ALPHA_DISABLE;
+            this.animations = new Array();
             /*
                 Enable Pixel Perfect mode where texture is not scaled to be power of 2.
                 Can only be used on a single postprocess or on the last one of a chain.
@@ -51762,6 +51833,7 @@ var BABYLON;
     var PassPostProcess = /** @class */ (function (_super) {
         __extends(PassPostProcess, _super);
         function PassPostProcess(name, options, camera, samplingMode, engine, reusable, textureType) {
+            if (camera === void 0) { camera = null; }
             if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             return _super.call(this, name, "pass", null, null, options, camera, samplingMode, engine, reusable, undefined, textureType) || this;
         }
@@ -55106,7 +55178,6 @@ var BABYLON;
         function FreeCameraTouchInput() {
             this._offsetX = null;
             this._offsetY = null;
-            this._pointerCount = 0;
             this._pointerPressed = new Array();
             this.touchAngularSensibility = 200000.0;
             this.touchMoveSensibility = 250.0;
@@ -55187,7 +55258,6 @@ var BABYLON;
                 this._pointerPressed = [];
                 this._offsetX = null;
                 this._offsetY = null;
-                this._pointerCount = 0;
             }
         };
         FreeCameraTouchInput.prototype.checkInputs = function () {
@@ -57742,7 +57812,6 @@ var BABYLON;
 (function (BABYLON) {
     var PostProcessRenderEffect = /** @class */ (function () {
         function PostProcessRenderEffect(engine, name, getPostProcess, singleInstance) {
-            this._engine = engine;
             this._name = name;
             this._singleInstance = singleInstance || true;
             this._getPostProcess = getPostProcess;
@@ -58302,10 +58371,6 @@ var BABYLON;
             _this._depthTexture = scene.enableDepthRenderer().getDepthMap(); // Force depth renderer "on"
             var ssaoRatio = ratio.ssaoRatio || ratio;
             var combineRatio = ratio.combineRatio || ratio;
-            _this._ratio = {
-                ssaoRatio: ssaoRatio,
-                combineRatio: combineRatio
-            };
             _this._originalColorPostProcess = new BABYLON.PassPostProcess("SSAOOriginalSceneColor", combineRatio, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false);
             _this._createSSAOPostProcess(ssaoRatio);
             _this._createBlurPostProcess(ssaoRatio);
@@ -58445,9 +58510,6 @@ var BABYLON;
         __decorate([
             BABYLON.serialize()
         ], SSAORenderingPipeline.prototype, "base", void 0);
-        __decorate([
-            BABYLON.serialize()
-        ], SSAORenderingPipeline.prototype, "_ratio", void 0);
         return SSAORenderingPipeline;
     }(BABYLON.PostProcessRenderPipeline));
     BABYLON.SSAORenderingPipeline = SSAORenderingPipeline;
@@ -58544,10 +58606,6 @@ var BABYLON;
             }
             var ssaoRatio = ratio.ssaoRatio || ratio;
             var blurRatio = ratio.blurRatio || ratio;
-            _this._ratio = {
-                ssaoRatio: ssaoRatio,
-                blurRatio: blurRatio
-            };
             // Set up assets
             var geometryBufferRenderer = scene.enableGeometryBufferRenderer();
             _this._createRandomTexture();
@@ -58778,9 +58836,6 @@ var BABYLON;
         __decorate([
             BABYLON.serialize()
         ], SSAO2RenderingPipeline.prototype, "base", void 0);
-        __decorate([
-            BABYLON.serialize()
-        ], SSAO2RenderingPipeline.prototype, "_ratio", void 0);
         return SSAO2RenderingPipeline;
     }(BABYLON.PostProcessRenderPipeline));
     BABYLON.SSAO2RenderingPipeline = SSAO2RenderingPipeline;
@@ -68014,7 +68069,6 @@ var BABYLON;
                 offset += header.id_length;
                 var use_rle = false;
                 var use_pal = false;
-                var use_rgb = false;
                 var use_grey = false;
                 // Get some informations.
                 switch (header.image_type) {
@@ -68026,7 +68080,7 @@ var BABYLON;
                     case TGATools._TYPE_RLE_RGB:
                         use_rle = true;
                     case TGATools._TYPE_RGB:
-                        use_rgb = true;
+                        // use_rgb = true;
                         break;
                     case TGATools._TYPE_RLE_GREY:
                         use_rle = true;
@@ -68535,14 +68589,16 @@ var BABYLON;
                 }
                 return byteArray;
             };
-            DDSTools.UploadDDSLevels = function (engine, gl, arrayBuffer, info, loadMipmaps, faces, lodIndex) {
+            DDSTools.UploadDDSLevels = function (engine, gl, arrayBuffer, info, loadMipmaps, faces, lodIndex, currentFace) {
                 if (lodIndex === void 0) { lodIndex = -1; }
                 var ext = engine.getCaps().s3tc;
-                var header = new Int32Array(arrayBuffer, 0, headerLengthInt), fourCC, width, height, dataLength, dataOffset, byteArray, mipmapCount, mip;
+                var header = new Int32Array(arrayBuffer, 0, headerLengthInt);
+                var fourCC, width, height, dataLength = 0, dataOffset;
+                var byteArray, mipmapCount, mip;
                 var internalFormat = 0;
                 var format = 0;
                 var blockBytes = 1;
-                if (header[off_magic] != DDS_MAGIC) {
+                if (header[off_magic] !== DDS_MAGIC) {
                     BABYLON.Tools.Error("Invalid magic number in DDS header");
                     return;
                 }
@@ -68611,7 +68667,7 @@ var BABYLON;
                     mipmapCount = Math.max(1, header[off_mipmapCount]);
                 }
                 for (var face = 0; face < faces; face++) {
-                    var sampler = faces === 1 ? gl.TEXTURE_2D : (gl.TEXTURE_CUBE_MAP_POSITIVE_X + face);
+                    var sampler = faces === 1 ? gl.TEXTURE_2D : (gl.TEXTURE_CUBE_MAP_POSITIVE_X + face + (currentFace ? currentFace : 0));
                     width = header[off_width];
                     height = header[off_height];
                     for (mip = 0; mip < mipmapCount; ++mip) {
@@ -68620,13 +68676,13 @@ var BABYLON;
                             var i = (lodIndex === -1) ? mip : 0;
                             if (!info.isCompressed && info.isFourCC) {
                                 dataLength = width * height * 4;
-                                var FloatArray = null;
+                                var floatArray = null;
                                 if (engine.badOS || engine.badDesktopOS || (!engine.getCaps().textureHalfFloat && !engine.getCaps().textureFloat)) {
                                     if (bpp === 128) {
-                                        FloatArray = DDSTools._GetFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                        floatArray = DDSTools._GetFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     }
                                     else if (bpp === 64) {
-                                        FloatArray = DDSTools._GetHalfFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                        floatArray = DDSTools._GetHalfFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     }
                                     info.textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
                                     format = engine._getWebGLTextureType(info.textureType);
@@ -68634,20 +68690,20 @@ var BABYLON;
                                 }
                                 else {
                                     if (bpp === 128) {
-                                        FloatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                        floatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     }
                                     else if (bpp === 64 && !engine.getCaps().textureHalfFloat) {
-                                        FloatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                        floatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                         info.textureType = BABYLON.Engine.TEXTURETYPE_FLOAT;
                                         format = engine._getWebGLTextureType(info.textureType);
                                         internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);
                                     }
                                     else {
-                                        FloatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                        floatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                     }
                                 }
-                                if (FloatArray) {
-                                    engine._uploadDataToTexture(sampler, i, internalFormat, width, height, gl.RGBA, format, FloatArray);
+                                if (floatArray) {
+                                    engine._uploadDataToTexture(sampler, i, internalFormat, width, height, gl.RGBA, format, floatArray);
                                 }
                             }
                             else if (info.isRGB) {
@@ -68676,12 +68732,16 @@ var BABYLON;
                                 engine._uploadCompressedDataToTexture(sampler, i, internalFormat, width, height, byteArray);
                             }
                         }
-                        dataOffset += width * height * (bpp / 8);
+                        dataOffset += bpp ? (width * height * (bpp / 8)) : dataLength;
                         width *= 0.5;
                         height *= 0.5;
                         width = Math.max(1.0, width);
                         height = Math.max(1.0, height);
                     }
+                    if (currentFace !== undefined) {
+                        // Loading a single face
+                        break;
+                    }
                 }
             };
             DDSTools.StoreLODInAlphaChannel = false;
@@ -70447,7 +70507,6 @@ var BABYLON;
             this.betaCorrection = 1;
             this.gammaCorrection = 1;
             this._alpha = 0;
-            this._beta = 0;
             this._gamma = 0;
             this._dirty = false;
             this._deviceOrientationHandler = this._onOrientationEvent.bind(this);
@@ -70460,9 +70519,6 @@ var BABYLON;
             if (evt.alpha !== null) {
                 this._alpha = +evt.alpha | 0;
             }
-            if (evt.beta !== null) {
-                this._beta = +evt.beta | 0;
-            }
             if (evt.gamma !== null) {
                 this._gamma = +evt.gamma | 0;
             }
@@ -71392,7 +71448,7 @@ var BABYLON;
                 if (!this._webVRpresenting) {
                     this._webVRCamera.position = this._position;
                     this._scene.activeCamera = this._webVRCamera;
-                    this._scene.imageProcessingConfiguration.applyByPostProcess = true;
+                    this._scene.imageProcessingConfiguration.isEnabled = true;
                 }
             }
             else {
@@ -71420,11 +71476,11 @@ var BABYLON;
             }
             this._deviceOrientationCamera.position = this._position;
             this._scene.activeCamera = this._deviceOrientationCamera;
+            this._scene.imageProcessingConfiguration.isEnabled = false;
             if (this._canvas) {
                 this._scene.activeCamera.attachControl(this._canvas);
             }
             this.updateButtonVisibility();
-            this._scene.imageProcessingConfiguration.applyByPostProcess = false;
         };
         Object.defineProperty(VRExperienceHelper.prototype, "position", {
             get: function () {
@@ -71455,13 +71511,10 @@ var BABYLON;
                 this._enableTeleportationOnController(this._webVRCamera.rightController);
             }
             this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera);
-            this._postProcessMove.vignetteWeight = 0;
-            this._postProcessMove.vignetteStretch = 0;
-            this._postProcessMove.vignetteColor = new BABYLON.Color4(0, 0, 0, 0);
-            this._postProcessMove.vignetteEnabled = false;
-            new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
-            this._postProcessMove.imageProcessingConfiguration = new BABYLON.ImageProcessingConfiguration();
-            this._scene.imageProcessingConfiguration.applyByPostProcess = false;
+            this._passProcessMove = new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
+            this._scene.imageProcessingConfiguration.vignetteColor = new BABYLON.Color4(0, 0, 0, 0);
+            this._scene.imageProcessingConfiguration.vignetteEnabled = true;
+            this._scene.imageProcessingConfiguration.isEnabled = false;
             this._createTeleportationCircles();
             this.meshSelectionPredicate = function (mesh) {
                 if (mesh.name.indexOf(_this._floorMeshName) !== -1) {
@@ -71660,11 +71713,11 @@ var BABYLON;
             animationPP2.setKeys(vignetteStretchKeys);
             animationPP2.setEasingFunction(easingFunction);
             this._postProcessMove.animations.push(animationPP2);
-            this._postProcessMove.vignetteWeight = 0;
-            this._postProcessMove.vignetteStretch = 0;
-            this._postProcessMove.vignetteEnabled = true;
+            this._scene.imageProcessingConfiguration.vignetteWeight = 0;
+            this._scene.imageProcessingConfiguration.vignetteStretch = 0;
+            this._scene.imageProcessingConfiguration.vignetteEnabled = true;
             this._scene.beginAnimation(this._postProcessMove, 0, 6, false, 1, function () {
-                _this._postProcessMove.vignetteEnabled = false;
+                _this._scene.imageProcessingConfiguration.vignetteEnabled = false;
             });
             this._scene.beginAnimation(this.currentVRCamera, 0, 6, false, 1);
         };
@@ -71744,11 +71797,11 @@ var BABYLON;
             });
             animationPP2.setKeys(vignetteStretchKeys);
             this._postProcessMove.animations.push(animationPP2);
-            this._postProcessMove.vignetteWeight = 8;
-            this._postProcessMove.vignetteStretch = 10;
-            this._postProcessMove.vignetteEnabled = true;
+            this._scene.imageProcessingConfiguration.vignetteWeight = 8;
+            this._scene.imageProcessingConfiguration.vignetteStretch = 10;
+            this._scene.imageProcessingConfiguration.vignetteEnabled = true;
             this._scene.beginAnimation(this._postProcessMove, 0, 11, false, 1, function () {
-                _this._postProcessMove.vignetteEnabled = false;
+                _this._scene.imageProcessingConfiguration.vignetteEnabled = false;
             });
             this._scene.beginAnimation(this.currentVRCamera, 0, 11, false, 1);
         };
@@ -71789,6 +71842,12 @@ var BABYLON;
                 this.exitVR();
             }
             this._deviceOrientationCamera.dispose();
+            if (this._passProcessMove) {
+                this._passProcessMove.dispose();
+            }
+            if (this._postProcessMove) {
+                this._postProcessMove.dispose();
+            }
             if (this._webVRCamera) {
                 this._webVRCamera.dispose();
             }
@@ -71831,7 +71890,6 @@ var BABYLON;
             else {
                 this._leftJoystick = false;
             }
-            this._joystickIndex = VirtualJoystick._globalJoystickIndex;
             VirtualJoystick._globalJoystickIndex++;
             // By default left & right arrow keys are moving the X
             // and up & down keys are moving the Y
@@ -71844,9 +71902,6 @@ var BABYLON;
             this.deltaPosition = BABYLON.Vector3.Zero();
             this._joystickSensibility = 25;
             this._inversedSensibility = 1 / (this._joystickSensibility / 1000);
-            this._rotationSpeed = 25;
-            this._inverseRotationSpeed = 1 / (this._rotationSpeed / 1000);
-            this._rotateOnAxisRelativeToMesh = false;
             this._onResize = function (evt) {
                 VirtualJoystick.vjCanvasWidth = window.innerWidth;
                 VirtualJoystick.vjCanvasHeight = window.innerHeight;
@@ -71855,7 +71910,6 @@ var BABYLON;
                     VirtualJoystick.vjCanvas.height = VirtualJoystick.vjCanvasHeight;
                 }
                 VirtualJoystick.halfWidth = VirtualJoystick.vjCanvasWidth / 2;
-                VirtualJoystick.halfHeight = VirtualJoystick.vjCanvasHeight / 2;
             };
             // injecting a canvas element on top of the canvas 3D game
             if (!VirtualJoystick.vjCanvas) {
@@ -71885,7 +71939,6 @@ var BABYLON;
                 document.body.appendChild(VirtualJoystick.vjCanvas);
             }
             VirtualJoystick.halfWidth = VirtualJoystick.vjCanvas.width / 2;
-            VirtualJoystick.halfHeight = VirtualJoystick.vjCanvas.height / 2;
             this.pressed = false;
             // default joystick color
             this._joystickColor = "cyan";
@@ -71902,9 +71955,6 @@ var BABYLON;
             this._onPointerMoveHandlerRef = function (evt) {
                 _this._onPointerMove(evt);
             };
-            this._onPointerOutHandlerRef = function (evt) {
-                _this._onPointerUp(evt);
-            };
             this._onPointerUpHandlerRef = function (evt) {
                 _this._onPointerUp(evt);
             };
@@ -72366,7 +72416,6 @@ var BABYLON;
     var QuadraticErrorSimplification = /** @class */ (function () {
         function QuadraticErrorSimplification(_mesh) {
             this._mesh = _mesh;
-            this.initialized = false;
             this.syncIterations = 5000;
             this.aggressiveness = 7;
             this.decimationIterations = 100;
@@ -72553,7 +72602,6 @@ var BABYLON;
                     t.error[3] = Math.min(t.error[0], t.error[1], t.error[2]);
                 };
                 BABYLON.AsyncLoop.SyncAsyncForLoop(_this.triangles.length, _this.syncIterations, triangleInit2, function () {
-                    _this.initialized = true;
                     callback();
                 });
             });

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


+ 1 - 5
dist/preview release/inspector/babylon.inspector.d.ts

@@ -762,7 +762,7 @@ declare module INSPECTOR {
          * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
          * @param obj
          */
-        static GetAllLinesPropertiesAsString(obj: any): Array<string>;
+        static GetAllLinesPropertiesAsString(obj: any, dontTakeThis?: Array<string>): Array<string>;
         static Capitalize(str: string): string;
     }
 }
@@ -770,8 +770,6 @@ declare module INSPECTOR {
 declare module INSPECTOR {
     class Scheduler {
         private static _instance;
-        /** The number of the set interval */
-        private _timer;
         /** Is this scheduler in pause ? */
         pause: boolean;
         /** All properties are refreshed every 250ms */
@@ -1247,7 +1245,6 @@ declare module INSPECTOR {
      */
     class SoundInteractions extends AbstractTreeTool {
         private playSound;
-        private b;
         constructor(playSound: ISoundInteractions);
         protected action(): void;
         private _playSound();
@@ -1299,7 +1296,6 @@ declare module INSPECTOR {
      */
     class Info extends AbstractTreeTool {
         private _obj;
-        private _tooltip;
         constructor(obj: IToolInfo);
         protected action(): void;
     }

+ 50 - 44
dist/preview release/inspector/babylon.inspector.js

@@ -301,6 +301,9 @@ var INSPECTOR;
             else {
                 // Create popup
                 var popup = window.open('', 'Babylon.js INSPECTOR', 'toolbar=no,resizable=yes,menubar=no,width=750,height=1000');
+                if (!popup) {
+                    return;
+                }
                 popup.document.title = 'Babylon.js INSPECTOR';
                 // Get the inspector style      
                 var styles = Inspector.DOCUMENT.querySelectorAll('style');
@@ -2386,11 +2389,12 @@ var INSPECTOR;
          * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
          * @param obj
          */
-        Helpers.GetAllLinesPropertiesAsString = function (obj) {
+        Helpers.GetAllLinesPropertiesAsString = function (obj, dontTakeThis) {
+            if (dontTakeThis === void 0) { dontTakeThis = []; }
             var props = [];
             for (var prop in obj) {
                 //No private and no function
-                if (prop.substring(0, 1) !== '_' && typeof obj[prop] !== 'function') {
+                if (dontTakeThis.indexOf(prop) === -1 && prop.substring(0, 1) !== '_' && typeof obj[prop] !== 'function') {
                     props.push(prop);
                 }
             }
@@ -2412,7 +2416,7 @@ var INSPECTOR;
             this.pause = false;
             /** The list of data to update */
             this._updatableProperties = [];
-            this._timer = setInterval(this._update.bind(this), Scheduler.REFRESH_TIME);
+            setInterval(this._update.bind(this), Scheduler.REFRESH_TIME);
         }
         Scheduler.getInstance = function () {
             if (!Scheduler._instance) {
@@ -3193,9 +3197,12 @@ var INSPECTOR;
             _this._panel.appendChild(_this._detailsPanel.toHtml());
             // build propertiesline
             var details = [];
-            var props = INSPECTOR.Helpers.GetAllLinesProperties(_this._inspector.scene);
+            // Remove deprecated properties generating warning in console
+            var dontTakeThis = ['interFramePerfCounter', 'lastFramePerfCounter', 'evaluateActiveMeshesDurationPerfCounter', 'renderDurationPerfCounter', 'particlesDurationPerfCounter', 'spriteDuractionPerfCounter'];
+            var props = INSPECTOR.Helpers.GetAllLinesPropertiesAsString(_this._inspector.scene, dontTakeThis);
             for (var _i = 0, props_1 = props; _i < props_1.length; _i++) {
-                var prop = props_1[_i];
+                var propString = props_1[_i];
+                var prop = new INSPECTOR.PropertyLine(new INSPECTOR.Property(propString, _this._inspector.scene));
                 details.push(prop);
             }
             _this._detailsPanel.details = details;
@@ -3533,61 +3540,61 @@ var INSPECTOR;
             title = INSPECTOR.Helpers.CreateDiv('stat-title2', _this._panel);
             title.textContent = "Count";
             {
-                var elemLabel = _this._createStatLabel("Total meshes", _this._panel);
+                _this._createStatLabel("Total meshes", _this._panel);
                 var elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._scene.meshes.length.toString(); }
                 });
-                elemLabel = _this._createStatLabel("Draw calls", _this._panel);
+                _this._createStatLabel("Draw calls", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._sceneInstrumentation.drawCallsCounter.current.toString(); }
                 });
-                elemLabel = _this._createStatLabel("Total lights", _this._panel);
+                _this._createStatLabel("Total lights", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._scene.lights.length.toString(); }
                 });
-                elemLabel = _this._createStatLabel("Total vertices", _this._panel);
+                _this._createStatLabel("Total vertices", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._scene.getTotalVertices().toString(); }
                 });
-                elemLabel = _this._createStatLabel("Total materials", _this._panel);
+                _this._createStatLabel("Total materials", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._scene.materials.length.toString(); }
                 });
-                elemLabel = _this._createStatLabel("Total textures", _this._panel);
+                _this._createStatLabel("Total textures", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._scene.textures.length.toString(); }
                 });
-                elemLabel = _this._createStatLabel("Active meshes", _this._panel);
+                _this._createStatLabel("Active meshes", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._scene.getActiveMeshes().length.toString(); }
                 });
-                elemLabel = _this._createStatLabel("Active indices", _this._panel);
+                _this._createStatLabel("Active indices", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._scene.getActiveIndices().toString(); }
                 });
-                elemLabel = _this._createStatLabel("Active bones", _this._panel);
+                _this._createStatLabel("Active bones", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._scene.getActiveBones().toString(); }
                 });
-                elemLabel = _this._createStatLabel("Active particles", _this._panel);
+                _this._createStatLabel("Active particles", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
@@ -3597,79 +3604,79 @@ var INSPECTOR;
             title = INSPECTOR.Helpers.CreateDiv('stat-title2', _this._panel);
             title.textContent = "Duration";
             {
-                var elemLabel = _this._createStatLabel("Meshes selection", _this._panel);
+                _this._createStatLabel("Meshes selection", _this._panel);
                 var elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.activeMeshesEvaluationTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("Render targets", _this._panel);
+                _this._createStatLabel("Render targets", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.renderTargetsRenderTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("Particles", _this._panel);
+                _this._createStatLabel("Particles", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.particlesRenderTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("Sprites", _this._panel);
+                _this._createStatLabel("Sprites", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.spritesRenderTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("Animations", _this._panel);
+                _this._createStatLabel("Animations", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.animationsTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("Physics", _this._panel);
+                _this._createStatLabel("Physics", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.physicsTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("Render", _this._panel);
+                _this._createStatLabel("Render", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.renderTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("Frame", _this._panel);
+                _this._createStatLabel("Frame", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.frameTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("Inter-frame", _this._panel);
+                _this._createStatLabel("Inter-frame", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._sceneInstrumentation.interFrameTimeCounter.current); }
                 });
-                elemLabel = _this._createStatLabel("GPU Frame time", _this._panel);
+                _this._createStatLabel("GPU Frame time", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._engineInstrumentation.gpuFrameTimeCounter.current * 0.000001); }
                 });
-                elemLabel = _this._createStatLabel("GPU Frame time (average)", _this._panel);
+                _this._createStatLabel("GPU Frame time (average)", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(_this._engineInstrumentation.gpuFrameTimeCounter.average * 0.000001); }
                 });
-                elemLabel = _this._createStatLabel("Potential FPS", _this._panel);
+                _this._createStatLabel("Potential FPS", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return BABYLON.Tools.Format(1000.0 / _this._sceneInstrumentation.frameTimeCounter.current, 0); }
                 });
-                elemLabel = _this._createStatLabel("Resolution", _this._panel);
+                _this._createStatLabel("Resolution", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
@@ -3679,61 +3686,61 @@ var INSPECTOR;
             title = INSPECTOR.Helpers.CreateDiv('stat-title2', _this._panel);
             title.textContent = "Extensions";
             {
-                var elemLabel = _this._createStatLabel("Std derivatives", _this._panel);
+                _this._createStatLabel("Std derivatives", _this._panel);
                 var elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().standardDerivatives ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("Compressed textures", _this._panel);
+                _this._createStatLabel("Compressed textures", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().s3tc ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("Hardware instances", _this._panel);
+                _this._createStatLabel("Hardware instances", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().instancedArrays ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("Texture float", _this._panel);
+                _this._createStatLabel("Texture float", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().textureFloat ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("32bits indices", _this._panel);
+                _this._createStatLabel("32bits indices", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().uintIndices ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("Fragment depth", _this._panel);
+                _this._createStatLabel("Fragment depth", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().fragmentDepthSupported ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("High precision shaders", _this._panel);
+                _this._createStatLabel("High precision shaders", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().highPrecisionShaderSupported ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("Draw buffers", _this._panel);
+                _this._createStatLabel("Draw buffers", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().drawBuffersExtension ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("Vertex array object", _this._panel);
+                _this._createStatLabel("Vertex array object", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.getCaps().vertexArrayObject ? "Yes" : "No"); }
                 });
-                elemLabel = _this._createStatLabel("Timer query", _this._panel);
+                _this._createStatLabel("Timer query", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
@@ -3743,25 +3750,25 @@ var INSPECTOR;
             title = INSPECTOR.Helpers.CreateDiv('stat-title2', _this._panel);
             title.textContent = "Caps.";
             {
-                var elemLabel = _this._createStatLabel("Stencil", _this._panel);
+                _this._createStatLabel("Stencil", _this._panel);
                 var elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return (_this._engine.isStencilEnable ? "Enabled" : "Disabled"); }
                 });
-                elemLabel = _this._createStatLabel("Max textures units", _this._panel);
+                _this._createStatLabel("Max textures units", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._engine.getCaps().maxTexturesImageUnits.toString(); }
                 });
-                elemLabel = _this._createStatLabel("Max textures size", _this._panel);
+                _this._createStatLabel("Max textures size", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
                     updateFct: function () { return _this._engine.getCaps().maxTextureSize.toString(); }
                 });
-                elemLabel = _this._createStatLabel("Max anisotropy", _this._panel);
+                _this._createStatLabel("Max anisotropy", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({
                     elem: elemValue,
@@ -4768,7 +4775,6 @@ var INSPECTOR;
         function SoundInteractions(playSound) {
             var _this = _super.call(this) || this;
             _this.playSound = playSound;
-            _this.b = false;
             _this._elem.classList.add('fa-play');
             return _this;
         }
@@ -4907,7 +4913,7 @@ var INSPECTOR;
             var _this = _super.call(this) || this;
             _this._obj = obj;
             _this._elem.classList.add('fa-info-circle');
-            _this._tooltip = new INSPECTOR.Tooltip(_this._elem, _this._obj.getInfo(), _this._elem);
+            new INSPECTOR.Tooltip(_this._elem, _this._obj.getInfo(), _this._elem);
             return _this;
         }
         // Nothing to do on click

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 4 - 4
dist/preview release/inspector/babylon.inspector.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/materialsLibrary/babylon.skyMaterial.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/materialsLibrary/babylon.skyMaterial.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/materialsLibrary/babylonjs.materials.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/materialsLibrary/babylonjs.materials.min.js


+ 3 - 0
inspector/src/Inspector.ts

@@ -369,6 +369,9 @@ module INSPECTOR {
             } else {
                 // Create popup
                 let popup = window.open('', 'Babylon.js INSPECTOR', 'toolbar=no,resizable=yes,menubar=no,width=750,height=1000');
+                if (!popup) {
+                    return;
+                }
                 popup.document.title = 'Babylon.js INSPECTOR';
                 // Get the inspector style      
                 let styles = Inspector.DOCUMENT.querySelectorAll('style');

+ 5 - 5
inspector/src/helpers/Helpers.ts

@@ -153,17 +153,17 @@ module INSPECTOR {
         public static LoadScript() {
             BABYLON.Tools.LoadFile("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js", (elem) => {
                 let script = Helpers.CreateElement('script', '', Inspector.DOCUMENT.body);
-                script.textContent = elem;
+                script.textContent = elem as string;
 
                 // Load glsl detection
                 BABYLON.Tools.LoadFile("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/languages/glsl.min.js", (elem) => {
                     let script = Helpers.CreateElement('script', '', Inspector.DOCUMENT.body);
-                    script.textContent = elem;
+                    script.textContent = elem as string;
 
                     // Load css style
                     BABYLON.Tools.LoadFile("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/styles/zenburn.min.css", (elem) => {
                         let style = Helpers.CreateElement('style', '', Inspector.DOCUMENT.body);
-                        style.textContent = elem;
+                        style.textContent = elem as string;
                     });
                 }, undefined, undefined, undefined, () => {
                     console.log("erreur");
@@ -202,12 +202,12 @@ module INSPECTOR {
          * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
          * @param obj 
          */
-        public static GetAllLinesPropertiesAsString(obj: any): Array<string> {
+        public static GetAllLinesPropertiesAsString(obj: any, dontTakeThis: Array<string> = []): Array<string> {
             let props: Array<string> = [];
 
             for (let prop in obj) {
                 //No private and no function
-                if (prop.substring(0, 1) !== '_' && typeof obj[prop] !== 'function') {
+                if (dontTakeThis.indexOf(prop) === -1 && prop.substring(0, 1) !== '_' && typeof obj[prop] !== 'function') {
                     props.push(prop);
                 }
             }

+ 3 - 5
inspector/src/scheduler/Scheduler.ts

@@ -4,19 +4,17 @@ module INSPECTOR {
 
         private static _instance: Scheduler;
 
-        /** The number of the set interval */
-        private _timer          : number;
         /** Is this scheduler in pause ? */
-        public pause            : boolean = false;
+        public pause: boolean = false;
 
         /** All properties are refreshed every 250ms */
-        public static REFRESH_TIME  : number = 250;
+        public static REFRESH_TIME: number = 250;
 
         /** The list of data to update */
         private _updatableProperties: Array<PropertyLine> = [];
 
         constructor () {
-            this._timer = setInterval(this._update.bind(this), Scheduler.REFRESH_TIME);
+            setInterval(this._update.bind(this), Scheduler.REFRESH_TIME);
         }
 
         public static getInstance() : Scheduler {

+ 6 - 2
inspector/src/tabs/SceneTab.ts

@@ -27,8 +27,12 @@ module INSPECTOR {
 
             // build propertiesline
             let details = [];
-            let props = Helpers.GetAllLinesProperties(this._inspector.scene);
-            for (let prop of props) {
+            // Remove deprecated properties generating warning in console
+            let dontTakeThis = ['interFramePerfCounter', 'lastFramePerfCounter', 'evaluateActiveMeshesDurationPerfCounter', 'renderDurationPerfCounter', 'particlesDurationPerfCounter', 'spriteDuractionPerfCounter'];
+            let props = Helpers.GetAllLinesPropertiesAsString(this._inspector.scene, dontTakeThis);
+
+            for (let propString of props) {
+                let prop = new PropertyLine(new Property(propString, this._inspector.scene));
                 details.push(prop);
             }
             this._detailsPanel.details = details;

+ 189 - 189
inspector/src/tabs/StatsTab.ts

@@ -2,19 +2,19 @@ module INSPECTOR {
 
     export class StatsTab extends Tab {
 
-        private _inspector : Inspector;
+        private _inspector: Inspector;
 
         /** 
          * Properties in this array will be updated
          * in a render loop - Mostly stats properties
          */
-        private _updatableProperties : Array<{elem:HTMLElement, updateFct : () => string}> = [];
+        private _updatableProperties: Array<{ elem: HTMLElement, updateFct: () => string }> = [];
 
-        private _scene : BABYLON.Scene;
-        private _engine : BABYLON.Engine;
-        private _glInfo : any;
+        private _scene: BABYLON.Scene;
+        private _engine: BABYLON.Engine;
+        private _glInfo: any;
 
-        private _updateLoopHandler : any;
+        private _updateLoopHandler: any;
 
         private _sceneInstrumentation: BABYLON.Nullable<BABYLON.SceneInstrumentation>;
         private _engineInstrumentation: BABYLON.Nullable<BABYLON.EngineInstrumentation>;
@@ -39,298 +39,298 @@ module INSPECTOR {
             this._engineInstrumentation.captureGPUFrameTime = true;
         }
 
-        constructor(tabbar:TabBar, insp:Inspector) {
-            super(tabbar, 'Stats');        
+        constructor(tabbar: TabBar, insp: Inspector) {
+            super(tabbar, 'Stats');
 
-            this._inspector         = insp;  
+            this._inspector = insp;
 
-            this._scene             = this._inspector.scene;
-            this._engine            = this._scene.getEngine();
-            this._glInfo            = this._engine.getGlInfo();
+            this._scene = this._inspector.scene;
+            this._engine = this._scene.getEngine();
+            this._glInfo = this._engine.getGlInfo();
 
             this._connectToInstrumentation();
 
             // Build the stats panel: a div that will contains all stats
-            this._panel             = Helpers.CreateDiv('tab-panel') as HTMLDivElement; 
+            this._panel = Helpers.CreateDiv('tab-panel') as HTMLDivElement;
             this._panel.classList.add("stats-panel")
-            
-            let title               = Helpers.CreateDiv('stat-title1', this._panel);
-            let fpsSpan             = Helpers.CreateElement('span', 'stats-fps');
-            this._updatableProperties.push({ 
-                elem:fpsSpan, 
-                updateFct:() => { return BABYLON.Tools.Format(this._inspector.scene.getEngine().getFps(), 0) + " fps"}
+
+            let title = Helpers.CreateDiv('stat-title1', this._panel);
+            let fpsSpan = Helpers.CreateElement('span', 'stats-fps');
+            this._updatableProperties.push({
+                elem: fpsSpan,
+                updateFct: () => { return BABYLON.Tools.Format(this._inspector.scene.getEngine().getFps(), 0) + " fps" }
             });
-                
+
             let versionSpan = Helpers.CreateElement('span');
             versionSpan.textContent = `Babylon.js v${BABYLON.Engine.Version} - `;
             title.appendChild(versionSpan);
             title.appendChild(fpsSpan);
-                        
+
             this._updateLoopHandler = this._update.bind(this);
 
             // Count block
             title = Helpers.CreateDiv('stat-title2', this._panel);
             title.textContent = "Count";
-            {                
-                let elemLabel = this._createStatLabel("Total meshes", this._panel);
+            {
+                this._createStatLabel("Total meshes", this._panel);
                 let elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.meshes.length.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.meshes.length.toString() }
                 });
 
-                elemLabel = this._createStatLabel("Draw calls", this._panel);
+                this._createStatLabel("Draw calls", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._sceneInstrumentation!.drawCallsCounter.current.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._sceneInstrumentation!.drawCallsCounter.current.toString() }
                 });
 
-                elemLabel = this._createStatLabel("Total lights", this._panel);
+                this._createStatLabel("Total lights", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.lights.length.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.lights.length.toString() }
                 });
 
-                elemLabel = this._createStatLabel("Total vertices", this._panel);
+                this._createStatLabel("Total vertices", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.getTotalVertices().toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.getTotalVertices().toString() }
                 });
 
-                elemLabel = this._createStatLabel("Total materials", this._panel);
+                this._createStatLabel("Total materials", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.materials.length.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.materials.length.toString() }
                 });
 
-                elemLabel = this._createStatLabel("Total textures", this._panel);
+                this._createStatLabel("Total textures", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.textures.length.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.textures.length.toString() }
                 });
 
-                elemLabel = this._createStatLabel("Active meshes", this._panel);
+                this._createStatLabel("Active meshes", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.getActiveMeshes().length.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.getActiveMeshes().length.toString() }
                 });
 
-                elemLabel = this._createStatLabel("Active indices", this._panel);
+                this._createStatLabel("Active indices", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.getActiveIndices().toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.getActiveIndices().toString() }
                 });
 
-                elemLabel = this._createStatLabel("Active bones", this._panel);
+                this._createStatLabel("Active bones", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.getActiveBones().toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.getActiveBones().toString() }
                 });
 
-                elemLabel = this._createStatLabel("Active particles", this._panel);
+                this._createStatLabel("Active particles", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._scene.getActiveParticles().toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._scene.getActiveParticles().toString() }
                 });
-            }            
-            
+            }
+
             title = Helpers.CreateDiv('stat-title2', this._panel);
             title.textContent = "Duration";
             {
-                let elemLabel = this._createStatLabel("Meshes selection", this._panel);
+                this._createStatLabel("Meshes selection", this._panel);
                 let elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.activeMeshesEvaluationTimeCounter.current)}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.activeMeshesEvaluationTimeCounter.current) }
                 });
-                elemLabel = this._createStatLabel("Render targets", this._panel);
+                this._createStatLabel("Render targets", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.renderTargetsRenderTimeCounter.current)}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.renderTargetsRenderTimeCounter.current) }
                 });
-                elemLabel = this._createStatLabel("Particles", this._panel);
+                this._createStatLabel("Particles", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.particlesRenderTimeCounter.current)}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.particlesRenderTimeCounter.current) }
                 });
-                elemLabel = this._createStatLabel("Sprites", this._panel);
+                this._createStatLabel("Sprites", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.spritesRenderTimeCounter.current)}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.spritesRenderTimeCounter.current) }
                 });
-                elemLabel = this._createStatLabel("Animations", this._panel);
+                this._createStatLabel("Animations", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.animationsTimeCounter.current)}
-                });                       
-                elemLabel = this._createStatLabel("Physics", this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.animationsTimeCounter.current) }
+                });
+                this._createStatLabel("Physics", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.physicsTimeCounter.current)}
-                });                
-                elemLabel = this._createStatLabel("Render", this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.physicsTimeCounter.current) }
+                });
+                this._createStatLabel("Render", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.renderTimeCounter.current)}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.renderTimeCounter.current) }
                 });
-                elemLabel = this._createStatLabel("Frame", this._panel);
+                this._createStatLabel("Frame", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.frameTimeCounter.current)}
-                });                
-                elemLabel = this._createStatLabel("Inter-frame", this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.frameTimeCounter.current) }
+                });
+                this._createStatLabel("Inter-frame", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._sceneInstrumentation!.interFrameTimeCounter.current)}
-                });       
-                elemLabel = this._createStatLabel("GPU Frame time", this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._sceneInstrumentation!.interFrameTimeCounter.current) }
+                });
+                this._createStatLabel("GPU Frame time", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._engineInstrumentation!.gpuFrameTimeCounter.current * 0.000001)}
-                });                  
-                elemLabel = this._createStatLabel("GPU Frame time (average)", this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._engineInstrumentation!.gpuFrameTimeCounter.current * 0.000001) }
+                });
+                this._createStatLabel("GPU Frame time (average)", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(this._engineInstrumentation!.gpuFrameTimeCounter.average * 0.000001)}
-                });                                 
-                elemLabel = this._createStatLabel("Potential FPS", this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(this._engineInstrumentation!.gpuFrameTimeCounter.average * 0.000001) }
+                });
+                this._createStatLabel("Potential FPS", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return BABYLON.Tools.Format(1000.0 / this._sceneInstrumentation!.frameTimeCounter.current, 0)}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return BABYLON.Tools.Format(1000.0 / this._sceneInstrumentation!.frameTimeCounter.current, 0) }
                 });
-                elemLabel = this._createStatLabel("Resolution", this._panel);
+                this._createStatLabel("Resolution", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._engine.getRenderWidth() + "x" + this._engine.getRenderHeight()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._engine.getRenderWidth() + "x" + this._engine.getRenderHeight() }
                 });
             }
-            
+
             title = Helpers.CreateDiv('stat-title2', this._panel);
             title.textContent = "Extensions";
             {
-                let elemLabel = this._createStatLabel("Std derivatives", this._panel);
+                this._createStatLabel("Std derivatives", this._panel);
                 let elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().standardDerivatives ? "Yes" : "No")}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().standardDerivatives ? "Yes" : "No") }
                 });
-                elemLabel = this._createStatLabel("Compressed textures", this._panel);
+                this._createStatLabel("Compressed textures", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().s3tc ? "Yes" : "No")}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().s3tc ? "Yes" : "No") }
                 });
-                elemLabel = this._createStatLabel("Hardware instances", this._panel);
+                this._createStatLabel("Hardware instances", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().instancedArrays ? "Yes" : "No")}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().instancedArrays ? "Yes" : "No") }
                 });
-                elemLabel = this._createStatLabel("Texture float", this._panel);
+                this._createStatLabel("Texture float", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().textureFloat ? "Yes" : "No")}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().textureFloat ? "Yes" : "No") }
                 });
-                elemLabel = this._createStatLabel("32bits indices", this._panel);
+                this._createStatLabel("32bits indices", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().uintIndices ? "Yes" : "No")}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().uintIndices ? "Yes" : "No") }
                 });
-                elemLabel = this._createStatLabel("Fragment depth", this._panel);
+                this._createStatLabel("Fragment depth", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().fragmentDepthSupported ? "Yes" : "No")}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().fragmentDepthSupported ? "Yes" : "No") }
                 });
-                elemLabel = this._createStatLabel("High precision shaders", this._panel);
+                this._createStatLabel("High precision shaders", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().highPrecisionShaderSupported ? "Yes" : "No")}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().highPrecisionShaderSupported ? "Yes" : "No") }
                 });
-                elemLabel = this._createStatLabel("Draw buffers", this._panel);
+                this._createStatLabel("Draw buffers", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().drawBuffersExtension ? "Yes" : "No")}
-                });                 
-                elemLabel = this._createStatLabel("Vertex array object", this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().drawBuffersExtension ? "Yes" : "No") }
+                });
+                this._createStatLabel("Vertex array object", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().vertexArrayObject ? "Yes" : "No")}
-                }); 
-                elemLabel = this._createStatLabel("Timer query", this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().vertexArrayObject ? "Yes" : "No") }
+                });
+                this._createStatLabel("Timer query", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.getCaps().timerQuery ? "Yes" : "No")}
-                });                 
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.getCaps().timerQuery ? "Yes" : "No") }
+                });
             }
 
             title = Helpers.CreateDiv('stat-title2', this._panel);
             title.textContent = "Caps.";
             {
-                let elemLabel = this._createStatLabel("Stencil", this._panel);
+                this._createStatLabel("Stencil", this._panel);
                 let elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return (this._engine.isStencilEnable ? "Enabled" : "Disabled")}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return (this._engine.isStencilEnable ? "Enabled" : "Disabled") }
                 });
-                elemLabel = this._createStatLabel("Max textures units", this._panel);
+                this._createStatLabel("Max textures units", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._engine.getCaps().maxTexturesImageUnits.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._engine.getCaps().maxTexturesImageUnits.toString() }
                 });
-                elemLabel = this._createStatLabel("Max textures size", this._panel);
+                this._createStatLabel("Max textures size", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._engine.getCaps().maxTextureSize.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._engine.getCaps().maxTextureSize.toString() }
                 });
-                elemLabel = this._createStatLabel("Max anisotropy", this._panel);
+                this._createStatLabel("Max anisotropy", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return this._engine.getCaps().maxAnisotropy.toString()}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._engine.getCaps().maxAnisotropy.toString() }
                 });
             }
             title = Helpers.CreateDiv('stat-title2', this._panel);
             title.textContent = "Info";
             {
                 let elemValue = Helpers.CreateDiv('stat-infos', this._panel);
-                this._updatableProperties.push({ 
-                    elem:elemValue, 
-                    updateFct:() => { return "WebGL v" + this._engine.webGLVersion + " - " + this._glInfo.version + " - "+this._glInfo.renderer}
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return "WebGL v" + this._engine.webGLVersion + " - " + this._glInfo.version + " - " + this._glInfo.renderer }
                 });
             }
         }
-        
-        private _createStatLabel(content:string, parent: HTMLElement) : HTMLElement {
+
+        private _createStatLabel(content: string, parent: HTMLElement): HTMLElement {
             let elem = Helpers.CreateDiv('stat-label', parent);
             elem.textContent = content;
             return elem;
@@ -351,9 +351,9 @@ module INSPECTOR {
             this._engineInstrumentation = null;
         }
 
-        public active(b: boolean){
+        public active(b: boolean) {
             super.active(b);
-            if (b){
+            if (b) {
                 this._connectToInstrumentation();
                 this._scene.registerAfterRender(this._updateLoopHandler);
             }

+ 2 - 4
inspector/src/treetools/Info.ts

@@ -11,16 +11,14 @@ module INSPECTOR{
      */
     export class Info extends AbstractTreeTool{
 
-        private _obj : IToolInfo;
-
-        private _tooltip : Tooltip;
+        private _obj: IToolInfo;
 
         constructor(obj:IToolInfo) {
             super (); 
             this._obj = obj;
             this._elem.classList.add('fa-info-circle');
 
-            this._tooltip = new Tooltip(this._elem, this._obj.getInfo(), this._elem);
+            new Tooltip(this._elem, this._obj.getInfo(), this._elem);
         }
 
         // Nothing to do on click

+ 0 - 2
inspector/src/treetools/SoundInteractions.ts

@@ -9,12 +9,10 @@ module INSPECTOR {
      */
     export class SoundInteractions extends AbstractTreeTool {
         private playSound: ISoundInteractions;
-        private b: boolean;
 
         constructor(playSound: ISoundInteractions) {
             super();
             this.playSound = playSound;
-            this.b = false;
             this._elem.classList.add('fa-play');
         }
 

+ 2 - 2
loaders/src/glTF/1.0/babylon.glTFLoader.ts

@@ -1282,7 +1282,7 @@ module BABYLON.GLTF1 {
                 setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(buffer.uri))));
             }
             else {
-                Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data)), onProgress, undefined, true, request => {
+                Tools.LoadFile(gltfRuntime.rootUrl + buffer.uri, data => onSuccess(new Uint8Array(data as ArrayBuffer)), onProgress, undefined, true, request => {
                     if (request) {
                         onError(request.status + " " + request.statusText);
                     }
@@ -1309,7 +1309,7 @@ module BABYLON.GLTF1 {
                 setTimeout(() => onSuccess(new Uint8Array(GLTFUtils.DecodeBase64(source.uri))));
             }
             else {
-                Tools.LoadFile(gltfRuntime.rootUrl + source.uri, data => onSuccess(new Uint8Array(data)), undefined, undefined, true, request => {
+                Tools.LoadFile(gltfRuntime.rootUrl + source.uri, data => onSuccess(new Uint8Array(data as ArrayBuffer)), undefined, undefined, true, request => {
                     if (request) {
                         onError(request.status + " " + request.statusText);
                     }

+ 1 - 1
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -1558,7 +1558,7 @@ module BABYLON.GLTF2 {
 
             let request = Tools.LoadFile(this._rootUrl + uri, data => {
                 this._tryCatchOnError(() => {
-                    onSuccess(new Uint8Array(data));
+                    onSuccess(new Uint8Array(data as ArrayBuffer));
                 });
             }, event => {
                 this._tryCatchOnError(() => {

+ 2 - 2
materialsLibrary/src/sky/sky.fragment.fx

@@ -71,7 +71,7 @@ float hgPhase(float cosTheta, float g)
 
 float sunIntensity(float zenithAngleCos)
 {
-	return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));
+	return EE * max(0.0, 1.0 - exp((-(cutoffAngle - acos(zenithAngleCos))/steepness)));
 }
 
 float A = 0.15;
@@ -167,4 +167,4 @@ void main(void) {
 #include<fogFragment>
 
 	gl_FragColor = color;
-}
+}

+ 13 - 0
package-lock.json

@@ -0,0 +1,13 @@
+{
+    "name": "babylonjs",
+    "version": "3.1.0-beta5",
+    "lockfileVersion": 1,
+    "requires": true,
+    "dependencies": {
+        "cannon": {
+            "version": "0.6.2",
+            "resolved": "https://registry.npmjs.org/cannon/-/cannon-0.6.2.tgz",
+            "integrity": "sha1-HnvHLdWEGYLzwQTCvFeL+k+xxXI="
+        }
+    }
+}

+ 1 - 1
package.json

@@ -67,4 +67,4 @@
     "readmeFilename": "README.md",
     "_id": "babylonjs@3.1.0-alpha2",
     "_from": "babylonjs@"
-}
+}

+ 4 - 6
src/Audio/babylon.sound.ts

@@ -19,7 +19,6 @@ module BABYLON {
         private _position: Vector3 = Vector3.Zero();
         private _localDirection: Vector3 = new Vector3(1, 0, 0);
         private _volume: number = 1;
-        private _isLoaded: boolean = false;
         private _isReadyToPlay: boolean = false;
         public isPlaying: boolean = false;
         public isPaused: boolean = false;
@@ -98,9 +97,9 @@ module BABYLON {
                     if (Array.isArray(urlOrArrayBuffer)) this._urlType = "Array";
                     if (urlOrArrayBuffer instanceof ArrayBuffer) this._urlType = "ArrayBuffer";
 
-                    var urls:string[] = [];
+                    var urls: string[] = [];
                     var codecSupportedFound = false;
- 
+
                     switch (this._urlType) {
                         case "ArrayBuffer":
                             if ((<ArrayBuffer>urlOrArrayBuffer).byteLength > 0) {
@@ -130,7 +129,7 @@ module BABYLON {
                                 if (codecSupportedFound) {
                                     // Loading sound using XHR2
                                     if (!this._streaming) {
-                                        Tools.LoadFile(url, (data) => { this._soundLoaded(data); }, undefined, this._scene.database, true);
+                                        Tools.LoadFile(url, (data) => { this._soundLoaded(data as ArrayBuffer); }, undefined, this._scene.database, true);
                                     }
                                     // Streaming sound using HTML5 Audio tag
                                     else {
@@ -239,7 +238,6 @@ module BABYLON {
         }
 
         private _soundLoaded(audioData: ArrayBuffer) {
-            this._isLoaded = true;
             if (!Engine.audioEngine.audioContext) {
                 return;
             }
@@ -482,7 +480,7 @@ module BABYLON {
                 else if (Engine.audioEngine.audioContext && this._soundSource) {
                     var stopTime = time ? Engine.audioEngine.audioContext.currentTime + time : Engine.audioEngine.audioContext.currentTime;
                     this._soundSource.stop(stopTime);
-                    this._soundSource.onended = () => {};
+                    this._soundSource.onended = () => { };
                     if (!this.isPaused) {
                         this._startOffset = 0;
                     }

+ 1 - 6
src/Cameras/Inputs/babylon.arcRotateCameraVRDeviceOrientationInput.ts

@@ -7,7 +7,6 @@ module BABYLON {
         public gammaCorrection = 1;
 
         private _alpha = 0;
-        private _beta = 0;
         private _gamma = 0;
         private _dirty = false;
 
@@ -27,11 +26,7 @@ module BABYLON {
                 this._alpha = +evt.alpha | 0;
             }
 
-            if (evt.beta !== null) {
-                this._beta = +evt.beta | 0;
-            }
-
-            if (evt.gamma !== null) {               
+            if (evt.gamma !== null) {
                 this._gamma = +evt.gamma | 0;
             }
             this._dirty = true;

+ 2 - 3
src/Cameras/Inputs/babylon.freeCameraTouchInput.ts

@@ -4,7 +4,7 @@ module BABYLON {
 
         private _offsetX: Nullable<number> = null;
         private _offsetY: Nullable<number> = null;
-        private _pointerCount: number = 0;
+
         private _pointerPressed = new Array<number>();
         private _pointerInput: (p: PointerInfo, s: EventState) => void;
         private _observer: Nullable<Observer<PointerInfo>>;
@@ -17,7 +17,7 @@ module BABYLON {
         public touchMoveSensibility: number = 250.0;
 
         attachControl(element: HTMLElement, noPreventDefault?: boolean) {
-            var previousPosition: Nullable<{x: number, y: number}> = null;
+            var previousPosition: Nullable<{ x: number, y: number }> = null;
 
             if (this._pointerInput === undefined) {
                 this._onLostFocus = (evt) => {
@@ -112,7 +112,6 @@ module BABYLON {
                 this._pointerPressed = [];
                 this._offsetX = null;
                 this._offsetY = null;
-                this._pointerCount = 0;
             }
         }
 

+ 32 - 25
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -50,6 +50,7 @@ module BABYLON {
         private _rotationLeftAsked = false;
         private _teleportationCircle: BABYLON.Mesh;
         private _postProcessMove: ImageProcessingPostProcess;
+        private _passProcessMove: PassPostProcess;
         private _teleportationFillColor: string = "#444444";
         private _teleportationBorderColor: string = "#FFFFFF";
         private _rotationAngle: number = 0;
@@ -301,7 +302,7 @@ module BABYLON {
                 if (!this._webVRpresenting) {
                     this._webVRCamera.position = this._position;
                     this._scene.activeCamera = this._webVRCamera;
-                    this._scene.imageProcessingConfiguration.applyByPostProcess = true; 
+                    this._scene.imageProcessingConfiguration.isEnabled = true;
                 }
             }
             else {
@@ -332,13 +333,13 @@ module BABYLON {
             }
             this._deviceOrientationCamera.position = this._position;
             this._scene.activeCamera = this._deviceOrientationCamera;
+            this._scene.imageProcessingConfiguration.isEnabled = false;
 
             if (this._canvas) {
                 this._scene.activeCamera.attachControl(this._canvas);
             }
 
-            this.updateButtonVisibility();
-            this._scene.imageProcessingConfiguration.applyByPostProcess = false; 
+            this.updateButtonVisibility();  
         }
 
         public get position(): Vector3 {
@@ -370,13 +371,10 @@ module BABYLON {
             }
 
             this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera);
-            this._postProcessMove.vignetteWeight = 0;
-            this._postProcessMove.vignetteStretch = 0;
-            this._postProcessMove.vignetteColor = new BABYLON.Color4(0, 0, 0, 0);
-            this._postProcessMove.vignetteEnabled = false;
-            new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
-            this._postProcessMove.imageProcessingConfiguration = new ImageProcessingConfiguration(); 
-            this._scene.imageProcessingConfiguration.applyByPostProcess = false; 
+            this._passProcessMove = new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
+            this._scene.imageProcessingConfiguration.vignetteColor = new BABYLON.Color4(0, 0, 0, 0);
+            this._scene.imageProcessingConfiguration.vignetteEnabled = true;      
+            this._scene.imageProcessingConfiguration.isEnabled = false;      
 
             this._createTeleportationCircles();
 
@@ -569,7 +567,7 @@ module BABYLON {
         
             this.currentVRCamera.animations.push(animationRotation);
         
-            (<any>this._postProcessMove).animations = [];
+            this._postProcessMove.animations = [];
         
             var animationPP = new BABYLON.Animation("animationPP", "vignetteWeight", 90, BABYLON.Animation.ANIMATIONTYPE_FLOAT,
                 BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
@@ -590,7 +588,7 @@ module BABYLON {
         
             animationPP.setKeys(vignetteWeightKeys);
             animationPP.setEasingFunction(easingFunction);
-            (<any>this._postProcessMove).animations.push(animationPP);
+            this._postProcessMove.animations.push(animationPP);
         
             var animationPP2 = new BABYLON.Animation("animationPP2", "vignetteStretch", 90, BABYLON.Animation.ANIMATIONTYPE_FLOAT,
                 BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
@@ -611,14 +609,14 @@ module BABYLON {
         
             animationPP2.setKeys(vignetteStretchKeys);
             animationPP2.setEasingFunction(easingFunction);
-            (<any>this._postProcessMove).animations.push(animationPP2);
+            this._postProcessMove.animations.push(animationPP2);
             
-            this._postProcessMove.vignetteWeight = 0;
-            this._postProcessMove.vignetteStretch = 0;
-            this._postProcessMove.vignetteEnabled = true;
+            this._scene.imageProcessingConfiguration.vignetteWeight = 0;
+            this._scene.imageProcessingConfiguration.vignetteStretch = 0;
+            this._scene.imageProcessingConfiguration.vignetteEnabled = true;
         
             this._scene.beginAnimation(this._postProcessMove, 0, 6, false, 1, () => {
-                this._postProcessMove.vignetteEnabled = false;
+                this._scene.imageProcessingConfiguration.vignetteEnabled = false;
             });
             this._scene.beginAnimation(this.currentVRCamera, 0, 6, false, 1);
         }
@@ -679,7 +677,7 @@ module BABYLON {
         
             this.currentVRCamera.animations.push(animationZoomIn2);
         
-            (<any>this._postProcessMove).animations = [];
+            this._postProcessMove.animations = [];
         
             var animationPP = new BABYLON.Animation("animationPP", "vignetteWeight", 90, BABYLON.Animation.ANIMATIONTYPE_FLOAT,
                 BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
@@ -699,7 +697,7 @@ module BABYLON {
             });
         
             animationPP.setKeys(vignetteWeightKeys);
-            (<any>this._postProcessMove).animations.push(animationPP);
+            this._postProcessMove.animations.push(animationPP);
         
             var animationPP2 = new BABYLON.Animation("animationPP2", "vignetteStretch", 90, BABYLON.Animation.ANIMATIONTYPE_FLOAT,
                 BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
@@ -719,14 +717,14 @@ module BABYLON {
             });
         
             animationPP2.setKeys(vignetteStretchKeys);
-            (<any>this._postProcessMove).animations.push(animationPP2);
+            this._postProcessMove.animations.push(animationPP2);
         
-            this._postProcessMove.vignetteWeight = 8;
-            this._postProcessMove.vignetteStretch = 10;
-            this._postProcessMove.vignetteEnabled = true;
-         
+            this._scene.imageProcessingConfiguration.vignetteWeight = 8;
+            this._scene.imageProcessingConfiguration.vignetteStretch = 10;
+            this._scene.imageProcessingConfiguration.vignetteEnabled = true;
+            
             this._scene.beginAnimation(this._postProcessMove, 0, 11, false, 1, () => {
-                this._postProcessMove.vignetteEnabled = false;
+                this._scene.imageProcessingConfiguration.vignetteEnabled = false;
             });
             this._scene.beginAnimation(this.currentVRCamera, 0, 11, false, 1);
         }
@@ -772,6 +770,15 @@ module BABYLON {
                 this.exitVR();
             }
             this._deviceOrientationCamera.dispose();
+
+            if (this._passProcessMove) {
+                this._passProcessMove.dispose();
+            }
+
+            if (this._postProcessMove) {
+                this._postProcessMove.dispose();
+            }
+
             if (this._webVRCamera) {
                 this._webVRCamera.dispose();
             }

+ 2 - 5
src/Collisions/babylon.collisionCoordinator.ts

@@ -115,7 +115,6 @@ module BABYLON {
 
         private _init: boolean;
         private _runningUpdated: number;
-        private _runningCollisionTask: boolean;
         private _worker: Worker;
 
         private _addUpdateMeshesList: { [n: number]: SerializedMesh; }
@@ -127,7 +126,6 @@ module BABYLON {
             this._collisionsCallbackArray = [];
             this._init = false;
             this._runningUpdated = 0;
-            this._runningCollisionTask = false;
 
             this._addUpdateMeshesList = {};
             this._addUpdateGeometriesList = {};
@@ -332,7 +330,6 @@ module BABYLON {
                     this._runningUpdated--;
                     break;
                 case WorkerTaskType.COLLIDE:
-                    this._runningCollisionTask = false;
                     var returnPayload: CollisionReplyPayload = returnData.payload;
                     if (!this._collisionsCallbackArray[returnPayload.collisionId]) return;
 
@@ -345,7 +342,7 @@ module BABYLON {
                             callback(returnPayload.collisionId, Vector3.FromArray(returnPayload.newPosition), mesh);
                         }
                     }
-                    
+
                     //cleanup
                     this._collisionsCallbackArray[returnPayload.collisionId] = null;
                     break;
@@ -408,7 +405,7 @@ module BABYLON {
             // Check all meshes
             for (var index = 0; index < this._scene.meshes.length; index++) {
                 var mesh = this._scene.meshes[index];
-                if (mesh.isEnabled() && mesh.checkCollisions && mesh.subMeshes && mesh !== excludedMesh &&  ((collisionMask & mesh.collisionGroup) !== 0)) {
+                if (mesh.isEnabled() && mesh.checkCollisions && mesh.subMeshes && mesh !== excludedMesh && ((collisionMask & mesh.collisionGroup) !== 0)) {
                     mesh._checkCollision(collider);
                 }
             }

+ 122 - 58
src/Engine/babylon.engine.ts

@@ -116,20 +116,20 @@
         }
     }
 
-    var partialLoad = (url: string, index: number, loadedImages: any, scene: Nullable<Scene>,
+    var partialLoadImg = (url: string, index: number, loadedImages: HTMLImageElement[], scene: Nullable<Scene>,
         onfinish: (images: HTMLImageElement[]) => void, onErrorCallBack: Nullable<(message?: string, exception?: any) => void> = null) => {
 
         var img: HTMLImageElement;
 
         var onload = () => {
             loadedImages[index] = img;
-            loadedImages._internalCount++;
+            (<any>loadedImages)._internalCount++;
 
             if (scene) {
                 scene._removePendingData(img);
             }
 
-            if (loadedImages._internalCount === 6) {
+            if ((<any>loadedImages)._internalCount === 6) {
                 onfinish(loadedImages);
             }
         };
@@ -150,14 +150,46 @@
         }
     }
 
-    var cascadeLoad = (rootUrl: string, scene: Nullable<Scene>,
+    var cascadeLoadImgs = (rootUrl: string, scene: Nullable<Scene>,
         onfinish: (images: HTMLImageElement[]) => void, files: string[], onError: Nullable<(message?: string, exception?: any) => void> = null) => {
 
-        var loadedImages: any = [];
-        loadedImages._internalCount = 0;
+        var loadedImages: HTMLImageElement[] = [];
+        (<any>loadedImages)._internalCount = 0;
 
-        for (var index = 0; index < 6; index++) {
-            partialLoad(files[index], index, loadedImages, scene, onfinish, onError);
+        for (let index = 0; index < 6; index++) {
+            partialLoadImg(files[index], index, loadedImages, scene, onfinish, onError);
+        }
+    };
+
+    var partialLoadFile = (url: string, index: number, loadedFiles: (string | ArrayBuffer)[], scene: Nullable<Scene>,
+        onfinish: (files: (string | ArrayBuffer)[]) => void, onErrorCallBack: Nullable<(message?: string, exception?: any) => void> = null) => {
+
+        var onload = (data: string | ArrayBuffer) => {
+            loadedFiles[index] = data;
+            (<any>loadedFiles)._internalCount++;
+
+            if ((<any>loadedFiles)._internalCount === 6) {
+                onfinish(loadedFiles);
+            }
+        };
+
+        const onerror = (request: XMLHttpRequest, exception: any) => {
+            if (onErrorCallBack) {
+                onErrorCallBack(request.status + " " + request.statusText, exception);
+            }
+        };
+
+        Tools.LoadFile(url, onload, undefined, undefined, true, onerror);
+    }
+
+    var cascadeLoadFiles = (rootUrl: string, scene: Nullable<Scene>,
+        onfinish: (images: (string | ArrayBuffer)[]) => void, files: string[], onError: Nullable<(message?: string, exception?: any) => void> = null) => {
+
+        var loadedFiles: (string | ArrayBuffer)[] = [];
+        (<any>loadedFiles)._internalCount = 0;
+
+        for (let index = 0; index < 6; index++) {
+            partialLoadFile(files[index], index, loadedFiles, scene, onfinish, onError);
         }
     };
 
@@ -1453,7 +1485,7 @@
             } else {
                 this._gl.enable(this._gl.RASTERIZER_DISCARD);
             }
-        }        
+        }
 
         /**
          * stop executing a render loop function and remove it from the execution array
@@ -2457,7 +2489,6 @@
                 }
                 return compiledEffect;
             }
-
             var effect = new Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters);
             effect._key = name;
             this._compiledEffects[name] = effect;
@@ -3003,7 +3034,7 @@
                 // fallback for when compressed file not found to try again.  For instance, etc1 does not have an alpha capable type
                 if (isKTX) {
                     this.createTexture(urlArg, noMipmap, invertY, scene, samplingMode, null, onError, buffer, texture);
-                } else if ((isTGA || isDDS )&& BABYLON.Tools.UseFallbackTexture) {
+                } else if ((isTGA || isDDS) && BABYLON.Tools.UseFallbackTexture) {
                     this.createTexture(BABYLON.Tools.fallbackTexture, noMipmap, invertY, scene, samplingMode, null, onError, buffer, texture);
                 } else if (onError) {
                     onError();
@@ -3379,7 +3410,7 @@
             }
         }
 
-        public createRenderTargetTexture(size: number | {width: number, height: number}, options: boolean | RenderTargetCreationOptions): InternalTexture {
+        public createRenderTargetTexture(size: number | { width: number, height: number }, options: boolean | RenderTargetCreationOptions): InternalTexture {
             let fullOptions = new RenderTargetCreationOptions();
 
             if (options !== undefined && typeof options === "object") {
@@ -3409,8 +3440,8 @@
             var texture = new InternalTexture(this, InternalTexture.DATASOURCE_RENDERTARGET);
             this._bindTextureDirectly(gl.TEXTURE_2D, texture);
 
-            var width =  (<{width: number, height: number}>size).width || <number>size;
-            var height = (<{width: number, height: number}>size).height || <number>size;
+            var width = (<{ width: number, height: number }>size).width || <number>size;
+            var height = (<{ width: number, height: number }>size).height || <number>size;
 
             var filters = getSamplingParameters(fullOptions.samplingMode, fullOptions.generateMipMaps ? true : false, gl);
 
@@ -3901,7 +3932,7 @@
 
             let onerror = (request: XMLHttpRequest, exception: any) => {
                 if (onError) {
-                    onError(request.status + " " + request.statusText, exception)
+                    onError(request.status + " " + request.statusText, exception);
                 }
             }
 
@@ -3916,58 +3947,89 @@
 
                     ktx.uploadLevels(this._gl, !noMipmap);
 
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-
-                    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
-
-                    this.resetTextureCache();
+                    this.setCubeMapTextureParams(gl, loadMipmap);
 
                     texture.width = ktx.pixelWidth;
                     texture.height = ktx.pixelHeight;
                     texture.isReady = true;
                 }, undefined, undefined, true, onerror);
             } else if (isDDS) {
-                Tools.LoadFile(rootUrl, data => {
-                    var info = Internals.DDSTools.GetDDSInfo(data);
+                if (files && files.length === 6) {
+                    cascadeLoadFiles(rootUrl,
+                        scene,
+                        imgs => {
+                            var info: Internals.DDSInfo | undefined;
+                            var loadMipmap: boolean = false;
+                            var width: number = 0;
+                            for (let index = 0; index < imgs.length; index++) {
+                                let data = imgs[index];
+                                info = Internals.DDSTools.GetDDSInfo(data);
+
+                                loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap;
+
+                                this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
+                                gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, info.isCompressed ? 1 : 0);
+
+                                Internals.DDSTools.UploadDDSLevels(this, this._gl, data, info, loadMipmap, 6, -1, index);
+
+                                if (!noMipmap && !info.isFourCC && info.mipmapCount === 1) {
+                                    gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+                                }
+
+                                texture.width = info.width;
+                                texture.height = info.height;
+                                texture.type = info.textureType;
+                                width = info.width;
+                            }
 
-                    var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap;
+                            this.setCubeMapTextureParams(gl, loadMipmap);
+                            texture.isReady = true;
 
-                    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
-                    gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, info.isCompressed ? 1 : 0);
+                            if (onLoad) {
+                                onLoad({ isDDS: true, width: width, info, imgs, texture });
+                            }
+                        },
+                        files,
+                        onError);
 
-                    Internals.DDSTools.UploadDDSLevels(this, this._gl, data, info, loadMipmap, 6);
+                } else {
+                    Tools.LoadFile(rootUrl,
+                        data => {
+                            var info = Internals.DDSTools.GetDDSInfo(data);
 
-                    if (!noMipmap && !info.isFourCC && info.mipmapCount === 1) {
-                        gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
-                    }
+                            var loadMipmap = (info.isRGB || info.isLuminance || info.mipmapCount > 1) && !noMipmap;
 
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+                            this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, texture);
+                            gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, info.isCompressed ? 1 : 0);
 
-                    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
+                            Internals.DDSTools.UploadDDSLevels(this, this._gl, data, info, loadMipmap, 6);
 
-                    this.resetTextureCache();
+                            if (!noMipmap && !info.isFourCC && info.mipmapCount === 1) {
+                                gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+                            }
 
-                    texture.width = info.width;
-                    texture.height = info.height;
-                    texture.isReady = true;
-                    texture.type = info.textureType;
+                            this.setCubeMapTextureParams(gl, loadMipmap);
 
-                    if (onLoad) {
-                        onLoad({ isDDS: true, width: info.width, info, data, texture });
-                    }
-                }, undefined, undefined, true, onerror);
+                            texture.width = info.width;
+                            texture.height = info.height;
+                            texture.isReady = true;
+                            texture.type = info.textureType;
+
+                            if (onLoad) {
+                                onLoad({ isDDS: true, width: info.width, info, data, texture });
+                            }
+                        },
+                        undefined,
+                        undefined,
+                        true,
+                        onerror);
+                }
             } else {
                 if (!files) {
                     throw new Error("Cannot load cubemap because files were not defined");
                 }
 
-                cascadeLoad(rootUrl, scene, imgs => {
+                cascadeLoadImgs(rootUrl, scene, imgs => {
                     var width = this.needPOTTextures ? Tools.GetExponentOfTwo(imgs[0].width, this._caps.maxCubemapTextureSize) : imgs[0].width;
                     var height = width;
 
@@ -3995,15 +4057,8 @@
                     if (!noMipmap) {
                         gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
                     }
-
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, noMipmap ? gl.LINEAR : gl.LINEAR_MIPMAP_LINEAR);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
-                    gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
-
-                    this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
-
-                    this.resetTextureCache();
+                    
+                    this.setCubeMapTextureParams(gl, !noMipmap);
 
                     texture.width = width;
                     texture.height = height;
@@ -4026,6 +4081,17 @@
             return texture;
         }
 
+        private setCubeMapTextureParams(gl: WebGLRenderingContext, loadMipmap: boolean) {
+            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, loadMipmap ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);
+            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+            gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+
+            this._bindTextureDirectly(gl.TEXTURE_CUBE_MAP, null);
+
+            this.resetTextureCache();
+        }
+
         public updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: Nullable<string> = null, level = 0): void {
             texture._bufferViewArray = data;
             texture.format = format;
@@ -4089,10 +4155,8 @@
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
 
-            var needConversion = false;
             if (internalFormat === gl.RGB) {
                 internalFormat = gl.RGBA;
-                needConversion = true;
             }
 
             var width = size;

+ 10 - 8
src/Materials/Textures/babylon.cubeTexture.ts

@@ -40,23 +40,25 @@
 
             this._texture = this._getFromCache(rootUrl, noMipmap);
 
-            if (!files) {
+            const lastDot = rootUrl.lastIndexOf(".");
+            const extension = forcedExtension ? forcedExtension : (lastDot > -1 ? rootUrl.substring(lastDot).toLowerCase() : "");
+            const isDDS = (extension === ".dds");
 
-                if (!extensions) {
+            if (!files) {
+                if (!isDDS && !extensions) {
                     extensions = ["_px.jpg", "_py.jpg", "_pz.jpg", "_nx.jpg", "_ny.jpg", "_nz.jpg"];
                 }
 
                 files = [];
 
-                for (var index = 0; index < extensions.length; index++) {
-                    files.push(rootUrl + extensions[index]);
+                if (extensions) {
+                    
+                    for (var index = 0; index < extensions.length; index++) {
+                        files.push(rootUrl + extensions[index]);
+                    }
                 }
-
-                this._extensions = extensions;
             }
 
-            this._files = files;
-
             if (!this._texture) {
                 if (!scene.useDelayedTextureLoading) {
                     if (prefiltered) {

+ 8 - 10
src/Materials/Textures/babylon.multiRenderTarget.ts

@@ -12,7 +12,6 @@ module BABYLON {
 
         private _internalTextures: InternalTexture[];
         private _textures: Texture[];
-        private _count: number;
 
         public get isSupported(): boolean {
             return this._engine.webGLVersion > 1 || this._engine.getCaps().drawBuffersExtension;
@@ -28,7 +27,7 @@ module BABYLON {
             return this._textures[this._textures.length - 1];
         }
 
-        public set wrapU (wrap: number) {
+        public set wrapU(wrap: number) {
             if (this._textures) {
                 for (var i = 0; i < this._textures.length; i++) {
                     this._textures[i].wrapU = wrap;
@@ -36,7 +35,7 @@ module BABYLON {
             }
         }
 
-        public set wrapV (wrap: number) {
+        public set wrapV(wrap: number) {
             if (this._textures) {
                 for (var i = 0; i < this._textures.length; i++) {
                     this._textures[i].wrapV = wrap;
@@ -53,7 +52,7 @@ module BABYLON {
 
             super(name, size, scene, generateMipMaps, doNotChangeAspectRatio);
 
-            this._engine = scene.getEngine();            
+            this._engine = scene.getEngine();
 
             if (!this.isSupported) {
                 this.dispose();
@@ -80,7 +79,6 @@ module BABYLON {
             var generateDepthBuffer = options.generateDepthBuffer === undefined ? true : options.generateDepthBuffer;
             var generateStencilBuffer = options.generateStencilBuffer === undefined ? false : options.generateStencilBuffer;
 
-            this._count = count;
             this._size = size;
             this._multiRenderTargetOptions = {
                 samplingModes: samplingModes,
@@ -90,8 +88,8 @@ module BABYLON {
                 generateDepthTexture: generateDepthTexture,
                 types: types,
                 textureCount: count
-            };            
-            
+            };
+
             this._createInternalTextures();
             this._createTextures();
         }
@@ -110,7 +108,7 @@ module BABYLON {
         }
 
         private _createInternalTextures(): void {
-            this._internalTextures = this._engine.createMultipleRenderTarget(this._size , this._multiRenderTargetOptions);
+            this._internalTextures = this._engine.createMultipleRenderTarget(this._size, this._multiRenderTargetOptions);
         }
 
         private _createTextures(): void {
@@ -133,8 +131,8 @@ module BABYLON {
             if (this._samples === value) {
                 return;
             }
-            
-            for (var i = 0 ; i < this._internalTextures.length; i++) {
+
+            for (var i = 0; i < this._internalTextures.length; i++) {
                 this._samples = this._engine.updateRenderTargetTextureSampleCount(this._internalTextures[i], value);
             }
         }

+ 8 - 4
src/Materials/Textures/babylon.texture.ts

@@ -431,23 +431,27 @@
             }
 
             var texture = SerializationHelper.Parse(() => {
+                var generateMipMaps: boolean = true;
+                if (parsedTexture.noMipmap) {
+                    generateMipMaps = false;
+                }
                 if (parsedTexture.mirrorPlane) {
-                    var mirrorTexture = new MirrorTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene);
+                    var mirrorTexture = new MirrorTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
                     mirrorTexture._waitingRenderList = parsedTexture.renderList;
                     mirrorTexture.mirrorPlane = Plane.FromArray(parsedTexture.mirrorPlane);
 
                     return mirrorTexture;
                 } else if (parsedTexture.isRenderTarget) {
-                    var renderTargetTexture = new RenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene);
+                    var renderTargetTexture = new RenderTargetTexture(parsedTexture.name, parsedTexture.renderTargetSize, scene, generateMipMaps);
                     renderTargetTexture._waitingRenderList = parsedTexture.renderList;
 
                     return renderTargetTexture;
                 } else {
                     var texture: Texture;
                     if (parsedTexture.base64String) {
-                        texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene);
+                        texture = Texture.CreateFromBase64String(parsedTexture.base64String, parsedTexture.name, scene, !generateMipMaps);
                     } else {
-                        texture = new Texture(rootUrl + parsedTexture.name, scene);
+                        texture = new Texture(rootUrl + parsedTexture.name, scene, !generateMipMaps);
                     }
 
                     return texture;

+ 24 - 26
src/Materials/babylon.effect.ts

@@ -1,12 +1,11 @@
 module BABYLON {
     export class EffectFallbacks {
-        private _defines: {[key: string]: Array<String>} = {};
+        private _defines: { [key: string]: Array<String> } = {};
 
         private _currentRank = 32;
         private _maxRank = -1;
 
         private _mesh: Nullable<AbstractMesh>;
-        private _meshRank: number;
 
         public unBindMesh() {
             this._mesh = null;
@@ -29,7 +28,6 @@
         }
 
         public addCPUSkinningFallback(rank: number, mesh: BABYLON.AbstractMesh) {
-            this._meshRank = rank;
             this._mesh = mesh;
 
             if (rank < this._currentRank) {
@@ -123,8 +121,8 @@
         private _valueCache: { [key: string]: any };
         private static _baseCache: { [key: number]: WebGLBuffer } = {};
 
-        constructor(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers: Nullable<string[]> = null, engine?: Engine, defines: Nullable<string> = null, 
-                    fallbacks: Nullable<EffectFallbacks> = null, onCompiled: Nullable<(effect: Effect) => void> = null, onError: Nullable<(effect: Effect, errors: string) => void> = null, indexParameters?: any) {
+        constructor(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers: Nullable<string[]> = null, engine?: Engine, defines: Nullable<string> = null,
+            fallbacks: Nullable<EffectFallbacks> = null, onCompiled: Nullable<(effect: Effect) => void> = null, onError: Nullable<(effect: Effect, errors: string) => void> = null, indexParameters?: any) {
             this.name = baseName;
 
             if ((<EffectCreationOptions>attributesNamesOrOptions).attributes) {
@@ -138,14 +136,14 @@
                 this.onError = options.onError;
                 this.onCompiled = options.onCompiled;
                 this._fallbacks = options.fallbacks;
-                this._indexParameters = options.indexParameters;  
+                this._indexParameters = options.indexParameters;
                 this._transformFeedbackVaryings = options.transformFeedbackVaryings;
 
                 if (options.uniformBuffersNames) {
                     for (var i = 0; i < options.uniformBuffersNames.length; i++) {
                         this._uniformBuffersNames[options.uniformBuffersNames[i]] = i;
-                    }          
-                }    
+                    }
+                }
             } else {
                 this._engine = <Engine>engine;
                 this.defines = <string>defines;
@@ -159,7 +157,7 @@
                 this._indexParameters = indexParameters;
                 this._fallbacks = fallbacks;
             }
-        
+
             this.uniqueId = Effect._uniqueIdSeed++;
 
             var vertexSource: any;
@@ -194,7 +192,7 @@
                                     if (baseName) {
                                         var vertex = baseName.vertexElement || baseName.vertex || baseName;
                                         var fragment = baseName.fragmentElement || baseName.fragment || baseName;
-                            
+
                                         this._vertexSourceCode = "#define SHADER_NAME vertex:" + vertex + "\n" + migratedVertexCode;
                                         this._fragmentSourceCode = "#define SHADER_NAME fragment:" + fragment + "\n" + migratedFragmentCode;
                                     } else {
@@ -267,7 +265,7 @@
                 func(this);
                 return;
             }
-            
+
             this.onCompileObservable.add((effect) => {
                 func(effect);
             });
@@ -285,9 +283,9 @@
 
             // Base64 encoded ?
             if (vertex.substr(0, 7) === "base64:") {
-            	var vertexBinary = window.atob(vertex.substr(7));
-            	callback(vertexBinary);
-            	return;
+                var vertexBinary = window.atob(vertex.substr(7));
+                callback(vertexBinary);
+                return;
             }
 
             // Is in local store ?
@@ -320,9 +318,9 @@
 
             // Base64 encoded ?
             if (fragment.substr(0, 7) === "base64:") {
-            	var fragmentBinary = window.atob(fragment.substr(7));
-            	callback(fragmentBinary);
-            	return;
+                var fragmentBinary = window.atob(fragment.substr(7));
+                callback(fragmentBinary);
+                return;
             }
 
             // Is in local store ?
@@ -358,9 +356,9 @@
             // Number lines of shaders source code
             var i = 2;
             var regex = /\n/gm;
-            var formattedVertexCode = "\n1\t" + vertexCode.replace(regex, function() { return "\n" + (i++) + "\t"; });
+            var formattedVertexCode = "\n1\t" + vertexCode.replace(regex, function () { return "\n" + (i++) + "\t"; });
             i = 2;
-            var formattedFragmentCode = "\n1\t" + fragmentCode.replace(regex, function() { return "\n" + (i++) + "\t"; });
+            var formattedFragmentCode = "\n1\t" + fragmentCode.replace(regex, function () { return "\n" + (i++) + "\t"; });
 
             // Dump shaders name and formatted source code
             if (this.name.vertexElement) {
@@ -393,7 +391,7 @@
             }
 
             var hasDrawBuffersExtension = preparedSourceCode.search(/#extension.+GL_EXT_draw_buffers.+require/) !== -1;
-            
+
             // Remove extensions 
             // #extension GL_OES_standard_derivatives : enable
             // #extension GL_EXT_shader_texture_lod : enable
@@ -406,7 +404,7 @@
             result = result.replace(/varying(?![\n\r])\s/g, isFragment ? "in " : "out ");
             result = result.replace(/attribute[ \t]/g, "in ");
             result = result.replace(/[ \t]attribute/g, " in");
-            
+
             if (isFragment) {
                 result = result.replace(/texture2DLodEXT\s*\(/g, "textureLod(");
                 result = result.replace(/textureCubeLodEXT\s*\(/g, "textureLod(");
@@ -417,7 +415,7 @@
                 result = result.replace(/gl_FragData/g, "glFragData");
                 result = result.replace(/void\s+?main\s*\(/g, (hasDrawBuffersExtension ? "" : "out vec4 glFragColor;\n") + "void main(");
             }
-            
+
             callback(result);
         }
 
@@ -494,7 +492,7 @@
                     var includeShaderUrl = Engine.ShadersRepository + "ShadersInclude/" + includeFile + ".fx";
 
                     Tools.LoadFile(includeShaderUrl, (fileContent) => {
-                        Effect.IncludesShadersStore[includeFile] = fileContent;
+                        Effect.IncludesShadersStore[includeFile] = fileContent as string;
                         this._processIncludes(<string>returnValue, callback);
                     });
                     return;
@@ -607,10 +605,10 @@
 
                 // Let's go through fallbacks then
                 Tools.Error("Unable to compile effect:");
-                BABYLON.Tools.Error("Uniforms: " + this._uniformsNames.map(function(uniform) {
+                BABYLON.Tools.Error("Uniforms: " + this._uniformsNames.map(function (uniform) {
                     return " " + uniform;
                 }));
-                BABYLON.Tools.Error("Attributes: " + attributesNames.map(function(attribute) {
+                BABYLON.Tools.Error("Attributes: " + attributesNames.map(function (attribute) {
                     return " " + attribute;
                 }));
                 this._dumpShadersSource(this._vertexSourceCode, this._fragmentSourceCode, defines);
@@ -641,7 +639,7 @@
                         this._fallbacks.unBindMesh();
                     }
                 }
-            }            
+            }
         }
 
         public get isSupported(): boolean {

+ 22 - 2
src/Materials/babylon.imageProcessingConfiguration.ts

@@ -275,6 +275,26 @@ module BABYLON {
             this._updateParameters();
         }
 
+        @serialize()
+        private _isEnabled = true;
+        /**
+         * Gets wether the image processing is enabled or not.
+         */
+        public get isEnabled(): boolean {
+            return this._isEnabled;
+        }
+        /**
+         * Sets wether the image processing is enabled or not.
+         */
+        public set isEnabled(value: boolean) {
+            if (this._isEnabled === value) {
+                return;
+            }
+
+            this._isEnabled = value;
+            this._updateParameters();
+        }        
+
         /**
         * An event triggered when the configuration changes and requires Shader to Update some parameters.
         * @type {BABYLON.Observable}
@@ -333,7 +353,7 @@ module BABYLON {
          * @param defines the list of defines to complete
          */
         public prepareDefines(defines: IImageProcessingConfigurationDefines, forPostProcess: boolean = false): void {
-            if (forPostProcess !== this.applyByPostProcess) {
+            if (forPostProcess !== this.applyByPostProcess || !this._isEnabled) {
                 defines.VIGNETTE = false;
                 defines.TONEMAPPING = false;
                 defines.CONTRAST = false;
@@ -342,7 +362,7 @@ module BABYLON {
                 defines.COLORGRADING = false;
                 defines.COLORGRADING3D = false;
                 defines.IMAGEPROCESSING = false;
-                defines.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess;
+                defines.IMAGEPROCESSINGPOSTPROCESS = this.applyByPostProcess && this._isEnabled;
                 return;
             }
 

+ 3 - 1
src/Materials/babylon.standardMaterial.ts

@@ -1160,7 +1160,9 @@ module BABYLON {
                 MaterialHelper.BindLogDepth(defines, effect, scene);
 
                 // image processing
-                this._imageProcessingConfiguration.bind(this._activeEffect);
+                if (!this._imageProcessingConfiguration.applyByPostProcess) {
+                    this._imageProcessingConfiguration.bind(this._activeEffect);
+                }
             }
 
             this._uniformBuffer.update();

+ 1 - 1
src/Mesh/babylon.geometry.ts

@@ -562,7 +562,7 @@
                     return;
                 }
 
-                this._delayLoadingFunction(JSON.parse(data), this);
+                this._delayLoadingFunction(JSON.parse(data as string), this);
 
                 this.delayLoadState = Engine.DELAYLOADSTATE_LOADED;
                 this._delayInfo = [];

+ 35 - 38
src/Mesh/babylon.meshSimplification.ts

@@ -66,7 +66,7 @@
                 //parallel simplifier
                 task.settings.forEach((setting) => {
                     var simplifier = this.getSimplifier(task);
-                    simplifier.simplify(setting,(newMesh) => {
+                    simplifier.simplify(setting, (newMesh) => {
                         task.mesh.addLODLevel(setting.distance, newMesh);
                         newMesh.isVisible = true;
                         //check if it is the last
@@ -82,7 +82,7 @@
                 var simplifier = this.getSimplifier(task);
 
                 var runDecimation = (setting: ISimplificationSettings, callback: () => void) => {
-                    simplifier.simplify(setting,(newMesh) => {
+                    simplifier.simplify(setting, (newMesh) => {
                         task.mesh.addLODLevel(setting.distance, newMesh);
                         newMesh.isVisible = true;
                         //run the next quality level
@@ -90,17 +90,17 @@
                     });
                 }
 
-                AsyncLoop.Run(task.settings.length,(loop: AsyncLoop) => {
-                    runDecimation(task.settings[loop.index],() => {
+                AsyncLoop.Run(task.settings.length, (loop: AsyncLoop) => {
+                    runDecimation(task.settings[loop.index], () => {
                         loop.executeNext();
                     });
-                },() => {
-                        //execution ended, run the success callback.
-                        if (task.successCallback) {
-                            task.successCallback();
-                        }
-                        this.executeNext();
-                    });
+                }, () => {
+                    //execution ended, run the success callback.
+                    if (task.successCallback) {
+                        task.successCallback();
+                    }
+                    this.executeNext();
+                });
             }
         }
 
@@ -229,8 +229,6 @@
         private vertices: Array<DecimationVertex>;
         private references: Array<Reference>;
 
-        private initialized: boolean = false;
-
         private _reconstructedMesh: Mesh;
 
         public syncIterations = 5000;
@@ -249,17 +247,17 @@
         public simplify(settings: ISimplificationSettings, successCallback: (simplifiedMesh: Mesh) => void) {
             this.initDecimatedMesh();
             //iterating through the submeshes array, one after the other.
-            AsyncLoop.Run(this._mesh.subMeshes.length,(loop: AsyncLoop) => {
-                this.initWithMesh(loop.index,() => {
-                    this.runDecimation(settings, loop.index,() => {
+            AsyncLoop.Run(this._mesh.subMeshes.length, (loop: AsyncLoop) => {
+                this.initWithMesh(loop.index, () => {
+                    this.runDecimation(settings, loop.index, () => {
                         loop.executeNext();
                     });
                 }, settings.optimizeMesh);
-            },() => {
-                    setTimeout(() => {
-                        successCallback(this._reconstructedMesh);
-                    }, 0);
-                });
+            }, () => {
+                setTimeout(() => {
+                    successCallback(this._reconstructedMesh);
+                }, 0);
+            });
         }
 
         private runDecimation(settings: ISimplificationSettings, submeshIndex: number, successCallback: () => void) {
@@ -348,24 +346,24 @@
                             }
                         }
                     };
-                    AsyncLoop.SyncAsyncForLoop(this.triangles.length, this.syncIterations, trianglesIterator, callback,() => { return (triangleCount - deletedTriangles <= targetCount) });
+                    AsyncLoop.SyncAsyncForLoop(this.triangles.length, this.syncIterations, trianglesIterator, callback, () => { return (triangleCount - deletedTriangles <= targetCount) });
                 }, 0);
             };
 
-            AsyncLoop.Run(this.decimationIterations,(loop: AsyncLoop) => {
+            AsyncLoop.Run(this.decimationIterations, (loop: AsyncLoop) => {
                 if (triangleCount - deletedTriangles <= targetCount) loop.breakLoop();
                 else {
-                    iterationFunction(loop.index,() => {
+                    iterationFunction(loop.index, () => {
                         loop.executeNext();
                     });
                 }
-            },() => {
-                    setTimeout(() => {
-                        //reconstruct this part of the mesh
-                        this.reconstructMesh(submeshIndex);
-                        successCallback();
-                    }, 0);
-                });
+            }, () => {
+                setTimeout(() => {
+                    //reconstruct this part of the mesh
+                    this.reconstructMesh(submeshIndex);
+                    successCallback();
+                }, 0);
+            });
         }
 
         private initWithMesh(submeshIndex: number, callback: Function, optimizeMesh?: boolean) {
@@ -408,7 +406,7 @@
             };
             //var totalVertices = mesh.getTotalVertices();
             var totalVertices = submesh.verticesCount;
-            AsyncLoop.SyncAsyncForLoop(totalVertices,(this.syncIterations / 4) >> 0, vertexInit,() => {
+            AsyncLoop.SyncAsyncForLoop(totalVertices, (this.syncIterations / 4) >> 0, vertexInit, () => {
 
                 var indicesInit = (i: number) => {
                     if (!indices) {
@@ -427,7 +425,7 @@
                     triangle.originalOffset = pos;
                     this.triangles.push(triangle);
                 };
-                AsyncLoop.SyncAsyncForLoop(submesh.indexCount / 3, this.syncIterations, indicesInit,() => {
+                AsyncLoop.SyncAsyncForLoop(submesh.indexCount / 3, this.syncIterations, indicesInit, () => {
                     this.init(callback);
                 });
             });
@@ -441,7 +439,7 @@
                     t.vertices[j].q.addArrayInPlace(QuadraticMatrix.DataFromNumbers(t.normal.x, t.normal.y, t.normal.z, -(Vector3.Dot(t.normal, t.vertices[0].position))));
                 }
             };
-            AsyncLoop.SyncAsyncForLoop(this.triangles.length, this.syncIterations, triangleInit1,() => {
+            AsyncLoop.SyncAsyncForLoop(this.triangles.length, this.syncIterations, triangleInit1, () => {
 
                 var triangleInit2 = (i: number) => {
                     var t = this.triangles[i];
@@ -450,8 +448,7 @@
                     }
                     t.error[3] = Math.min(t.error[0], t.error[1], t.error[2]);
                 };
-                AsyncLoop.SyncAsyncForLoop(this.triangles.length, this.syncIterations, triangleInit2,() => {
-                    this.initialized = true;
+                AsyncLoop.SyncAsyncForLoop(this.triangles.length, this.syncIterations, triangleInit2, () => {
                     callback();
                 });
             });
@@ -542,7 +539,7 @@
                 this._reconstructedMesh.setVerticesData(VertexBuffer.UVKind, newUVsData);
             if (newColorsData.length > 0)
                 this._reconstructedMesh.setVerticesData(VertexBuffer.ColorKind, newColorsData);
-            
+
             //create submesh
             var originalSubmesh = this._mesh.subMeshes[submeshIndex];
             if (submeshIndex > 0) {
@@ -559,7 +556,7 @@
             this._reconstructedMesh.material = this._mesh.material;
             this._reconstructedMesh.parent = this._mesh.parent;
             this._reconstructedMesh.isVisible = false;
-            this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId; 
+            this._reconstructedMesh.renderingGroupId = this._mesh.renderingGroupId;
         }
 
         private isFlipped(vertex1: DecimationVertex, vertex2: DecimationVertex, point: Vector3, deletedArray: Array<boolean>, borderFactor: number, delTr: Array<DecimationTriangle>): boolean {

+ 28 - 35
src/PostProcess/RenderPipeline/Pipelines/babylon.ssao2RenderingPipeline.ts

@@ -88,9 +88,9 @@
         private _expensiveBlur: boolean = true;
         public set expensiveBlur(b: boolean) {
             this._blurHPostProcess.updateEffect("#define BILATERAL_BLUR\n#define BILATERAL_BLUR_H\n#define SAMPLES 16\n#define EXPENSIVE " + (b ? "1" : "0") + "\n",
-                                                null, ["textureSampler", "depthSampler"]);
+                null, ["textureSampler", "depthSampler"]);
             this._blurVPostProcess.updateEffect("#define BILATERAL_BLUR\n#define SAMPLES 16\n#define EXPENSIVE " + (b ? "1" : "0") + "\n",
-                                                null, ["textureSampler", "depthSampler"]);
+                null, ["textureSampler", "depthSampler"]);
             this._expensiveBlur = b;
             this._firstUpdate = true;
         }
@@ -139,9 +139,6 @@
 
         private _firstUpdate: boolean = true;
 
-        @serialize()
-        private _ratio: any;
-
         /**
          * @constructor
          * @param {string} name - The rendering pipeline name
@@ -161,15 +158,11 @@
 
             var ssaoRatio = ratio.ssaoRatio || ratio;
             var blurRatio = ratio.blurRatio || ratio;
-            this._ratio = {
-                ssaoRatio: ssaoRatio,
-                blurRatio: blurRatio
-            };
 
             // Set up assets
             let geometryBufferRenderer = <GeometryBufferRenderer>scene.enableGeometryBufferRenderer();
             this._createRandomTexture();
-            this._depthTexture = geometryBufferRenderer.getGBuffer().textures[0]; 
+            this._depthTexture = geometryBufferRenderer.getGBuffer().textures[0];
             this._normalTexture = geometryBufferRenderer.getGBuffer().textures[1];
 
             this._originalColorPostProcess = new PassPostProcess("SSAOOriginalSceneColor", 1.0, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false);
@@ -261,7 +254,7 @@
                 }
             };
         }
-        
+
         public _rebuild() {
             this._firstUpdate = true;
 
@@ -279,18 +272,18 @@
 
             var i = 0;
             while (i < numSamples) {
-               vector = new BABYLON.Vector3(
-                   rand(-1.0, 1.0),
-                   rand(-1.0, 1.0),
-                   rand(0.30, 1.0));
-               vector.normalize();
-               scale = i / numSamples;
-               scale = Scalar.Lerp(0.1, 1.0, scale*scale);
-               vector.scaleInPlace(scale);
-
-
-               result.push(vector.x, vector.y, vector.z);
-               i++;
+                vector = new BABYLON.Vector3(
+                    rand(-1.0, 1.0),
+                    rand(-1.0, 1.0),
+                    rand(0.30, 1.0));
+                vector.normalize();
+                scale = i / numSamples;
+                scale = Scalar.Lerp(0.1, 1.0, scale * scale);
+                vector.scaleInPlace(scale);
+
+
+                result.push(vector.x, vector.y, vector.z);
+                i++;
             }
 
             return result;
@@ -302,15 +295,15 @@
             this._sampleSphere = this._generateHemisphere();
 
             this._ssaoPostProcess = new PostProcess("ssao2", "ssao2",
-                                                    [
-                                                        "sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius",
-                                                        "base", "range", "projection", "near", "far", "texelSize",
-                                                        "xViewport", "yViewport", "maxZ", "minZAspect"
-                                                    ],
-                                                    ["randomSampler", "normalSampler"],
-                                                    ratio, null, Texture.BILINEAR_SAMPLINGMODE,
-                                                    this._scene.getEngine(), false,
-                                                    "#define SAMPLES " + numSamples + "\n#define SSAO");
+                [
+                    "sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius",
+                    "base", "range", "projection", "near", "far", "texelSize",
+                    "xViewport", "yViewport", "maxZ", "minZAspect"
+                ],
+                ["randomSampler", "normalSampler"],
+                ratio, null, Texture.BILINEAR_SAMPLINGMODE,
+                this._scene.getEngine(), false,
+                "#define SAMPLES " + numSamples + "\n#define SSAO");
 
             this._ssaoPostProcess.onApply = (effect: Effect) => {
                 if (this._firstUpdate) {
@@ -332,7 +325,7 @@
                 effect.setFloat("near", this._scene.activeCamera.minZ);
                 effect.setFloat("far", this._scene.activeCamera.maxZ);
                 effect.setFloat("xViewport", Math.tan(this._scene.activeCamera.fov / 2) * this._scene.getEngine().getAspectRatio(this._scene.activeCamera, true));
-                effect.setFloat("yViewport", Math.tan(this._scene.activeCamera.fov / 2) );
+                effect.setFloat("yViewport", Math.tan(this._scene.activeCamera.fov / 2));
                 effect.setMatrix("projection", this._scene.getProjectionMatrix());
 
                 effect.setTexture("textureSampler", this._depthTexture);
@@ -343,8 +336,8 @@
 
         private _createSSAOCombinePostProcess(ratio: number): void {
             this._ssaoCombinePostProcess = new PostProcess("ssaoCombine", "ssaoCombine", [], ["originalColor"],
-                                                           ratio, null, Texture.BILINEAR_SAMPLINGMODE,
-                                                           this._scene.getEngine(), false);
+                ratio, null, Texture.BILINEAR_SAMPLINGMODE,
+                this._scene.getEngine(), false);
 
             this._ssaoCombinePostProcess.onApply = (effect: Effect) => {
                 effect.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);

+ 11 - 18
src/PostProcess/RenderPipeline/Pipelines/babylon.ssaoRenderingPipeline.ts

@@ -80,9 +80,6 @@
 
         private _firstUpdate: boolean = true;
 
-        @serialize()
-        private _ratio: any;
-
         /**
          * @constructor
          * @param {string} name - The rendering pipeline name
@@ -101,10 +98,6 @@
 
             var ssaoRatio = ratio.ssaoRatio || ratio;
             var combineRatio = ratio.combineRatio || ratio;
-            this._ratio = {
-                ssaoRatio: ssaoRatio,
-                combineRatio: combineRatio
-            };
 
             this._originalColorPostProcess = new PassPostProcess("SSAOOriginalSceneColor", combineRatio, null, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false);
             this._createSSAOPostProcess(ssaoRatio);
@@ -171,7 +164,7 @@
 
         public _rebuild() {
             this._firstUpdate = true;
-            super._rebuild();            
+            super._rebuild();
         }
 
         private _createSSAOPostProcess(ratio: number): void {
@@ -197,14 +190,14 @@
             var samplesFactor = 1.0 / numSamples;
 
             this._ssaoPostProcess = new PostProcess("ssao", "ssao",
-                                                    [
-                                                        "sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius",
-                                                        "area", "fallOff", "base", "range", "viewport"
-                                                    ],
-                                                    ["randomSampler"],
-                                                    ratio, null, Texture.BILINEAR_SAMPLINGMODE,
-                                                    this._scene.getEngine(), false,
-                                                    "#define SAMPLES " + numSamples + "\n#define SSAO");
+                [
+                    "sampleSphere", "samplesFactor", "randTextureTiles", "totalStrength", "radius",
+                    "area", "fallOff", "base", "range", "viewport"
+                ],
+                ["randomSampler"],
+                ratio, null, Texture.BILINEAR_SAMPLINGMODE,
+                this._scene.getEngine(), false,
+                "#define SAMPLES " + numSamples + "\n#define SSAO");
 
             this._ssaoPostProcess.onApply = (effect: Effect) => {
                 if (this._firstUpdate) {
@@ -226,8 +219,8 @@
 
         private _createSSAOCombinePostProcess(ratio: number): void {
             this._ssaoCombinePostProcess = new PostProcess("ssaoCombine", "ssaoCombine", [], ["originalColor"],
-                                                           ratio, null, Texture.BILINEAR_SAMPLINGMODE,
-                                                           this._scene.getEngine(), false);
+                ratio, null, Texture.BILINEAR_SAMPLINGMODE,
+                this._scene.getEngine(), false);
 
             this._ssaoCombinePostProcess.onApply = (effect: Effect) => {
                 effect.setTextureFromPostProcess("originalColor", this._originalColorPostProcess);

+ 2 - 5
src/PostProcess/RenderPipeline/babylon.postProcessRenderEffect.ts

@@ -1,14 +1,12 @@
 module BABYLON {
     export class PostProcessRenderEffect {
-        private _engine: Engine;
-
         private _postProcesses: any;
         private _getPostProcess: () => Nullable<PostProcess>;
 
         private _singleInstance: boolean;
 
-        private _cameras: { [key:string]: Nullable<Camera>};
-        private _indicesForCamera: { [key:string]: number[]};
+        private _cameras: { [key: string]: Nullable<Camera> };
+        private _indicesForCamera: { [key: string]: number[] };
 
         private _renderPasses: any;
         private _renderEffectAsPasses: any;
@@ -19,7 +17,6 @@ module BABYLON {
         public applyParameters: (postProcess: PostProcess) => void;
 
         constructor(engine: Engine, name: string, getPostProcess: () => Nullable<PostProcess>, singleInstance?: boolean) {
-            this._engine = engine;
             this._name = name;
             this._singleInstance = singleInstance || true;
 

+ 1 - 1
src/PostProcess/babylon.passPostProcess.ts

@@ -1,6 +1,6 @@
 module BABYLON {
     export class PassPostProcess extends PostProcess {    
-        constructor(name: string, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT) {
+        constructor(name: string, options: number | PostProcessOptions, camera: Nullable<Camera> = null, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT) {
             super(name, "pass", null, null, options, camera, samplingMode, engine, reusable, undefined, textureType);
         }
     }

+ 2 - 1
src/PostProcess/babylon.postProcess.ts

@@ -9,7 +9,8 @@
         public clearColor: Color4;
         public autoClear = true;
         public alphaMode = Engine.ALPHA_DISABLE;
-        public alphaConstants: Color4;       
+        public alphaConstants: Color4;  
+        public animations = new Array<Animation>();  
 
         /*
             Enable Pixel Perfect mode where texture is not scaled to be power of 2.

+ 12 - 16
src/Rendering/babylon.renderingManager.ts

@@ -30,21 +30,19 @@
         private _renderingGroups = new Array<RenderingGroup>();
         private _depthStencilBufferAlreadyCleaned: boolean;
 
-        private _currentIndex: number;
-
-        private _autoClearDepthStencil: { [id:number]: RenderingManageAutoClearOptions } = {};
-        private _customOpaqueSortCompareFn: { [id:number]: Nullable<(a: SubMesh, b: SubMesh) => number> } = {};
-        private _customAlphaTestSortCompareFn: { [id:number]: Nullable<(a: SubMesh, b: SubMesh) => number> } = {};
-        private _customTransparentSortCompareFn: { [id:number]: Nullable<(a: SubMesh, b: SubMesh) => number> } = {};
+        private _autoClearDepthStencil: { [id: number]: RenderingManageAutoClearOptions } = {};
+        private _customOpaqueSortCompareFn: { [id: number]: Nullable<(a: SubMesh, b: SubMesh) => number> } = {};
+        private _customAlphaTestSortCompareFn: { [id: number]: Nullable<(a: SubMesh, b: SubMesh) => number> } = {};
+        private _customTransparentSortCompareFn: { [id: number]: Nullable<(a: SubMesh, b: SubMesh) => number> } = {};
         private _renderinGroupInfo: Nullable<RenderingGroupInfo> = null;
 
         constructor(scene: Scene) {
             this._scene = scene;
 
             for (let i = RenderingManager.MIN_RENDERINGGROUPS; i < RenderingManager.MAX_RENDERINGGROUPS; i++) {
-                this._autoClearDepthStencil[i] = { autoClear: true, depth:true, stencil: true };
+                this._autoClearDepthStencil[i] = { autoClear: true, depth: true, stencil: true };
             }
-        }        
+        }
 
         private _clearDepthStencilBuffer(depth = true, stencil = true): void {
             if (this._depthStencilBufferAlreadyCleaned) {
@@ -56,8 +54,8 @@
         }
 
         public render(customRenderFunction: Nullable<(opaqueSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>, depthOnlySubMeshes: SmartArray<SubMesh>) => void>,
-            activeMeshes: Nullable<AbstractMesh[]>, renderParticles: boolean, renderSprites: boolean): void {          
-                  
+            activeMeshes: Nullable<AbstractMesh[]>, renderParticles: boolean, renderSprites: boolean): void {
+
             // Check if there's at least on observer on the onRenderingGroupObservable and initialize things to fire it
             let observable = this._scene.onRenderingGroupObservable.hasObservers() ? this._scene.onRenderingGroupObservable : null;
             let info: Nullable<RenderingGroupInfo> = null;
@@ -82,11 +80,9 @@
             for (let index = RenderingManager.MIN_RENDERINGGROUPS; index < RenderingManager.MAX_RENDERINGGROUPS; index++) {
                 this._depthStencilBufferAlreadyCleaned = index === RenderingManager.MIN_RENDERINGGROUPS;
                 var renderingGroup = this._renderingGroups[index];
-                if(!renderingGroup && !observable)
+                if (!renderingGroup && !observable)
                     continue;
 
-                this._currentIndex = index;
-
                 let renderingGroupMask = 0;
 
                 // Fire PRECLEAR stage
@@ -197,7 +193,7 @@
             this._customOpaqueSortCompareFn[renderingGroupId] = opaqueSortCompareFn;
             this._customAlphaTestSortCompareFn[renderingGroupId] = alphaTestSortCompareFn;
             this._customTransparentSortCompareFn[renderingGroupId] = transparentSortCompareFn;
-                
+
             if (this._renderingGroups[renderingGroupId]) {
                 var group = this._renderingGroups[renderingGroupId];
                 group.opaqueSortCompareFn = this._customOpaqueSortCompareFn[renderingGroupId];
@@ -216,8 +212,8 @@
          */
         public setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean,
             depth = true,
-            stencil = true): void {            
-            this._autoClearDepthStencil[renderingGroupId] = { 
+            stencil = true): void {
+            this._autoClearDepthStencil[renderingGroupId] = {
                 autoClear: autoClearDepthStencil,
                 depth: depth,
                 stencil: stencil

+ 2 - 2
src/Tools/babylon.assetsManager.ts

@@ -130,7 +130,7 @@ module BABYLON {
 
         public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
             Tools.LoadFile(this.url, (data) => {
-                this.text = data;
+                this.text = data as string;
                 onSuccess();
             }, undefined, scene.database, false, (request, exception) => {
                 if (request) {
@@ -150,7 +150,7 @@ module BABYLON {
         public runTask(scene: Scene, onSuccess: () => void, onError: (message?: string, exception?: any) => void) {
             Tools.LoadFile(this.url, (data) => {
 
-                this.data = data;
+                this.data = data as ArrayBuffer;
                 onSuccess();
             }, undefined, scene.database, true, (request, exception) => {
                 if (request) {

+ 22 - 17
src/Tools/babylon.dds.ts

@@ -361,17 +361,17 @@
             return byteArray;
         }
 
-        public static UploadDDSLevels(engine: Engine, gl:WebGLRenderingContext, arrayBuffer: any, info: DDSInfo, loadMipmaps: boolean, faces: number, lodIndex = -1): void {
+        public static UploadDDSLevels(engine: Engine, gl:WebGLRenderingContext, arrayBuffer: any, info: DDSInfo, loadMipmaps: boolean, faces: number, lodIndex = -1, currentFace?: number): void {
             var ext = engine.getCaps().s3tc;
 
-            var header = new Int32Array(arrayBuffer, 0, headerLengthInt),
-                fourCC, width, height, dataLength, dataOffset,
-                byteArray, mipmapCount, mip;
+            var header = new Int32Array(arrayBuffer, 0, headerLengthInt);
+            var fourCC: number, width: number, height: number, dataLength: number = 0, dataOffset: number;
+            var byteArray: Uint8Array, mipmapCount: number, mip: number;
             let internalFormat = 0;
             let format = 0;
             let blockBytes = 1;
 
-            if (header[off_magic] != DDS_MAGIC) {
+            if (header[off_magic] !== DDS_MAGIC) {
                 Tools.Error("Invalid magic number in DDS header");
                 return;
             }
@@ -411,7 +411,7 @@
                     break;
                 case FOURCC_D3DFMT_R32G32B32A32F:
                     computeFormats = true;
-                    break;                    
+                    break;
                 case FOURCC_DX10:
                     // There is an additionnal header so dataOffset need to be changed
                     dataOffset += 5 * 4; // 5 uints
@@ -427,7 +427,7 @@
                             info.isFourCC = false;
                             bpp = 32;
                             supported = true;
-                            break;                        
+                            break;
                     }
 
                     if (supported) {
@@ -450,7 +450,7 @@
             }
             
             for (var face = 0; face < faces; face++) {
-                var sampler = faces === 1 ? gl.TEXTURE_2D : (gl.TEXTURE_CUBE_MAP_POSITIVE_X + face);
+                var sampler = faces === 1 ? gl.TEXTURE_2D : (gl.TEXTURE_CUBE_MAP_POSITIVE_X + face + (currentFace ? currentFace : 0));
 
                 width = header[off_width];
                 height = header[off_height];
@@ -462,14 +462,14 @@
 
                         if (!info.isCompressed && info.isFourCC) {
                             dataLength = width * height * 4;
-                            var FloatArray: Nullable<ArrayBufferView> = null;
+                            var floatArray: Nullable<ArrayBufferView> = null;
 
                             if (engine.badOS || engine.badDesktopOS || (!engine.getCaps().textureHalfFloat && !engine.getCaps().textureFloat)) { // Required because iOS has many issues with float and half float generation
                                 if (bpp === 128) {
-                                    FloatArray = DDSTools._GetFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);                                    
+                                    floatArray = DDSTools._GetFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);                                    
                                 }
                                 else if (bpp === 64) {
-                                    FloatArray = DDSTools._GetHalfFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                    floatArray = DDSTools._GetHalfFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                 }
 
                                 info.textureType = Engine.TEXTURETYPE_UNSIGNED_INT;
@@ -478,20 +478,20 @@
                             }
                             else {
                                 if (bpp === 128) {
-                                    FloatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                    floatArray = DDSTools._GetFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                 } else if (bpp === 64 && !engine.getCaps().textureHalfFloat) {
-                                    FloatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                    floatArray = DDSTools._GetHalfFloatAsFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
 
                                     info.textureType = Engine.TEXTURETYPE_FLOAT;
                                     format = engine._getWebGLTextureType(info.textureType);    
                                     internalFormat = engine._getRGBABufferInternalSizedFormat(info.textureType);                            
                                 } else { // 64
-                                    FloatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
+                                    floatArray = DDSTools._GetHalfFloatRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
                                 }
                             }
 
-                            if (FloatArray) {
-                                engine._uploadDataToTexture(sampler, i, internalFormat, width, height, gl.RGBA, format, FloatArray);
+                            if (floatArray) {
+                                engine._uploadDataToTexture(sampler, i, internalFormat, width, height, gl.RGBA, format, floatArray);
                             }
                         } else if (info.isRGB) {
                             if (bpp === 24) {
@@ -517,13 +517,18 @@
                             engine._uploadCompressedDataToTexture(sampler, i, internalFormat, width, height, byteArray);
                         }
                     }
-                    dataOffset += width * height * (bpp / 8);
+                    dataOffset += bpp ? (width * height * (bpp / 8)) : dataLength;
                     width *= 0.5;
                     height *= 0.5;
 
                     width = Math.max(1.0, width);
                     height = Math.max(1.0, height);
                 }
+
+                if (currentFace !== undefined) {
+                    // Loading a single face
+                    break;
+                }
             }
         }
     }

+ 111 - 114
src/Tools/babylon.performanceMonitor.ts

@@ -3,235 +3,232 @@ namespace BABYLON {
 	/**
 	 * Performance monitor tracks rolling average frame-time and frame-time variance over a user defined sliding-window
 	 */
-	export class PerformanceMonitor {
+    export class PerformanceMonitor {
 
-		private _enabled: boolean = true;
-		private _rollingFrameTime: RollingAverage;
-		private _lastFrameTimeMs: Nullable<number>;
-		private _lastChangeTimeMs: Nullable<number>;
+        private _enabled: boolean = true;
+        private _rollingFrameTime: RollingAverage;
+        private _lastFrameTimeMs: Nullable<number>;
 
 		/**
 		 * constructor
 		 * @param frameSampleSize The number of samples required to saturate the sliding window
 		 */
-		constructor(frameSampleSize: number = 30) {
-			this._rollingFrameTime = new RollingAverage(frameSampleSize);
-		}
+        constructor(frameSampleSize: number = 30) {
+            this._rollingFrameTime = new RollingAverage(frameSampleSize);
+        }
 
 		/**
 		 * Samples current frame
 		 * @param timeMs A timestamp in milliseconds of the current frame to compare with other frames
 		 */
-		public sampleFrame(timeMs: number = Tools.Now) {
-			if (!this._enabled) return;
+        public sampleFrame(timeMs: number = Tools.Now) {
+            if (!this._enabled) return;
 
-			if (this._lastFrameTimeMs != null) {
-				let dt = timeMs - this._lastFrameTimeMs;
-				this._rollingFrameTime.add(dt);
-			}
+            if (this._lastFrameTimeMs != null) {
+                let dt = timeMs - this._lastFrameTimeMs;
+                this._rollingFrameTime.add(dt);
+            }
 
-			this._lastFrameTimeMs = timeMs;
-		}
+            this._lastFrameTimeMs = timeMs;
+        }
 
 		/**
 		 * Returns the average frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
 		 * @return Average frame time in milliseconds
 		 */
-		public get averageFrameTime(): number {
-			return this._rollingFrameTime.average;
-		}
+        public get averageFrameTime(): number {
+            return this._rollingFrameTime.average;
+        }
 
 		/**
 		 * Returns the variance frame time in milliseconds over the sliding window (or the subset of frames sampled so far)
 		 * @return Frame time variance in milliseconds squared
 		 */
-		public get averageFrameTimeVariance(): number {
-			return this._rollingFrameTime.variance;
-		}
+        public get averageFrameTimeVariance(): number {
+            return this._rollingFrameTime.variance;
+        }
 
 		/**
 		 * Returns the frame time of the most recent frame
 		 * @return Frame time in milliseconds
 		 */
-		public get instantaneousFrameTime(): number {
-			return this._rollingFrameTime.history(0);
-		}
+        public get instantaneousFrameTime(): number {
+            return this._rollingFrameTime.history(0);
+        }
 
 		/**
 		 * Returns the average framerate in frames per second over the sliding window (or the subset of frames sampled so far)
 		 * @return Framerate in frames per second
 		 */
-		public get averageFPS(): number {
-			return 1000.0 / this._rollingFrameTime.average;
-		}
+        public get averageFPS(): number {
+            return 1000.0 / this._rollingFrameTime.average;
+        }
 
 		/**
 		 * Returns the average framerate in frames per second using the most recent frame time
 		 * @return Framerate in frames per second
 		 */
-		public get instantaneousFPS(): number {
-			let history = this._rollingFrameTime.history(0);
+        public get instantaneousFPS(): number {
+            let history = this._rollingFrameTime.history(0);
 
-			if (history === 0) {
-				return 0;
-			}
+            if (history === 0) {
+                return 0;
+            }
 
-			return 1000.0 / history;
-		}
+            return 1000.0 / history;
+        }
 
 		/**
 		 * Returns true if enough samples have been taken to completely fill the sliding window
 		 * @return true if saturated
 		 */
-		public get isSaturated(): boolean {
-			return this._rollingFrameTime.isSaturated();
-		}
+        public get isSaturated(): boolean {
+            return this._rollingFrameTime.isSaturated();
+        }
 
 		/**
 		 * Enables contributions to the sliding window sample set
 		 */
-		public enable() {
-			this._enabled = true;
-		}
+        public enable() {
+            this._enabled = true;
+        }
 
 		/**
 		 * Disables contributions to the sliding window sample set
 		 * Samples will not be interpolated over the disabled period
 		 */
-		public disable() {
-			this._enabled = false;
-			//clear last sample to avoid interpolating over the disabled period when next enabled
-			this._lastFrameTimeMs = null;
-			this._lastChangeTimeMs = null;
-		}
+        public disable() {
+            this._enabled = false;
+            //clear last sample to avoid interpolating over the disabled period when next enabled
+            this._lastFrameTimeMs = null;
+        }
 
 		/**
 		 * Returns true if sampling is enabled
 		 * @return true if enabled
 		 */
-		public get isEnabled(): boolean {
-			return this._enabled;
-		}
+        public get isEnabled(): boolean {
+            return this._enabled;
+        }
 
 		/**
 		 * Resets performance monitor
 		 */
-		public reset() {
-			//clear last sample to avoid interpolating over the disabled period when next enabled
-			this._lastFrameTimeMs = null;
-			this._lastChangeTimeMs = null;
-			//wipe record
-			this._rollingFrameTime.reset();
-		}
+        public reset() {
+            //clear last sample to avoid interpolating over the disabled period when next enabled
+            this._lastFrameTimeMs = null;
+            //wipe record
+            this._rollingFrameTime.reset();
+        }
 
-	}
+    }
 
 	/**
 	 * RollingAverage
 	 *
 	 * Utility to efficiently compute the rolling average and variance over a sliding window of samples
 	 */
-	export class RollingAverage {
+    export class RollingAverage {
 
 		/**
 		 * Current average
 		 */
-		public average: number;
+        public average: number;
 		/**
 		 * Current variance
 		 */
-		public variance: number;
+        public variance: number;
 
-		protected _samples: Array<number>;
-		protected _sampleCount: number;
-		protected _pos: number;
-		protected _m2: number;//sum of squares of differences from the (current) mean
+        protected _samples: Array<number>;
+        protected _sampleCount: number;
+        protected _pos: number;
+        protected _m2: number;//sum of squares of differences from the (current) mean
 
 		/**
 		 * constructor
 		 * @param length The number of samples required to saturate the sliding window
 		 */
-		constructor(length: number) {
-			this._samples = new Array<number>(length);
-			this.reset();
-		}
+        constructor(length: number) {
+            this._samples = new Array<number>(length);
+            this.reset();
+        }
 
 		/**
 		 * Adds a sample to the sample set
 		 * @param v The sample value
 		 */
-		public add(v: number) {
-			//http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
-			let delta: number;
+        public add(v: number) {
+            //http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
+            let delta: number;
 
-			//we need to check if we've already wrapped round
-			if (this.isSaturated()) {
-				//remove bottom of stack from mean
-				let bottomValue = this._samples[this._pos];
-				delta = bottomValue - this.average;
-				this.average -= delta / (this._sampleCount - 1);
-				this._m2 -= delta * (bottomValue - this.average);
-			} else {
-				this._sampleCount++;
-			}
+            //we need to check if we've already wrapped round
+            if (this.isSaturated()) {
+                //remove bottom of stack from mean
+                let bottomValue = this._samples[this._pos];
+                delta = bottomValue - this.average;
+                this.average -= delta / (this._sampleCount - 1);
+                this._m2 -= delta * (bottomValue - this.average);
+            } else {
+                this._sampleCount++;
+            }
 
-			//add new value to mean
-			delta = v - this.average;
-			this.average += delta / (this._sampleCount);
-			this._m2 += delta * (v - this.average);
+            //add new value to mean
+            delta = v - this.average;
+            this.average += delta / (this._sampleCount);
+            this._m2 += delta * (v - this.average);
 
-			//set the new variance
-			this.variance = this._m2 / (this._sampleCount - 1);
+            //set the new variance
+            this.variance = this._m2 / (this._sampleCount - 1);
 
-			this._samples[this._pos] = v;
-			this._pos++;
+            this._samples[this._pos] = v;
+            this._pos++;
 
-			this._pos %= this._samples.length;//positive wrap around
-		}
+            this._pos %= this._samples.length;//positive wrap around
+        }
 
 		/**
 		 * Returns previously added values or null if outside of history or outside the sliding window domain
 		 * @param i Index in history. For example, pass 0 for the most recent value and 1 for the value before that
 		 * @return Value previously recorded with add() or null if outside of range
 		 */
-		public history(i: number): number {
-			if ((i >= this._sampleCount) || (i >= this._samples.length)) {
-				return 0;
-			}
+        public history(i: number): number {
+            if ((i >= this._sampleCount) || (i >= this._samples.length)) {
+                return 0;
+            }
 
-			let i0 = this._wrapPosition(this._pos - 1.0);
-			return this._samples[this._wrapPosition(i0 - i)];
-		}
+            let i0 = this._wrapPosition(this._pos - 1.0);
+            return this._samples[this._wrapPosition(i0 - i)];
+        }
 
 		/**
 		 * Returns true if enough samples have been taken to completely fill the sliding window
 		 * @return true if sample-set saturated
 		 */
-		public isSaturated(): boolean {
-			return this._sampleCount >= this._samples.length;
-		}
+        public isSaturated(): boolean {
+            return this._sampleCount >= this._samples.length;
+        }
 
 		/**
 		 * Resets the rolling average (equivalent to 0 samples taken so far)
 		 */
-		public reset() {
-			this.average = 0;
-			this.variance = 0;
-			this._sampleCount = 0;
-			this._pos = 0;
-			this._m2 = 0;
-		}
+        public reset() {
+            this.average = 0;
+            this.variance = 0;
+            this._sampleCount = 0;
+            this._pos = 0;
+            this._m2 = 0;
+        }
 
 		/**
 		 * Wraps a value around the sample range boundaries
 		 * @param i Position in sample range, for example if the sample length is 5, and i is -3, then 2 will be returned.
 		 * @return Wrapped position in sample range
 		 */
-		protected _wrapPosition(i: number): number {
-			let max = this._samples.length;
-			return ((i % max) + max) % max;
-		}
+        protected _wrapPosition(i: number): number {
+            let max = this._samples.length;
+            return ((i % max) + max) % max;
+        }
 
-	}
+    }
 
 }

+ 3 - 4
src/Tools/babylon.tga.ts

@@ -65,7 +65,6 @@
 
             var use_rle = false;
             var use_pal = false;
-            var use_rgb = false;
             var use_grey = false;
 
             // Get some informations.
@@ -79,7 +78,7 @@
                 case TGATools._TYPE_RLE_RGB:
                     use_rle = true;
                 case TGATools._TYPE_RGB:
-                    use_rgb = true;
+                    // use_rgb = true;
                     break;
 
                 case TGATools._TYPE_RLE_GREY:
@@ -91,7 +90,7 @@
 
             var pixel_data;
 
-           // var numAlphaBits = header.flags & 0xf;
+            // var numAlphaBits = header.flags & 0xf;
             var pixel_size = header.pixel_size >> 3;
             var pixel_total = header.width * header.height * pixel_size;
 
@@ -143,7 +142,7 @@
                 pixel_data = data.subarray(
                     offset,
                     offset += (use_pal ? header.width * header.height : pixel_total)
-                    );
+                );
             }
 
             // Load to texture

+ 14 - 14
src/Tools/babylon.tools.ts

@@ -484,7 +484,7 @@
             return img;
         }
 
-        public static LoadFile(url: string, callback: (data: any, responseURL?: string) => void, progressCallBack?: (data: any) => void, database?: Database, useArrayBuffer?: boolean, onError?: (request?: XMLHttpRequest, exception?: any) => void): Nullable<XMLHttpRequest> {
+        public static LoadFile(url: string, callback: (data: string | ArrayBuffer, responseURL?: string) => void, progressCallBack?: (data: any) => void, database?: Database, useArrayBuffer?: boolean, onError?: (request?: XMLHttpRequest, exception?: any) => void): Nullable<XMLHttpRequest> {
             url = Tools.CleanUrl(url);
 
             url = Tools.PreprocessUrl(url);
@@ -511,7 +511,7 @@
                         req.onreadystatechange = () => { };//some browsers have issues where onreadystatechange can be called multiple times with the same value
 
                         if (req.status >= 200 && req.status < 300 || (!Tools.IsWindowObjectExist() && (req.status === 0))) {
-                            callback(!useArrayBuffer ? req.responseText : req.response, req.responseURL);
+                            callback(!useArrayBuffer ? req.responseText : <ArrayBuffer>req.response, req.responseURL);
                         } else { // Failed
                             let e = new Error("Error status: " + req.status + " - Unable to load " + loadUrl);
                             if (onError) {
@@ -721,7 +721,7 @@
             }
         }
 
-        public static DumpFramebuffer(width: number, height: number, engine: Engine, successCallback?: (data: string) => void, mimeType: string = "image/png", fileName? : string): void {
+        public static DumpFramebuffer(width: number, height: number, engine: Engine, successCallback?: (data: string) => void, mimeType: string = "image/png", fileName?: string): void {
             // Read the contents of the framebuffer
             var numberOfChannelsByLine = width * 4;
             var halfHeight = height / 2;
@@ -761,7 +761,7 @@
             }
         }
 
-        static EncodeScreenshotCanvasData(successCallback?: (data: string) => void, mimeType: string = "image/png", fileName? : string) {
+        static EncodeScreenshotCanvasData(successCallback?: (data: string) => void, mimeType: string = "image/png", fileName?: string) {
             var base64Image = screenshotCanvas.toDataURL(mimeType);
             if (successCallback) {
                 successCallback(base64Image);
@@ -771,26 +771,25 @@
                 if (!screenshotCanvas.toBlob) {
                     //  low performance polyfill based on toDataURL (https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob)
                     screenshotCanvas.toBlob = function (callback, type, quality) {
-                        var canvas = this;
-                        setTimeout(function() {
-                            var binStr = atob( canvas.toDataURL(type, quality).split(',')[1] ),
+                        setTimeout(() => {
+                            var binStr = atob(this.toDataURL(type, quality).split(',')[1]),
                                 len = binStr.length,
                                 arr = new Uint8Array(len);
 
-                            for (var i = 0; i < len; i++ ) {
+                            for (var i = 0; i < len; i++) {
                                 arr[i] = binStr.charCodeAt(i);
                             }
-                            callback( new Blob( [arr], {type: type || 'image/png'} ) );
+                            callback(new Blob([arr], { type: type || 'image/png' }));
                         });
                     }
                 }
-                screenshotCanvas.toBlob(function(blob) {
+                screenshotCanvas.toBlob(function (blob) {
                     var url = URL.createObjectURL(blob);
                     //Creating a link if the browser have the download attribute on the a tag, to automatically start download generated image.
                     if (("download" in document.createElement("a"))) {
                         var a = window.document.createElement("a");
                         a.href = url;
-                        if(fileName) {
+                        if (fileName) {
                             a.setAttribute("download", fileName);
                         }
                         else {
@@ -808,8 +807,9 @@
                     }
                     else {
                         var newWindow = window.open("");
+                        if (!newWindow) return;
                         var img = newWindow.document.createElement("img");
-                        img.onload = function() {
+                        img.onload = function () {
                             // no longer need to read the blob so it's revoked
                             URL.revokeObjectURL(url);
                         };
@@ -882,7 +882,7 @@
             Tools.EncodeScreenshotCanvasData(successCallback, mimeType);
         }
 
-        public static CreateScreenshotUsingRenderTarget(engine: Engine, camera: Camera, size: any, successCallback?: (data: string) => void, mimeType: string = "image/png", samples: number = 1, antialiasing : boolean = false, fileName? : string): void {
+        public static CreateScreenshotUsingRenderTarget(engine: Engine, camera: Camera, size: any, successCallback?: (data: string) => void, mimeType: string = "image/png", samples: number = 1, antialiasing: boolean = false, fileName?: string): void {
             var width: number;
             var height: number;
 
@@ -930,7 +930,7 @@
             var texture = new RenderTargetTexture("screenShot", size, scene, false, false, Engine.TEXTURETYPE_UNSIGNED_INT, false, Texture.NEAREST_SAMPLINGMODE);
             texture.renderList = null;
             texture.samples = samples;
-            if(antialiasing) {
+            if (antialiasing) {
                 texture.addPostProcess(new BABYLON.FxaaPostProcess('antialiasing', 1.0, scene.activeCamera));
             }
             texture.onAfterRenderObservable.add(() => {

+ 6 - 20
src/Tools/babylon.virtualJoystick.ts

@@ -22,16 +22,13 @@ module BABYLON {
         private static vjCanvasWidth: number;
         private static vjCanvasHeight: number;
         private static halfWidth: number;
-        private static halfHeight: number;
+
 
         private _action: () => any;
         private _axisTargetedByLeftAndRight: JoystickAxis;
         private _axisTargetedByUpAndDown: JoystickAxis;
         private _joystickSensibility: number;
         private _inversedSensibility: number;
-        private _rotationSpeed: number;
-        private _inverseRotationSpeed: number;
-        private _rotateOnAxisRelativeToMesh: boolean;
         private _joystickPointerID: number;
         private _joystickColor: string;
         private _joystickPointerPos: Vector2;
@@ -39,13 +36,11 @@ module BABYLON {
         private _joystickPointerStartPos: Vector2;
         private _deltaJoystickVector: Vector2;
         private _leftJoystick: boolean;
-        private _joystickIndex: number;
         private _touches: StringDictionary<{ x: number, y: number, prevX: number, prevY: number } | PointerEvent>;
 
         private _onPointerDownHandlerRef: (e: PointerEvent) => any;
         private _onPointerMoveHandlerRef: (e: PointerEvent) => any;
         private _onPointerUpHandlerRef: (e: PointerEvent) => any;
-        private _onPointerOutHandlerRef: (e: PointerEvent) => any;
         private _onResize: (e: any) => any;
 
         constructor(leftJoystick?: boolean) {
@@ -56,7 +51,6 @@ module BABYLON {
                 this._leftJoystick = false;
             }
 
-            this._joystickIndex = VirtualJoystick._globalJoystickIndex;
             VirtualJoystick._globalJoystickIndex++;
 
             // By default left & right arrow keys are moving the X
@@ -73,9 +67,6 @@ module BABYLON {
 
             this._joystickSensibility = 25;
             this._inversedSensibility = 1 / (this._joystickSensibility / 1000);
-            this._rotationSpeed = 25;
-            this._inverseRotationSpeed = 1 / (this._rotationSpeed / 1000);
-            this._rotateOnAxisRelativeToMesh = false;
 
             this._onResize = evt => {
                 VirtualJoystick.vjCanvasWidth = window.innerWidth;
@@ -85,7 +76,6 @@ module BABYLON {
                     VirtualJoystick.vjCanvas.height = VirtualJoystick.vjCanvasHeight;
                 }
                 VirtualJoystick.halfWidth = VirtualJoystick.vjCanvasWidth / 2;
-                VirtualJoystick.halfHeight = VirtualJoystick.vjCanvasHeight / 2;
             }
 
             // injecting a canvas element on top of the canvas 3D game
@@ -118,7 +108,6 @@ module BABYLON {
                 document.body.appendChild(VirtualJoystick.vjCanvas);
             }
             VirtualJoystick.halfWidth = VirtualJoystick.vjCanvas.width / 2;
-            VirtualJoystick.halfHeight = VirtualJoystick.vjCanvas.height / 2;
             this.pressed = false;
             // default joystick color
             this._joystickColor = "cyan";
@@ -130,16 +119,13 @@ module BABYLON {
             // origin joystick position
             this._joystickPointerStartPos = new Vector2(0, 0);
             this._deltaJoystickVector = new Vector2(0, 0);
-            
+
             this._onPointerDownHandlerRef = evt => {
                 this._onPointerDown(evt);
             }
             this._onPointerMoveHandlerRef = evt => {
                 this._onPointerMove(evt);
             }
-            this._onPointerOutHandlerRef = evt => {
-                this._onPointerUp(evt);
-            }
             this._onPointerUpHandlerRef = evt => {
                 this._onPointerUp(evt);
             }
@@ -148,7 +134,7 @@ module BABYLON {
             VirtualJoystick.vjCanvas.addEventListener('pointermove', this._onPointerMoveHandlerRef, false);
             VirtualJoystick.vjCanvas.addEventListener('pointerup', this._onPointerUpHandlerRef, false);
             VirtualJoystick.vjCanvas.addEventListener('pointerout', this._onPointerUpHandlerRef, false);
-            VirtualJoystick.vjCanvas.addEventListener("contextmenu",(evt) => {
+            VirtualJoystick.vjCanvas.addEventListener("contextmenu", (evt) => {
                 evt.preventDefault();    // Disables system menu
             }, false);
             requestAnimationFrame(() => { this._drawVirtualJoystick(); });
@@ -231,7 +217,7 @@ module BABYLON {
                 let data = this._touches.get(e.pointerId.toString());
                 if (data) {
                     (data as any).x = e.clientX;
-                    (data as any).y = e.clientY;                     
+                    (data as any).y = e.clientY;
                 }
             }
         }
@@ -299,7 +285,7 @@ module BABYLON {
             if (this.pressed) {
                 this._touches.forEach((key, touch) => {
                     if ((<PointerEvent>touch).pointerId === this._joystickPointerID) {
-                        VirtualJoystick.vjCanvasContext.clearRect(this._joystickPointerStartPos.x - 64, this._joystickPointerStartPos.y - 64, 128, 128);                       
+                        VirtualJoystick.vjCanvasContext.clearRect(this._joystickPointerStartPos.x - 64, this._joystickPointerStartPos.y - 64, 128, 128);
                         VirtualJoystick.vjCanvasContext.clearRect(this._joystickPreviousPointerPos.x - 42, this._joystickPreviousPointerPos.y - 42, 84, 84);
                         VirtualJoystick.vjCanvasContext.beginPath();
                         VirtualJoystick.vjCanvasContext.lineWidth = 6;
@@ -317,7 +303,7 @@ module BABYLON {
                         VirtualJoystick.vjCanvasContext.strokeStyle = this._joystickColor;
                         VirtualJoystick.vjCanvasContext.arc(this._joystickPointerPos.x, this._joystickPointerPos.y, 40, 0, Math.PI * 2, true);
                         VirtualJoystick.vjCanvasContext.stroke();
-                        VirtualJoystick.vjCanvasContext.closePath(); 
+                        VirtualJoystick.vjCanvasContext.closePath();
                         this._joystickPreviousPointerPos = this._joystickPointerPos.clone();
                     }
                     else {