Browse Source

Merge remote-tracking branch 'BabylonJS/master' into modules

# Conflicts:
#	Tools/Gulp/config.json
Raanan Weber 7 years ago
parent
commit
6f55a5fc79
100 changed files with 92232 additions and 58682 deletions
  1. 20 0
      .vscode/launch.json
  2. BIN
      Playground/LogoPBT.png
  3. 3693 3621
      Playground/babylon.d.txt
  4. 1 1
      Playground/indexStable.html
  5. 1 1
      Playground/js/index.js
  6. 12 5
      Tools/Gulp/config.json
  7. 16 2
      Tools/Gulp/gulpfile.js
  8. 5 5
      Tools/Gulp/package.json
  9. 89 72
      dist/Oimo.js
  10. 11914 8919
      dist/babylon.d.ts
  11. 55 48
      dist/babylon.js
  12. 50529 38455
      dist/babylon.max.js
  13. 57 50
      dist/babylon.worker.js
  14. 239 89
      dist/gui/babylon.gui.d.ts
  15. 1520 323
      dist/gui/babylon.gui.js
  16. 3 3
      dist/gui/babylon.gui.min.js
  17. 738 0
      dist/gui/babylon.gui.module.d.ts
  18. 36 0
      dist/gui/package.json
  19. 41 0
      dist/gui/readme.md
  20. 4 991
      dist/inspector/babylon.inspector.bundle.js
  21. 81 11
      dist/inspector/babylon.inspector.css
  22. 193 198
      dist/inspector/babylon.inspector.d.ts
  23. 765 1022
      dist/inspector/babylon.inspector.js
  24. 4 3
      dist/inspector/babylon.inspector.min.js
  25. 33 0
      dist/inspector/package.json
  26. 34 0
      dist/inspector/readme.md
  27. 186 61
      dist/loaders/babylon.glTF1FileLoader.d.ts
  28. 274 206
      dist/loaders/babylon.glTF1FileLoader.js
  29. 2 2
      dist/loaders/babylon.glTF1FileLoader.min.js
  30. 215 95
      dist/loaders/babylon.glTF2FileLoader.d.ts
  31. 1597 754
      dist/loaders/babylon.glTF2FileLoader.js
  32. 2 1
      dist/loaders/babylon.glTF2FileLoader.min.js
  33. 319 147
      dist/loaders/babylon.glTFFileLoader.d.ts
  34. 1737 891
      dist/loaders/babylon.glTFFileLoader.js
  35. 3 2
      dist/loaders/babylon.glTFFileLoader.min.js
  36. 3 2
      dist/loaders/babylon.objFileLoader.d.ts
  37. 156 145
      dist/loaders/babylon.objFileLoader.js
  38. 1 1
      dist/loaders/babylon.objFileLoader.min.js
  39. 2 1
      dist/loaders/babylon.stlFileLoader.d.ts
  40. 3 2
      dist/loaders/babylon.stlFileLoader.js
  41. 1 1
      dist/loaders/babylon.stlFileLoader.min.js
  42. 5394 0
      dist/loaders/babylonjs.loaders.js
  43. 3 0
      dist/loaders/babylonjs.loaders.min.js
  44. 1167 0
      dist/loaders/babylonjs.loaders.module.d.ts
  45. 37 0
      dist/loaders/package.json
  46. 44 0
      dist/loaders/readme.md
  47. 280 0
      dist/materialsLibrary/babylon.backgroundMaterial.d.ts
  48. 920 0
      dist/materialsLibrary/babylon.backgroundMaterial.js
  49. 1 0
      dist/materialsLibrary/babylon.backgroundMaterial.min.js
  50. 2 3
      dist/materialsLibrary/babylon.cellMaterial.d.ts
  51. 41 37
      dist/materialsLibrary/babylon.cellMaterial.js
  52. 1 1
      dist/materialsLibrary/babylon.cellMaterial.min.js
  53. 273 3
      dist/materialsLibrary/babylon.customMaterial.d.ts
  54. 1391 11
      dist/materialsLibrary/babylon.customMaterial.js
  55. 2 1
      dist/materialsLibrary/babylon.customMaterial.min.js
  56. 5 4
      dist/materialsLibrary/babylon.fireMaterial.d.ts
  57. 41 31
      dist/materialsLibrary/babylon.fireMaterial.js
  58. 1 1
      dist/materialsLibrary/babylon.fireMaterial.min.js
  59. 2 2
      dist/materialsLibrary/babylon.furMaterial.d.ts
  60. 75 67
      dist/materialsLibrary/babylon.furMaterial.js
  61. 1 1
      dist/materialsLibrary/babylon.furMaterial.min.js
  62. 2 2
      dist/materialsLibrary/babylon.gradientMaterial.d.ts
  63. 43 38
      dist/materialsLibrary/babylon.gradientMaterial.js
  64. 1 1
      dist/materialsLibrary/babylon.gradientMaterial.min.js
  65. 10 0
      dist/materialsLibrary/babylon.gridMaterial.d.ts
  66. 59 35
      dist/materialsLibrary/babylon.gridMaterial.js
  67. 1 1
      dist/materialsLibrary/babylon.gridMaterial.min.js
  68. 2 2
      dist/materialsLibrary/babylon.lavaMaterial.d.ts
  69. 53 48
      dist/materialsLibrary/babylon.lavaMaterial.js
  70. 1 1
      dist/materialsLibrary/babylon.lavaMaterial.min.js
  71. 0 337
      dist/materialsLibrary/babylon.legacyPbrMaterial.d.ts
  72. 0 1531
      dist/materialsLibrary/babylon.legacyPbrMaterial.js
  73. 0 3
      dist/materialsLibrary/babylon.legacyPbrMaterial.min.js
  74. 2 3
      dist/materialsLibrary/babylon.normalMaterial.d.ts
  75. 35 31
      dist/materialsLibrary/babylon.normalMaterial.js
  76. 1 1
      dist/materialsLibrary/babylon.normalMaterial.min.js
  77. 4 3
      dist/materialsLibrary/babylon.shadowOnlyMaterial.d.ts
  78. 44 23
      dist/materialsLibrary/babylon.shadowOnlyMaterial.js
  79. 1 1
      dist/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  80. 2 3
      dist/materialsLibrary/babylon.simpleMaterial.d.ts
  81. 35 31
      dist/materialsLibrary/babylon.simpleMaterial.js
  82. 1 1
      dist/materialsLibrary/babylon.simpleMaterial.min.js
  83. 2 1
      dist/materialsLibrary/babylon.skyMaterial.d.ts
  84. 40 36
      dist/materialsLibrary/babylon.skyMaterial.js
  85. 1 1
      dist/materialsLibrary/babylon.skyMaterial.min.js
  86. 2 2
      dist/materialsLibrary/babylon.terrainMaterial.d.ts
  87. 77 72
      dist/materialsLibrary/babylon.terrainMaterial.js
  88. 1 1
      dist/materialsLibrary/babylon.terrainMaterial.min.js
  89. 2 2
      dist/materialsLibrary/babylon.triPlanarMaterial.d.ts
  90. 77 72
      dist/materialsLibrary/babylon.triPlanarMaterial.js
  91. 1 1
      dist/materialsLibrary/babylon.triPlanarMaterial.min.js
  92. 8 5
      dist/materialsLibrary/babylon.waterMaterial.d.ts
  93. 140 100
      dist/materialsLibrary/babylon.waterMaterial.js
  94. 1 1
      dist/materialsLibrary/babylon.waterMaterial.min.js
  95. 6362 0
      dist/materialsLibrary/babylonjs.materials.js
  96. 7 0
      dist/materialsLibrary/babylonjs.materials.min.js
  97. 861 0
      dist/materialsLibrary/babylonjs.materials.module.d.ts
  98. 37 0
      dist/materialsLibrary/package.json
  99. 51 0
      dist/materialsLibrary/readme.md
  100. 0 0
      dist/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts

+ 20 - 0
.vscode/launch.json

@@ -125,6 +125,18 @@
             ]
             ]
         },
         },
         {
         {
+            "name": "Launch Local Dev (Experimental Firefox)",
+            "type": "firefox",
+            "request": "launch",
+            "reAttach": true,
+            "url": "http://localhost:1338/localDev/index.html",
+            "pathMappings": [{
+                "url": "http://localhost:1338",
+                "path": "${workspaceFolder}"
+            }],
+            "preLaunchTask": "run"
+        },
+        {
             "name": "Launch Build Validation (Chrome)",
             "name": "Launch Build Validation (Chrome)",
             "type": "chrome",
             "type": "chrome",
             "request": "launch",
             "request": "launch",
@@ -136,6 +148,14 @@
             "runtimeArgs": [
             "runtimeArgs": [
                 "--enable-unsafe-es3-apis"
                 "--enable-unsafe-es3-apis"
             ]
             ]
+        },
+        {
+            "name": "Launch Build Validation (Firefox)",
+            "type": "firefox",
+            "request": "launch",
+            "reAttach": true,
+            "webRoot": "${workspaceRoot}/",
+            "url": "http://localhost:1338/tests/validation/index.html"
         }
         }
     ]
     ]
 }
 }

BIN
Playground/LogoPBT.png


File diff suppressed because it is too large
+ 3693 - 3621
Playground/babylon.d.txt


+ 1 - 1
Playground/indexStable.html

@@ -391,4 +391,4 @@
     <script src="js/index.js"></script>
     <script src="js/index.js"></script>
 </body>
 </body>
 
 
-</html>
+</html>

+ 1 - 1
Playground/js/index.js

@@ -87,7 +87,7 @@
         var zipCode;
         var zipCode;
         BABYLON.Engine.ShadersRepository = "/src/Shaders/";
         BABYLON.Engine.ShadersRepository = "/src/Shaders/";
 
 
-        if (location.href.indexOf("Stable") !== -1) {
+        if (location.href.indexOf("indexstable") !== -1) {
             setToMultipleID("currentVersion", "innerHTML", "Version: Stable");
             setToMultipleID("currentVersion", "innerHTML", "Version: Stable");
         } else {
         } else {
             setToMultipleID("currentVersion", "innerHTML", "Version: Latest");
             setToMultipleID("currentVersion", "innerHTML", "Version: Latest");

+ 12 - 5
Tools/Gulp/config.json

@@ -202,10 +202,8 @@
                 "../../src/Materials/Textures/babylon.texture.js",
                 "../../src/Materials/Textures/babylon.texture.js",
                 "../../src/Mesh/babylon.mesh.js",
                 "../../src/Mesh/babylon.mesh.js",
                 "../../src/Mesh/babylon.subMesh.js",
                 "../../src/Mesh/babylon.subMesh.js",
-                "../../src/Materials/babylon.materialHelper.js",
                 "../../src/Materials/babylon.material.js",
                 "../../src/Materials/babylon.material.js",
                 "../../src/Materials/babylon.uniformBuffer.js",
                 "../../src/Materials/babylon.uniformBuffer.js",
-                "../../src/Materials/babylon.pushMaterial.js",
                 "../../src/Mesh/babylon.mesh.vertexData.js",
                 "../../src/Mesh/babylon.mesh.vertexData.js",
                 "../../src/Mesh/babylon.geometry.js",
                 "../../src/Mesh/babylon.geometry.js",
                 "../../src/PostProcess/babylon.postProcessManager.js",
                 "../../src/PostProcess/babylon.postProcessManager.js",
@@ -218,6 +216,15 @@
                 "depthPrePass"
                 "depthPrePass"
             ]
             ]
         },
         },
+        "materialCore": {
+            "files": [
+                "../../src/Materials/babylon.materialHelper.js",
+                "../../src/Materials/babylon.pushMaterial.js"
+            ],
+            "dependUpon": [
+                "core"
+            ]
+        },
         "particles": {
         "particles": {
             "files": [
             "files": [
                 "../../src/Particles/babylon.particle.js",
                 "../../src/Particles/babylon.particle.js",
@@ -374,7 +381,7 @@
                 "../../src/Materials/babylon.shaderMaterial.js"
                 "../../src/Materials/babylon.shaderMaterial.js"
             ],
             ],
             "dependUpon": [
             "dependUpon": [
-                "core"
+                "materialCore"
             ]
             ]
         },
         },
         "standardMaterial": {
         "standardMaterial": {
@@ -382,7 +389,7 @@
                 "../../src/Materials/babylon.standardMaterial.js"
                 "../../src/Materials/babylon.standardMaterial.js"
             ],
             ],
             "dependUpon": [
             "dependUpon": [
-                "core"
+                "materialCore"
             ],
             ],
             "shaders": [
             "shaders": [
                 "default.vertex",
                 "default.vertex",
@@ -439,7 +446,7 @@
                 "../../src/Materials/PBR/babylon.pbrSpecularGlossinessMaterial.js"
                 "../../src/Materials/PBR/babylon.pbrSpecularGlossinessMaterial.js"
             ],
             ],
             "dependUpon": [
             "dependUpon": [
-                "core"
+                "materialCore"
             ],
             ],
             "shaders": [
             "shaders": [
                 "pbr.vertex",
                 "pbr.vertex",

+ 16 - 2
Tools/Gulp/gulpfile.js

@@ -482,12 +482,26 @@ gulp.task("typescript-all", function (cb) {
 });
 });
 
 
 /**
 /**
+ * Watch ts files from typescript .
+ */
+gulp.task("srcTscWatch", function() {
+    // Reuse The TSC CLI from gulp to enable -w.
+    process.argv[2] = "-w";
+    process.argv[3] = "-p";
+    process.argv[4] = "../../src/tsconfig.json";
+    require("./node_modules/typescript/lib/tsc.js");
+});
+
+/**
  * Watch ts files and fire repective tasks.
  * Watch ts files and fire repective tasks.
  */
  */
-gulp.task("watch", [], function () {
+gulp.task("watch", ["srcTscWatch"], function () {
     forceCompile = true;
     forceCompile = true;
     var interval = 1000;
     var interval = 1000;
-    var tasks = [gulp.watch(config.typescript, { interval: interval }, ["typescript-compile"])];
+
+    // Keep during Prod Tests of srcTscWatch.
+    // var tasks = [gulp.watch(config.typescript, { interval: interval }, ["typescript-compile"])];
+    var tasks = [];
 
 
     config.modules.map(function (module) {
     config.modules.map(function (module) {
         config[module].libraries.map(function (library) {
         config[module].libraries.map(function (library) {

+ 5 - 5
Tools/Gulp/package.json

@@ -1,6 +1,6 @@
 {
 {
     "name": "BabylonJS",
     "name": "BabylonJS",
-    "version": "3.0.0",
+    "version": "3.1.1",
     "description": "Babylon.js is a 3D engine based on webgl and javascript",
     "description": "Babylon.js is a 3D engine based on webgl and javascript",
     "main": "",
     "main": "",
     "repository": {
     "repository": {
@@ -9,8 +9,8 @@
     "readme": "https://github.com/BabylonJS/Babylon.js/edit/master/readme.md",
     "readme": "https://github.com/BabylonJS/Babylon.js/edit/master/readme.md",
     "license": "(Apache-2.0)",
     "license": "(Apache-2.0)",
     "devDependencies": {
     "devDependencies": {
-        "@types/node": "^8.0.53",
-        "base64-image-loader": "^1.2.0",
+        "@types/node": "^8.5.0",
+        "base64-image-loader": "^1.2.1",
         "css-loader": "^0.25.0",
         "css-loader": "^0.25.0",
         "deepmerge": "^2.0.1",
         "deepmerge": "^2.0.1",
         "del": "2.2.2",
         "del": "2.2.2",
@@ -42,10 +42,10 @@
         "style-loader": "^0.13.2",
         "style-loader": "^0.13.2",
         "through2": "~0.6.5",
         "through2": "~0.6.5",
         "ts-loader": "^2.3.7",
         "ts-loader": "^2.3.7",
-        "typescript": "~2.6.1",
+        "typescript": "^2.6.2",
         "webpack-stream": "^4.0.0"
         "webpack-stream": "^4.0.0"
     },
     },
     "scripts": {
     "scripts": {
         "install": "npm --prefix ../../Playground/ install ../../Playground/ && gulp typescript-compile && gulp typescript-libraries && gulp deployLocalDev"
         "install": "npm --prefix ../../Playground/ install ../../Playground/ && gulp typescript-compile && gulp typescript-libraries && gulp deployLocalDev"
     }
     }
-}
+}

+ 89 - 72
dist/Oimo.js

@@ -1882,12 +1882,12 @@ OIMO.Mat33.prototype = {
     },
     },
     mul: function (m1, m2) {
     mul: function (m1, m2) {
         var te = this.elements, tm1 = m1.elements, tm2 = m2.elements,
         var te = this.elements, tm1 = m1.elements, tm2 = m2.elements,
-        a0 = tm1[0], a3 = tm1[3], a6 = tm1[6],
-        a1 = tm1[1], a4 = tm1[4], a7 = tm1[7],
-        a2 = tm1[2], a5 = tm1[5], a8 = tm1[8],
-        b0 = tm2[0], b3 = tm2[3], b6 = tm2[6],
-        b1 = tm2[1], b4 = tm2[4], b7 = tm2[7],
-        b2 = tm2[2], b5 = tm2[5], b8 = tm2[8];
+            a0 = tm1[0], a3 = tm1[3], a6 = tm1[6],
+            a1 = tm1[1], a4 = tm1[4], a7 = tm1[7],
+            a2 = tm1[2], a5 = tm1[5], a8 = tm1[8],
+            b0 = tm2[0], b3 = tm2[3], b6 = tm2[6],
+            b1 = tm2[1], b4 = tm2[4], b7 = tm2[7],
+            b2 = tm2[2], b5 = tm2[5], b8 = tm2[8];
         te[0] = a0 * b0 + a1 * b3 + a2 * b6;
         te[0] = a0 * b0 + a1 * b3 + a2 * b6;
         te[1] = a0 * b1 + a1 * b4 + a2 * b7;
         te[1] = a0 * b1 + a1 * b4 + a2 * b7;
         te[2] = a0 * b2 + a1 * b5 + a2 * b8;
         te[2] = a0 * b2 + a1 * b5 + a2 * b8;
@@ -1968,10 +1968,10 @@ OIMO.Mat33.prototype = {
     },
     },
     setQuat: function (q) {
     setQuat: function (q) {
         var te = this.elements,
         var te = this.elements,
-        x2 = 2 * q.x, y2 = 2 * q.y, z2 = 2 * q.z,
-        xx = q.x * x2, yy = q.y * y2, zz = q.z * z2,
-        xy = q.x * y2, yz = q.y * z2, xz = q.x * z2,
-        sx = q.s * x2, sy = q.s * y2, sz = q.s * z2;
+            x2 = 2 * q.x, y2 = 2 * q.y, z2 = 2 * q.z,
+            xx = q.x * x2, yy = q.y * y2, zz = q.z * z2,
+            xy = q.x * y2, yz = q.y * z2, xz = q.x * z2,
+            sx = q.s * x2, sy = q.s * y2, sz = q.s * z2;
 
 
         te[0] = 1 - yy - zz;
         te[0] = 1 - yy - zz;
         te[1] = xy - sz;
         te[1] = xy - sz;
@@ -1986,13 +1986,13 @@ OIMO.Mat33.prototype = {
     },
     },
     invert: function (m) {
     invert: function (m) {
         var te = this.elements, tm = m.elements,
         var te = this.elements, tm = m.elements,
-        a0 = tm[0], a3 = tm[3], a6 = tm[6],
-        a1 = tm[1], a4 = tm[4], a7 = tm[7],
-        a2 = tm[2], a5 = tm[5], a8 = tm[8],
-        b01 = a4 * a8 - a7 * a5,
-        b11 = a7 * a2 - a1 * a8,
-        b21 = a1 * a5 - a4 * a2,
-        dt = a0 * (b01) + a3 * (b11) + a6 * (b21);
+            a0 = tm[0], a3 = tm[3], a6 = tm[6],
+            a1 = tm[1], a4 = tm[4], a7 = tm[7],
+            a2 = tm[2], a5 = tm[5], a8 = tm[8],
+            b01 = a4 * a8 - a7 * a5,
+            b11 = a7 * a2 - a1 * a8,
+            b21 = a1 * a5 - a4 * a2,
+            dt = a0 * (b01) + a3 * (b11) + a6 * (b21);
 
 
         if (dt != 0) { dt = 1.0 / dt; }
         if (dt != 0) { dt = 1.0 / dt; }
         te[0] = dt * b01;//(a4*a8 - a5*a7);
         te[0] = dt * b01;//(a4*a8 - a5*a7);
@@ -2051,9 +2051,9 @@ OIMO.Mat33.prototype = {
     toString: function () {
     toString: function () {
         var te = this.elements;
         var te = this.elements;
         var text =
         var text =
-        "Mat33|" + te[0].toFixed(4) + ", " + te[1].toFixed(4) + ", " + te[2].toFixed(4) + "|\n" +
-        "     |" + te[3].toFixed(4) + ", " + te[4].toFixed(4) + ", " + te[5].toFixed(4) + "|\n" +
-        "     |" + te[6].toFixed(4) + ", " + te[7].toFixed(4) + ", " + te[8].toFixed(4) + "|";
+            "Mat33|" + te[0].toFixed(4) + ", " + te[1].toFixed(4) + ", " + te[2].toFixed(4) + "|\n" +
+            "     |" + te[3].toFixed(4) + ", " + te[4].toFixed(4) + ", " + te[5].toFixed(4) + "|\n" +
+            "     |" + te[6].toFixed(4) + ", " + te[7].toFixed(4) + ", " + te[8].toFixed(4) + "|";
         return text;
         return text;
     },
     },
 
 
@@ -2203,7 +2203,7 @@ OIMO.Quat.prototype = {
     },
     },
     mul: function (q1, q2) {
     mul: function (q1, q2) {
         var ax = q1.x, ay = q1.y, az = q1.z, as = q1.s,
         var ax = q1.x, ay = q1.y, az = q1.z, as = q1.s,
-        bx = q2.x, by = q2.y, bz = q2.z, bs = q2.s;
+            bx = q2.x, by = q2.y, bz = q2.z, bs = q2.s;
         this.x = ax * bs + as * bx + ay * bz - az * by;
         this.x = ax * bs + as * bx + ay * bz - az * by;
         this.y = ay * bs + as * by + az * bx - ax * bz;
         this.y = ay * bs + as * by + az * bx - ax * bz;
         this.z = az * bs + as * bz + ax * by - ay * bx;
         this.z = az * bs + as * bz + ax * by - ay * bx;
@@ -2424,7 +2424,7 @@ OIMO.Vec3.prototype = {
     },*/
     },*/
     cross: function (v1, v2) {
     cross: function (v1, v2) {
         var ax = v1.x, ay = v1.y, az = v1.z,
         var ax = v1.x, ay = v1.y, az = v1.z,
-        bx = v2.x, by = v2.y, bz = v2.z;
+            bx = v2.x, by = v2.y, bz = v2.z;
         this.x = ay * bz - az * by;
         this.x = ay * bz - az * by;
         this.y = az * bx - ax * bz;
         this.y = az * bx - ax * bz;
         this.z = ax * by - ay * bx;
         this.z = ax * by - ay * bx;
@@ -3766,7 +3766,7 @@ OIMO.SliderJoint.prototype.preSolve = function (timeStep, invTimeStep) {
         nx * (angAxis1Y * angAxis2Z - angAxis1Z * angAxis2Y) +
         nx * (angAxis1Y * angAxis2Z - angAxis1Z * angAxis2Y) +
         ny * (angAxis1Z * angAxis2X - angAxis1X * angAxis2Z) +
         ny * (angAxis1Z * angAxis2X - angAxis1X * angAxis2Z) +
         nz * (angAxis1X * angAxis2Y - angAxis1Y * angAxis2X) < 0
         nz * (angAxis1X * angAxis2Y - angAxis1Y * angAxis2X) < 0
-        ) {
+    ) {
         this.rotationalLimitMotor.angle = -this.acosClamp(angAxis1X * angAxis2X + angAxis1Y * angAxis2Y + angAxis1Z * angAxis2Z);
         this.rotationalLimitMotor.angle = -this.acosClamp(angAxis1X * angAxis2X + angAxis1Y * angAxis2Y + angAxis1Z * angAxis2Z);
     } else {
     } else {
         this.rotationalLimitMotor.angle = this.acosClamp(angAxis1X * angAxis2X + angAxis1Y * angAxis2Y + angAxis1Z * angAxis2Z);
         this.rotationalLimitMotor.angle = this.acosClamp(angAxis1X * angAxis2X + angAxis1Y * angAxis2Y + angAxis1Z * angAxis2Z);
@@ -4654,9 +4654,9 @@ OIMO.Rotational3Constraint.prototype = {
         this.k22 += this.cfm3;
         this.k22 += this.cfm3;
 
 
         var inv = 1 / (
         var inv = 1 / (
-        this.k00 * (this.k11 * this.k22 - this.k21 * this.k12) +
-        this.k10 * (this.k21 * this.k02 - this.k01 * this.k22) +
-        this.k20 * (this.k01 * this.k12 - this.k11 * this.k02)
+            this.k00 * (this.k11 * this.k22 - this.k21 * this.k12) +
+            this.k10 * (this.k21 * this.k02 - this.k01 * this.k22) +
+            this.k20 * (this.k01 * this.k12 - this.k11 * this.k02)
         );
         );
         this.d00 = (this.k11 * this.k22 - this.k12 * this.k21) * inv;
         this.d00 = (this.k11 * this.k22 - this.k12 * this.k21) * inv;
         this.d01 = (this.k02 * this.k21 - this.k01 * this.k22) * inv;
         this.d01 = (this.k02 * this.k21 - this.k01 * this.k22) * inv;
@@ -5580,9 +5580,9 @@ OIMO.Translational3Constraint.prototype = {
         this.k22 += this.cfm3;
         this.k22 += this.cfm3;
 
 
         var inv = 1 / (
         var inv = 1 / (
-        this.k00 * (this.k11 * this.k22 - this.k21 * this.k12) +
-        this.k10 * (this.k21 * this.k02 - this.k01 * this.k22) +
-        this.k20 * (this.k01 * this.k12 - this.k11 * this.k02)
+            this.k00 * (this.k11 * this.k22 - this.k21 * this.k12) +
+            this.k10 * (this.k21 * this.k02 - this.k01 * this.k22) +
+            this.k20 * (this.k01 * this.k12 - this.k11 * this.k02)
         );
         );
         this.d00 = (this.k11 * this.k22 - this.k12 * this.k21) * inv;
         this.d00 = (this.k11 * this.k22 - this.k12 * this.k21) * inv;
         this.d01 = (this.k02 * this.k21 - this.k01 * this.k22) * inv;
         this.d01 = (this.k02 * this.k21 - this.k01 * this.k22) * inv;
@@ -5956,7 +5956,7 @@ OIMO.TranslationalConstraint.prototype = {
         this.a2y = this.t2x * this.i2e10 + this.t2y * this.i2e11 + this.t2z * this.i2e12;
         this.a2y = this.t2x * this.i2e10 + this.t2y * this.i2e11 + this.t2z * this.i2e12;
         this.a2z = this.t2x * this.i2e20 + this.t2y * this.i2e21 + this.t2z * this.i2e22;
         this.a2z = this.t2x * this.i2e20 + this.t2y * this.i2e21 + this.t2z * this.i2e22;
         this.motorDenom =
         this.motorDenom =
-        this.m1 + this.m2 +
+            this.m1 + this.m2 +
             this.ax * (this.a1y * this.r1z - this.a1z * this.r1y + this.a2y * this.r2z - this.a2z * this.r2y) +
             this.ax * (this.a1y * this.r1z - this.a1z * this.r1y + this.a2y * this.r2z - this.a2z * this.r2y) +
             this.ay * (this.a1z * this.r1x - this.a1x * this.r1z + this.a2z * this.r2x - this.a2x * this.r2z) +
             this.ay * (this.a1z * this.r1x - this.a1x * this.r1z + this.a2z * this.r2x - this.a2x * this.r2z) +
             this.az * (this.a1x * this.r1y - this.a1y * this.r1x + this.a2x * this.r2y - this.a2y * this.r2x);
             this.az * (this.a1x * this.r1y - this.a1y * this.r1x + this.a2x * this.r2y - this.a2y * this.r2x);
@@ -6613,18 +6613,18 @@ OIMO.ContactConstraint.prototype.solve = function () {
         var rvY = lv2y - lv1y;
         var rvY = lv2y - lv1y;
         var rvZ = lv2z - lv1z;
         var rvZ = lv2z - lv1z;
         rvn =
         rvn =
-        rvX * c.tanX + rvY * c.tanY + rvZ * c.tanZ +
-        av2x * c.tanT2X + av2y * c.tanT2Y + av2z * c.tanT2Z -
-        av1x * c.tanT1X - av1y * c.tanT1Y - av1z * c.tanT1Z
-        ;
+            rvX * c.tanX + rvY * c.tanY + rvZ * c.tanZ +
+            av2x * c.tanT2X + av2y * c.tanT2Y + av2z * c.tanT2Z -
+            av1x * c.tanT1X - av1y * c.tanT1Y - av1z * c.tanT1Z
+            ;
         oldImp1 = tanImp;
         oldImp1 = tanImp;
         newImp1 = rvn * c.tanDen;
         newImp1 = rvn * c.tanDen;
         tanImp += newImp1;
         tanImp += newImp1;
         rvn =
         rvn =
-        rvX * c.binX + rvY * c.binY + rvZ * c.binZ +
-        av2x * c.binT2X + av2y * c.binT2Y + av2z * c.binT2Z -
-        av1x * c.binT1X - av1y * c.binT1Y - av1z * c.binT1Z
-        ;
+            rvX * c.binX + rvY * c.binY + rvZ * c.binZ +
+            av2x * c.binT2X + av2y * c.binT2Y + av2z * c.binT2Z -
+            av1x * c.binT1X - av1y * c.binT1Y - av1z * c.binT1Z
+            ;
         oldImp2 = binImp;
         oldImp2 = binImp;
         newImp2 = rvn * c.binDen;
         newImp2 = rvn * c.binDen;
         binImp += newImp2;
         binImp += newImp2;
@@ -6654,9 +6654,9 @@ OIMO.ContactConstraint.prototype.solve = function () {
 
 
         // restitution part
         // restitution part
         rvn =
         rvn =
-        (lv2x - lv1x) * c.norX + (lv2y - lv1y) * c.norY + (lv2z - lv1z) * c.norZ +
-        av2x * c.norT2X + av2y * c.norT2Y + av2z * c.norT2Z -
-        av1x * c.norT1X - av1y * c.norT1Y - av1z * c.norT1Z;
+            (lv2x - lv1x) * c.norX + (lv2y - lv1y) * c.norY + (lv2z - lv1z) * c.norZ +
+            av2x * c.norT2X + av2y * c.norT2Y + av2z * c.norT2Z -
+            av1x * c.norT1X - av1y * c.norT1Y - av1z * c.norT1Z;
 
 
         oldImp1 = norImp;
         oldImp1 = norImp;
         newImp1 = (rvn - c.norTar) * c.norDen;
         newImp1 = (rvn - c.norTar) * c.norDen;
@@ -7329,10 +7329,10 @@ OIMO.TetraShape = function (config, p1, p2, p3, p4) {
     // Vertices and faces of tetra
     // Vertices and faces of tetra
     this.verts = [p1, p2, p3, p4];
     this.verts = [p1, p2, p3, p4];
     this.faces = [
     this.faces = [
-      mtri(0, 1, 2),
-      mtri(1, 2, 3),
-      mtri(2, 3, 4),
-      mtri(4, 0, 1),
+        mtri(0, 1, 2),
+        mtri(1, 2, 3),
+        mtri(2, 3, 4),
+        mtri(4, 0, 1),
     ];
     ];
 };
 };
 OIMO.TetraShape.prototype = Object.create(OIMO.Shape.prototype);
 OIMO.TetraShape.prototype = Object.create(OIMO.Shape.prototype);
@@ -9207,14 +9207,14 @@ OIMO.BoxCylinderCollisionDetector.prototype.getSep = function (c1, c2, sep, pos,
                 return false;
                 return false;
             }
             }
             if (
             if (
-            (v4y * v1z - v4z * v1y) * v0x +
-            (v4z * v1x - v4x * v1z) * v0y +
-            (v4x * v1y - v4y * v1x) * v0z < 0
+                (v4y * v1z - v4z * v1y) * v0x +
+                (v4z * v1x - v4x * v1z) * v0y +
+                (v4x * v1y - v4y * v1x) * v0z < 0
             ) {
             ) {
                 if (
                 if (
-                (v4y * v2z - v4z * v2y) * v0x +
-                (v4z * v2x - v4x * v2z) * v0y +
-                (v4x * v2y - v4y * v2x) * v0z < 0
+                    (v4y * v2z - v4z * v2y) * v0x +
+                    (v4z * v2x - v4x * v2z) * v0y +
+                    (v4x * v2y - v4y * v2x) * v0z < 0
                 ) {
                 ) {
                     v1x = v4x;
                     v1x = v4x;
                     v1y = v4y;
                     v1y = v4y;
@@ -9238,9 +9238,9 @@ OIMO.BoxCylinderCollisionDetector.prototype.getSep = function (c1, c2, sep, pos,
                 }
                 }
             } else {
             } else {
                 if (
                 if (
-                (v4y * v3z - v4z * v3y) * v0x +
-                (v4z * v3x - v4x * v3z) * v0y +
-                (v4x * v3y - v4y * v3x) * v0z < 0
+                    (v4y * v3z - v4z * v3y) * v0x +
+                    (v4z * v3x - v4x * v3z) * v0y +
+                    (v4x * v3y - v4y * v3x) * v0z < 0
                 ) {
                 ) {
                     v2x = v4x;
                     v2x = v4x;
                     v2y = v4y;
                     v2y = v4y;
@@ -10239,14 +10239,14 @@ OIMO.CylinderCylinderCollisionDetector.prototype.getSep = function (c1, c2, sep,
                 return false;
                 return false;
             }
             }
             if (
             if (
-            (v4y * v1z - v4z * v1y) * v0x +
-            (v4z * v1x - v4x * v1z) * v0y +
-            (v4x * v1y - v4y * v1x) * v0z < 0
+                (v4y * v1z - v4z * v1y) * v0x +
+                (v4z * v1x - v4x * v1z) * v0y +
+                (v4x * v1y - v4y * v1x) * v0z < 0
             ) {
             ) {
                 if (
                 if (
-                (v4y * v2z - v4z * v2y) * v0x +
-                (v4z * v2x - v4x * v2z) * v0y +
-                (v4x * v2y - v4y * v2x) * v0z < 0
+                    (v4y * v2z - v4z * v2y) * v0x +
+                    (v4z * v2x - v4x * v2z) * v0y +
+                    (v4x * v2y - v4y * v2x) * v0z < 0
                 ) {
                 ) {
                     v1x = v4x;
                     v1x = v4x;
                     v1y = v4y;
                     v1y = v4y;
@@ -10270,9 +10270,9 @@ OIMO.CylinderCylinderCollisionDetector.prototype.getSep = function (c1, c2, sep,
                 }
                 }
             } else {
             } else {
                 if (
                 if (
-                (v4y * v3z - v4z * v3y) * v0x +
-                (v4z * v3x - v4x * v3z) * v0y +
-                (v4x * v3y - v4y * v3x) * v0z < 0
+                    (v4y * v3z - v4z * v3y) * v0x +
+                    (v4z * v3x - v4x * v3z) * v0y +
+                    (v4x * v3y - v4y * v3x) * v0z < 0
                 ) {
                 ) {
                     v2x = v4x;
                     v2x = v4x;
                     v2y = v4y;
                     v2y = v4y;
@@ -10932,9 +10932,9 @@ OIMO.TetraTetraCollisionDetector.prototype.detectCollision = function (tet1, tet
             j3 = vs2[fs[i].c];
             j3 = vs2[fs[i].c];
 
 
             if (
             if (
-              tricheck(pt(vec.x, vec.y), pt(j1.x, j1.y), pt(j2.x, j2.y), pt(j3.x, j3.y)) &&
-              tricheck(pt(vec.x, vec.z), pt(j1.x, j1.z), pt(j2.x, j2.z), pt(j3.x, j3.z)) &&
-              tricheck(pt(vec.z, vec.y), pt(j1.z, j1.y), pt(j2.z, j2.y), pt(j3.z, j3.y))
+                tricheck(pt(vec.x, vec.y), pt(j1.x, j1.y), pt(j2.x, j2.y), pt(j3.x, j3.y)) &&
+                tricheck(pt(vec.x, vec.z), pt(j1.x, j1.z), pt(j2.x, j2.z), pt(j3.x, j3.z)) &&
+                tricheck(pt(vec.z, vec.y), pt(j1.z, j1.y), pt(j2.z, j2.y), pt(j3.z, j3.y))
             )
             )
                 ts++;
                 ts++;
 
 
@@ -11518,15 +11518,15 @@ OIMO.SAPBroadPhase = function () {
     this.numElementsS = 0;
     this.numElementsS = 0;
     // dynamic proxies
     // dynamic proxies
     this.axesD = [
     this.axesD = [
-       new OIMO.SAPAxis(),
-       new OIMO.SAPAxis(),
-       new OIMO.SAPAxis()
+        new OIMO.SAPAxis(),
+        new OIMO.SAPAxis(),
+        new OIMO.SAPAxis()
     ];
     ];
     // static or sleeping proxies
     // static or sleeping proxies
     this.axesS = [
     this.axesS = [
-       new OIMO.SAPAxis(),
-       new OIMO.SAPAxis(),
-       new OIMO.SAPAxis()
+        new OIMO.SAPAxis(),
+        new OIMO.SAPAxis(),
+        new OIMO.SAPAxis()
     ];
     ];
 
 
     this.index1 = 0;
     this.index1 = 0;
@@ -12510,3 +12510,20 @@ OIMO.World.prototype.add = function (obj) {
     }
     }
 }
 }
 
 
+//UMD simplified
+
+var root = this;
+
+if (!root['OIMO']) {
+    if (typeof exports === 'object' && typeof module === 'object')
+        module.exports = OIMO;
+    else if (typeof define === 'function' && define.amd)
+        define([], function () {
+            return OIMO;
+        });
+    else if (typeof exports === 'object')
+        exports["OIMO"] = OIMO;
+    else {
+        root["OIMO"] = OIMO;
+    }
+}

File diff suppressed because it is too large
+ 11914 - 8919
dist/babylon.d.ts


File diff suppressed because it is too large
+ 55 - 48
dist/babylon.js


File diff suppressed because it is too large
+ 50529 - 38455
dist/babylon.max.js


File diff suppressed because it is too large
+ 57 - 50
dist/babylon.worker.js


+ 239 - 89
dist/gui/babylon.gui.d.ts

@@ -1,31 +1,45 @@
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
+    interface IFocusableControl {
+        onFocus(): void;
+        onBlur(): void;
+        processKeyboard(evt: KeyboardEvent): void;
+    }
     class AdvancedDynamicTexture extends DynamicTexture {
     class AdvancedDynamicTexture extends DynamicTexture {
         private _isDirty;
         private _isDirty;
         private _renderObserver;
         private _renderObserver;
         private _resizeObserver;
         private _resizeObserver;
+        private _preKeyboardObserver;
         private _pointerMoveObserver;
         private _pointerMoveObserver;
         private _pointerObserver;
         private _pointerObserver;
-        private _canvasBlurObserver;
+        private _canvasPointerOutObserver;
         private _background;
         private _background;
         _rootContainer: Container;
         _rootContainer: Container;
-        _lastControlOver: Control;
-        _lastControlDown: Control;
-        _capturingControl: Control;
+        _lastPickedControl: Control;
+        _lastControlOver: Nullable<Control>;
+        _lastControlDown: Nullable<Control>;
+        _capturingControl: Nullable<Control>;
         _shouldBlockPointer: boolean;
         _shouldBlockPointer: boolean;
-        _layerToDispose: Layer;
+        _layerToDispose: Nullable<Layer>;
         _linkedControls: Control[];
         _linkedControls: Control[];
         private _isFullscreen;
         private _isFullscreen;
         private _fullscreenViewport;
         private _fullscreenViewport;
         private _idealWidth;
         private _idealWidth;
         private _idealHeight;
         private _idealHeight;
         private _renderAtIdealSize;
         private _renderAtIdealSize;
+        private _focusedControl;
+        private _blockNextFocusCheck;
+        private _renderScale;
+        renderScale: number;
         background: string;
         background: string;
         idealWidth: number;
         idealWidth: number;
         idealHeight: number;
         idealHeight: number;
         renderAtIdealSize: boolean;
         renderAtIdealSize: boolean;
-        readonly layer: Layer;
-        constructor(name: string, width: number, height: number, scene: Scene, generateMipMaps?: boolean, samplingMode?: number);
+        readonly layer: Nullable<Layer>;
+        readonly rootContainer: Container;
+        focusedControl: Nullable<IFocusableControl>;
+        isForeground: boolean;
+        constructor(name: string, width: number | undefined, height: number | undefined, scene: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number);
         executeOnAllControls(func: (control: Control) => void, container?: Container): void;
         executeOnAllControls(func: (control: Control) => void, container?: Container): void;
         markAsDirty(): void;
         markAsDirty(): void;
         addControl(control: Control): AdvancedDynamicTexture;
         addControl(control: Control): AdvancedDynamicTexture;
@@ -35,12 +49,14 @@ declare module BABYLON.GUI {
         _getGlobalViewport(scene: Scene): Viewport;
         _getGlobalViewport(scene: Scene): Viewport;
         private _checkUpdate(camera);
         private _checkUpdate(camera);
         private _render();
         private _render();
-        private _doPicking(x, y, type);
+        private _doPicking(x, y, type, buttonIndex);
         attach(): void;
         attach(): void;
-        attachToMesh(mesh: AbstractMesh): void;
-        private _attachToOnBlur(scene);
-        static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number): AdvancedDynamicTexture;
-        static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Scene): AdvancedDynamicTexture;
+        attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
+        moveFocusToControl(control: IFocusableControl): void;
+        private _manageFocus();
+        private _attachToOnPointerOut(scene);
+        static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean): AdvancedDynamicTexture;
+        static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number): AdvancedDynamicTexture;
     }
     }
 }
 }
 
 
@@ -60,6 +76,10 @@ declare module BABYLON.GUI {
 
 
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
+    class Vector2WithInfo extends Vector2 {
+        buttonIndex: number;
+        constructor(source: Vector2, buttonIndex?: number);
+    }
     class Matrix2D {
     class Matrix2D {
         m: Float32Array;
         m: Float32Array;
         constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
         constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
@@ -79,7 +99,7 @@ declare module BABYLON.GUI {
         private static _TempCompose0;
         private static _TempCompose0;
         private static _TempCompose1;
         private static _TempCompose1;
         private static _TempCompose2;
         private static _TempCompose2;
-        static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Matrix2D, result: Matrix2D): void;
+        static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void;
     }
     }
 }
 }
 
 
@@ -90,10 +110,11 @@ declare module BABYLON.GUI {
         negativeValueAllowed: boolean;
         negativeValueAllowed: boolean;
         private _value;
         private _value;
         ignoreAdaptiveScaling: boolean;
         ignoreAdaptiveScaling: boolean;
-        constructor(value: any, unit?: number, negativeValueAllowed?: boolean);
+        constructor(value: number, unit?: number, negativeValueAllowed?: boolean);
         readonly isPercentage: boolean;
         readonly isPercentage: boolean;
         readonly isPixel: boolean;
         readonly isPixel: boolean;
         readonly internalValue: number;
         readonly internalValue: number;
+        getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
         getValue(host: AdvancedDynamicTexture): number;
         getValue(host: AdvancedDynamicTexture): number;
         toString(host: AdvancedDynamicTexture): string;
         toString(host: AdvancedDynamicTexture): string;
         fromString(source: string | number): boolean;
         fromString(source: string | number): boolean;
@@ -108,19 +129,20 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Control {
     class Control {
-        name: string;
+        name: string | undefined;
         private _alpha;
         private _alpha;
         private _alphaSet;
         private _alphaSet;
         private _zIndex;
         private _zIndex;
-        _root: Container;
+        _root: Nullable<Container>;
         _host: AdvancedDynamicTexture;
         _host: AdvancedDynamicTexture;
+        parent: Nullable<Container>;
         _currentMeasure: Measure;
         _currentMeasure: Measure;
         private _fontFamily;
         private _fontFamily;
+        private _fontStyle;
         private _fontSize;
         private _fontSize;
         private _font;
         private _font;
         _width: ValueAndUnit;
         _width: ValueAndUnit;
         _height: ValueAndUnit;
         _height: ValueAndUnit;
-        private _lastMeasuredFont;
         protected _fontOffset: {
         protected _fontOffset: {
             ascent: number;
             ascent: number;
             height: number;
             height: number;
@@ -130,7 +152,7 @@ declare module BABYLON.GUI {
         protected _horizontalAlignment: number;
         protected _horizontalAlignment: number;
         protected _verticalAlignment: number;
         protected _verticalAlignment: number;
         private _isDirty;
         private _isDirty;
-        private _cachedParentMeasure;
+        protected _cachedParentMeasure: Measure;
         private _paddingLeft;
         private _paddingLeft;
         private _paddingRight;
         private _paddingRight;
         private _paddingTop;
         private _paddingTop;
@@ -143,19 +165,25 @@ declare module BABYLON.GUI {
         private _transformCenterX;
         private _transformCenterX;
         private _transformCenterY;
         private _transformCenterY;
         private _transformMatrix;
         private _transformMatrix;
-        private _invertTransformMatrix;
-        private _transformedPosition;
+        protected _invertTransformMatrix: Matrix2D;
+        protected _transformedPosition: Vector2;
         private _isMatrixDirty;
         private _isMatrixDirty;
         private _cachedOffsetX;
         private _cachedOffsetX;
         private _cachedOffsetY;
         private _cachedOffsetY;
         private _isVisible;
         private _isVisible;
-        _linkedMesh: AbstractMesh;
+        _linkedMesh: Nullable<AbstractMesh>;
         private _fontSet;
         private _fontSet;
         private _dummyVector2;
         private _dummyVector2;
         private _downCount;
         private _downCount;
         private _enterCount;
         private _enterCount;
+        private _doNotRender;
         isHitTestVisible: boolean;
         isHitTestVisible: boolean;
         isPointerBlocker: boolean;
         isPointerBlocker: boolean;
+        isFocusInvisible: boolean;
+        shadowOffsetX: number;
+        shadowOffsetY: number;
+        shadowBlur: number;
+        shadowColor: string;
         protected _linkOffsetX: ValueAndUnit;
         protected _linkOffsetX: ValueAndUnit;
         protected _linkOffsetY: ValueAndUnit;
         protected _linkOffsetY: ValueAndUnit;
         readonly typeName: string;
         readonly typeName: string;
@@ -173,12 +201,12 @@ declare module BABYLON.GUI {
         * An event triggered when the pointer taps the control
         * An event triggered when the pointer taps the control
         * @type {BABYLON.Observable}
         * @type {BABYLON.Observable}
         */
         */
-        onPointerDownObservable: Observable<Vector2>;
+        onPointerDownObservable: Observable<Vector2WithInfo>;
         /**
         /**
         * An event triggered when pointer up
         * An event triggered when pointer up
         * @type {BABYLON.Observable}
         * @type {BABYLON.Observable}
         */
         */
-        onPointerUpObservable: Observable<Vector2>;
+        onPointerUpObservable: Observable<Vector2WithInfo>;
         /**
         /**
         * An event triggered when pointer enters the control
         * An event triggered when pointer enters the control
         * @type {BABYLON.Observable}
         * @type {BABYLON.Observable}
@@ -189,6 +217,11 @@ declare module BABYLON.GUI {
         * @type {BABYLON.Observable}
         * @type {BABYLON.Observable}
         */
         */
         onDirtyObservable: Observable<Control>;
         onDirtyObservable: Observable<Control>;
+        /**
+       * An event triggered after the control is drawn
+       * @type {BABYLON.Observable}
+       */
+        onAfterDrawObservable: Observable<Control>;
         alpha: number;
         alpha: number;
         scaleX: number;
         scaleX: number;
         scaleY: number;
         scaleY: number;
@@ -198,34 +231,48 @@ declare module BABYLON.GUI {
         horizontalAlignment: number;
         horizontalAlignment: number;
         verticalAlignment: number;
         verticalAlignment: number;
         width: string | number;
         width: string | number;
+        readonly widthInPixels: number;
         height: string | number;
         height: string | number;
+        readonly heightInPixels: number;
         fontFamily: string;
         fontFamily: string;
+        fontStyle: string;
+        readonly fontSizeInPixels: number;
         fontSize: string | number;
         fontSize: string | number;
         color: string;
         color: string;
         zIndex: number;
         zIndex: number;
+        notRenderable: boolean;
         isVisible: boolean;
         isVisible: boolean;
         readonly isDirty: boolean;
         readonly isDirty: boolean;
         paddingLeft: string | number;
         paddingLeft: string | number;
+        readonly paddingLeftInPixels: number;
         paddingRight: string | number;
         paddingRight: string | number;
+        readonly paddingRightInPixels: number;
         paddingTop: string | number;
         paddingTop: string | number;
+        readonly paddingTopInPixels: number;
         paddingBottom: string | number;
         paddingBottom: string | number;
+        readonly paddingBottomInPixels: number;
         left: string | number;
         left: string | number;
+        readonly leftInPixels: number;
         top: string | number;
         top: string | number;
+        readonly topInPixels: number;
         linkOffsetX: string | number;
         linkOffsetX: string | number;
+        readonly linkOffsetXInPixels: number;
         linkOffsetY: string | number;
         linkOffsetY: string | number;
+        readonly linkOffsetYInPixels: number;
         readonly centerX: number;
         readonly centerX: number;
         readonly centerY: number;
         readonly centerY: number;
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         getLocalCoordinates(globalCoordinates: Vector2): Vector2;
         getLocalCoordinates(globalCoordinates: Vector2): Vector2;
         getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control;
         getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control;
+        getParentLocalCoordinates(globalCoordinates: Vector2): Vector2;
         moveToVector3(position: Vector3, scene: Scene): void;
         moveToVector3(position: Vector3, scene: Scene): void;
-        linkWithMesh(mesh: AbstractMesh): void;
+        linkWithMesh(mesh: Nullable<AbstractMesh>): void;
         _moveToProjectedPosition(projectedPosition: Vector3): void;
         _moveToProjectedPosition(projectedPosition: Vector3): void;
         _markMatrixAsDirty(): void;
         _markMatrixAsDirty(): void;
         _markAsDirty(): void;
         _markAsDirty(): void;
         _markAllAsDirty(): void;
         _markAllAsDirty(): void;
-        _link(root: Container, host: AdvancedDynamicTexture): void;
+        _link(root: Nullable<Container>, host: AdvancedDynamicTexture): void;
         protected _transform(context: CanvasRenderingContext2D): void;
         protected _transform(context: CanvasRenderingContext2D): void;
         protected _applyStates(context: CanvasRenderingContext2D): void;
         protected _applyStates(context: CanvasRenderingContext2D): void;
         protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
         protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
@@ -236,15 +283,16 @@ declare module BABYLON.GUI {
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         contains(x: number, y: number): boolean;
         contains(x: number, y: number): boolean;
-        _processPicking(x: number, y: number, type: number): boolean;
-        protected _onPointerMove(coordinates: Vector2): void;
-        protected _onPointerEnter(): boolean;
-        protected _onPointerOut(): void;
-        protected _onPointerDown(coordinates: Vector2): boolean;
-        protected _onPointerUp(coordinates: Vector2): void;
+        _processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
+        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerEnter(target: Control): boolean;
+        _onPointerOut(target: Control): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
         forcePointerUp(): void;
         forcePointerUp(): void;
-        _processObservables(type: number, x: number, y: number): boolean;
+        _processObservables(type: number, x: number, y: number, buttonIndex: number): boolean;
         private _prepareFont();
         private _prepareFont();
+        dispose(): void;
         private static _HORIZONTAL_ALIGNMENT_LEFT;
         private static _HORIZONTAL_ALIGNMENT_LEFT;
         private static _HORIZONTAL_ALIGNMENT_RIGHT;
         private static _HORIZONTAL_ALIGNMENT_RIGHT;
         private static _HORIZONTAL_ALIGNMENT_CENTER;
         private static _HORIZONTAL_ALIGNMENT_CENTER;
@@ -274,16 +322,16 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Container extends Control {
     class Container extends Control {
-        name: string;
+        name: string | undefined;
         protected _children: Control[];
         protected _children: Control[];
         protected _measureForChildren: Measure;
         protected _measureForChildren: Measure;
         protected _background: string;
         protected _background: string;
         background: string;
         background: string;
         readonly children: Control[];
         readonly children: Control[];
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
-        getChildByName(name: string): Control;
-        getChildByType(name: string, type: string): Control;
+        getChildByName(name: string): Nullable<Control>;
+        getChildByType(name: string, type: string): Nullable<Control>;
         containsControl(control: Control): boolean;
         containsControl(control: Control): boolean;
         addControl(control: Control): Container;
         addControl(control: Control): Container;
         removeControl(control: Control): Container;
         removeControl(control: Control): Container;
@@ -291,26 +339,28 @@ declare module BABYLON.GUI {
         _markMatrixAsDirty(): void;
         _markMatrixAsDirty(): void;
         _markAllAsDirty(): void;
         _markAllAsDirty(): void;
         protected _localDraw(context: CanvasRenderingContext2D): void;
         protected _localDraw(context: CanvasRenderingContext2D): void;
-        _link(root: Container, host: AdvancedDynamicTexture): void;
+        _link(root: Nullable<Container>, host: AdvancedDynamicTexture): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
-        _processPicking(x: number, y: number, type: number): boolean;
+        _processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
         protected _clipForChildren(context: CanvasRenderingContext2D): void;
         protected _clipForChildren(context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        dispose(): void;
     }
     }
 }
 }
 
 
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class StackPanel extends Container {
     class StackPanel extends Container {
-        name: string;
+        name: string | undefined;
         private _isVertical;
         private _isVertical;
         private _manualWidth;
         private _manualWidth;
         private _manualHeight;
         private _manualHeight;
+        private _doNotTrackManualChanges;
         private _tempMeasureStore;
         private _tempMeasureStore;
         isVertical: boolean;
         isVertical: boolean;
-        manualWidth: boolean;
-        manualHeight: boolean;
-        constructor(name?: string);
+        width: string | number;
+        height: string | number;
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
     }
     }
@@ -319,12 +369,12 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Rectangle extends Container {
     class Rectangle extends Container {
-        name: string;
+        name: string | undefined;
         private _thickness;
         private _thickness;
         private _cornerRadius;
         private _cornerRadius;
         thickness: number;
         thickness: number;
         cornerRadius: number;
         cornerRadius: number;
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         protected _localDraw(context: CanvasRenderingContext2D): void;
         protected _localDraw(context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -336,10 +386,10 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Ellipse extends Container {
     class Ellipse extends Container {
-        name: string;
+        name: string | undefined;
         private _thickness;
         private _thickness;
         thickness: number;
         thickness: number;
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         protected _localDraw(context: CanvasRenderingContext2D): void;
         protected _localDraw(context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -348,12 +398,10 @@ declare module BABYLON.GUI {
 }
 }
 
 
 
 
-declare var DOMImage: new (width?: number, height?: number) => HTMLImageElement;
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Line extends Control {
     class Line extends Control {
-        name: string;
+        name: string | undefined;
         private _lineWidth;
         private _lineWidth;
-        private _background;
         private _x1;
         private _x1;
         private _y1;
         private _y1;
         private _x2;
         private _x2;
@@ -372,7 +420,7 @@ declare module BABYLON.GUI {
         verticalAlignment: number;
         verticalAlignment: number;
         private readonly _effectiveX2;
         private readonly _effectiveX2;
         private readonly _effectiveY2;
         private readonly _effectiveY2;
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _measure(): void;
         _measure(): void;
@@ -382,10 +430,9 @@ declare module BABYLON.GUI {
 }
 }
 
 
 
 
-declare var DOMImage: new (width?: number, height?: number) => HTMLImageElement;
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Slider extends Control {
     class Slider extends Control {
-        name: string;
+        name: string | undefined;
         private _thumbWidth;
         private _thumbWidth;
         private _minimum;
         private _minimum;
         private _maximum;
         private _maximum;
@@ -393,30 +440,33 @@ declare module BABYLON.GUI {
         private _background;
         private _background;
         private _borderColor;
         private _borderColor;
         private _barOffset;
         private _barOffset;
+        private _isThumbCircle;
         onValueChangedObservable: Observable<number>;
         onValueChangedObservable: Observable<number>;
         borderColor: string;
         borderColor: string;
         background: string;
         background: string;
         barOffset: string | number;
         barOffset: string | number;
+        readonly barOffsetInPixels: number;
         thumbWidth: string | number;
         thumbWidth: string | number;
+        readonly thumbWidthInPixels: number;
         minimum: number;
         minimum: number;
         maximum: number;
         maximum: number;
         value: number;
         value: number;
-        constructor(name?: string);
+        isThumbCircle: boolean;
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         private _pointerIsDown;
         private _pointerIsDown;
-        private _updateValueFromPointer(x);
-        protected _onPointerDown(coordinates: Vector2): boolean;
-        protected _onPointerMove(coordinates: Vector2): void;
-        protected _onPointerUp(coordinates: Vector2): void;
+        private _updateValueFromPointer(x, y);
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
     }
     }
 }
 }
 
 
 
 
-declare var DOMImage: new (width?: number, height?: number) => HTMLImageElement;
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Checkbox extends Control {
     class Checkbox extends Control {
-        name: string;
+        name: string | undefined;
         private _isChecked;
         private _isChecked;
         private _background;
         private _background;
         private _checkSizeRatio;
         private _checkSizeRatio;
@@ -426,18 +476,17 @@ declare module BABYLON.GUI {
         checkSizeRatio: number;
         checkSizeRatio: number;
         background: string;
         background: string;
         isChecked: boolean;
         isChecked: boolean;
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
-        protected _onPointerDown(coordinates: Vector2): boolean;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
     }
     }
 }
 }
 
 
 
 
-declare var DOMImage: new (width?: number, height?: number) => HTMLImageElement;
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class RadioButton extends Control {
     class RadioButton extends Control {
-        name: string;
+        name: string | undefined;
         private _isChecked;
         private _isChecked;
         private _background;
         private _background;
         private _checkSizeRatio;
         private _checkSizeRatio;
@@ -448,44 +497,50 @@ declare module BABYLON.GUI {
         checkSizeRatio: number;
         checkSizeRatio: number;
         background: string;
         background: string;
         isChecked: boolean;
         isChecked: boolean;
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
-        protected _onPointerDown(coordinates: Vector2): boolean;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
     }
     }
 }
 }
 
 
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class TextBlock extends Control {
     class TextBlock extends Control {
-        name: string;
+        name: string | undefined;
         private _text;
         private _text;
-        private _textY;
         private _textWrapping;
         private _textWrapping;
         private _textHorizontalAlignment;
         private _textHorizontalAlignment;
         private _textVerticalAlignment;
         private _textVerticalAlignment;
         private _lines;
         private _lines;
-        private _totalHeight;
+        private _resizeToFit;
+        /**
+        * An event triggered after the text is changed
+        * @type {BABYLON.Observable}
+        */
+        onTextChangedObservable: Observable<TextBlock>;
+        resizeToFit: boolean;
         textWrapping: boolean;
         textWrapping: boolean;
         text: string;
         text: string;
         textHorizontalAlignment: number;
         textHorizontalAlignment: number;
         textVerticalAlignment: number;
         textVerticalAlignment: number;
-        constructor(name?: string, text?: string);
+        constructor(name?: string | undefined, text?: string);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         private _drawText(text, textWidth, y, context);
         private _drawText(text, textWidth, y, context);
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
-        protected _parseLine(line: string, context: CanvasRenderingContext2D): object;
-        protected _parseLineWithTextWrapping(line: string, context: CanvasRenderingContext2D): object;
+        protected _parseLine(line: string | undefined, context: CanvasRenderingContext2D): object;
+        protected _parseLineWithTextWrapping(line: string | undefined, context: CanvasRenderingContext2D): object;
         protected _renderLines(context: CanvasRenderingContext2D): void;
         protected _renderLines(context: CanvasRenderingContext2D): void;
+        dispose(): void;
     }
     }
 }
 }
 
 
 
 
-declare var DOMImage: new (width?: number, height?: number) => HTMLImageElement;
+declare var DOMImage: new (width?: number | undefined, height?: number | undefined) => HTMLImageElement;
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Image extends Control {
     class Image extends Control {
-        name: string;
+        name: string | undefined;
         private _domImage;
         private _domImage;
         private _imageWidth;
         private _imageWidth;
         private _imageHeight;
         private _imageHeight;
@@ -497,6 +552,9 @@ declare module BABYLON.GUI {
         private _sourceTop;
         private _sourceTop;
         private _sourceWidth;
         private _sourceWidth;
         private _sourceHeight;
         private _sourceHeight;
+        private _cellWidth;
+        private _cellHeight;
+        private _cellId;
         sourceLeft: number;
         sourceLeft: number;
         sourceTop: number;
         sourceTop: number;
         sourceWidth: number;
         sourceWidth: number;
@@ -505,8 +563,11 @@ declare module BABYLON.GUI {
         stretch: number;
         stretch: number;
         domImage: HTMLImageElement;
         domImage: HTMLImageElement;
         private _onImageLoaded();
         private _onImageLoaded();
-        source: string;
-        constructor(name?: string, url?: string);
+        source: Nullable<string>;
+        cellWidth: number;
+        cellHeight: number;
+        cellId: number;
+        constructor(name?: string | undefined, url?: Nullable<string>);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         synchronizeSizeWithContent(): void;
         synchronizeSizeWithContent(): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -524,29 +585,29 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class Button extends Rectangle {
     class Button extends Rectangle {
-        name: string;
+        name: string | undefined;
         pointerEnterAnimation: () => void;
         pointerEnterAnimation: () => void;
         pointerOutAnimation: () => void;
         pointerOutAnimation: () => void;
         pointerDownAnimation: () => void;
         pointerDownAnimation: () => void;
         pointerUpAnimation: () => void;
         pointerUpAnimation: () => void;
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
-        _processPicking(x: number, y: number, type: number): boolean;
-        protected _onPointerEnter(): boolean;
-        protected _onPointerOut(): void;
-        protected _onPointerDown(coordinates: Vector2): boolean;
-        protected _onPointerUp(coordinates: Vector2): void;
+        _processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
+        _onPointerEnter(target: Control): boolean;
+        _onPointerOut(target: Control): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
         static CreateImageButton(name: string, text: string, imageUrl: string): Button;
         static CreateImageButton(name: string, text: string, imageUrl: string): Button;
         static CreateImageOnlyButton(name: string, imageUrl: string): Button;
         static CreateImageOnlyButton(name: string, imageUrl: string): Button;
         static CreateSimpleButton(name: string, text: string): Button;
         static CreateSimpleButton(name: string, text: string): Button;
+        static CreateImageWithCenterTextButton(name: string, text: string, imageUrl: string): Button;
     }
     }
 }
 }
 
 
 
 
-declare var DOMImage: new (width?: number, height?: number) => HTMLImageElement;
 declare module BABYLON.GUI {
 declare module BABYLON.GUI {
     class ColorPicker extends Control {
     class ColorPicker extends Control {
-        name: string;
+        name: string | undefined;
         private _colorWheelCanvas;
         private _colorWheelCanvas;
         private _value;
         private _value;
         private _tmpColor;
         private _tmpColor;
@@ -563,7 +624,7 @@ declare module BABYLON.GUI {
         width: string | number;
         width: string | number;
         height: string | number;
         height: string | number;
         size: string | number;
         size: string | number;
-        constructor(name?: string);
+        constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _getTypeName(): string;
         private _updateSquareProps();
         private _updateSquareProps();
         private _drawGradientSquare(hueValue, left, top, width, height, context);
         private _drawGradientSquare(hueValue, left, top, width, height, context);
@@ -576,8 +637,97 @@ declare module BABYLON.GUI {
         private _updateValueFromPointer(x, y);
         private _updateValueFromPointer(x, y);
         private _isPointOnSquare(coordinates);
         private _isPointOnSquare(coordinates);
         private _isPointOnWheel(coordinates);
         private _isPointOnWheel(coordinates);
-        protected _onPointerDown(coordinates: Vector2): boolean;
-        protected _onPointerMove(coordinates: Vector2): void;
-        protected _onPointerUp(coordinates: Vector2): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class InputText extends Control implements IFocusableControl {
+        name: string | undefined;
+        private _text;
+        private _placeholderText;
+        private _background;
+        private _focusedBackground;
+        private _placeholderColor;
+        private _thickness;
+        private _margin;
+        private _autoStretchWidth;
+        private _maxWidth;
+        private _isFocused;
+        private _blinkTimeout;
+        private _blinkIsEven;
+        private _cursorOffset;
+        private _scrollLeft;
+        private _textWidth;
+        private _clickedCoordinate;
+        promptMessage: string;
+        onTextChangedObservable: Observable<InputText>;
+        onFocusObservable: Observable<InputText>;
+        onBlurObservable: Observable<InputText>;
+        maxWidth: string | number;
+        readonly maxWidthInPixels: number;
+        margin: string;
+        readonly marginInPixels: number;
+        autoStretchWidth: boolean;
+        thickness: number;
+        focusedBackground: string;
+        background: string;
+        placeholderColor: string;
+        placeholderText: string;
+        text: string;
+        width: string | number;
+        constructor(name?: string | undefined, text?: string);
+        onBlur(): void;
+        onFocus(): void;
+        protected _getTypeName(): string;
+        processKey(keyCode: number, key?: string): void;
+        processKeyboard(evt: KeyboardEvent): void;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
+        dispose(): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class KeyPropertySet {
+        width?: string;
+        height?: string;
+        paddingLeft?: string;
+        paddingRight?: string;
+        paddingTop?: string;
+        paddingBottom?: string;
+        color?: string;
+        background?: string;
+    }
+    class VirtualKeyboard extends StackPanel {
+        onKeyPressObservable: Observable<string>;
+        defaultButtonWidth: string;
+        defaultButtonHeight: string;
+        defaultButtonPaddingLeft: string;
+        defaultButtonPaddingRight: string;
+        defaultButtonPaddingTop: string;
+        defaultButtonPaddingBottom: string;
+        defaultButtonColor: string;
+        defaultButtonBackground: string;
+        shiftButtonColor: string;
+        selectedShiftThickness: number;
+        shiftState: number;
+        protected _getTypeName(): string;
+        private _createKey(key, propertySet);
+        addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
+        applyShiftState(shiftState: number): void;
+        private _connectedInputText;
+        private _onFocusObserver;
+        private _onBlurObserver;
+        private _onKeyPressObserver;
+        readonly connectedInputText: Nullable<InputText>;
+        connect(input: InputText): void;
+        disconnect(): void;
+        static CreateDefaultLayout(): VirtualKeyboard;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 1520 - 323
dist/gui/babylon.gui.js


File diff suppressed because it is too large
+ 3 - 3
dist/gui/babylon.gui.min.js


+ 738 - 0
dist/gui/babylon.gui.module.d.ts

@@ -0,0 +1,738 @@
+/// <reference types="babylonjs"/>
+
+declare module 'babylonjs-gui' { 
+    export = BABYLON.GUI; 
+}
+
+declare module BABYLON.GUI {
+    interface IFocusableControl {
+        onFocus(): void;
+        onBlur(): void;
+        processKeyboard(evt: KeyboardEvent): void;
+    }
+    class AdvancedDynamicTexture extends DynamicTexture {
+        private _isDirty;
+        private _renderObserver;
+        private _resizeObserver;
+        private _preKeyboardObserver;
+        private _pointerMoveObserver;
+        private _pointerObserver;
+        private _canvasPointerOutObserver;
+        private _background;
+        _rootContainer: Container;
+        _lastPickedControl: Control;
+        _lastControlOver: Nullable<Control>;
+        _lastControlDown: Nullable<Control>;
+        _capturingControl: Nullable<Control>;
+        _shouldBlockPointer: boolean;
+        _layerToDispose: Nullable<Layer>;
+        _linkedControls: Control[];
+        private _isFullscreen;
+        private _fullscreenViewport;
+        private _idealWidth;
+        private _idealHeight;
+        private _renderAtIdealSize;
+        private _focusedControl;
+        private _blockNextFocusCheck;
+        private _renderScale;
+        renderScale: number;
+        background: string;
+        idealWidth: number;
+        idealHeight: number;
+        renderAtIdealSize: boolean;
+        readonly layer: Nullable<Layer>;
+        readonly rootContainer: Container;
+        focusedControl: Nullable<IFocusableControl>;
+        isForeground: boolean;
+        constructor(name: string, width: number | undefined, height: number | undefined, scene: Nullable<Scene>, generateMipMaps?: boolean, samplingMode?: number);
+        executeOnAllControls(func: (control: Control) => void, container?: Container): void;
+        markAsDirty(): void;
+        addControl(control: Control): AdvancedDynamicTexture;
+        removeControl(control: Control): AdvancedDynamicTexture;
+        dispose(): void;
+        private _onResize();
+        _getGlobalViewport(scene: Scene): Viewport;
+        private _checkUpdate(camera);
+        private _render();
+        private _doPicking(x, y, type, buttonIndex);
+        attach(): void;
+        attachToMesh(mesh: AbstractMesh, supportPointerMove?: boolean): void;
+        moveFocusToControl(control: IFocusableControl): void;
+        private _manageFocus();
+        private _attachToOnPointerOut(scene);
+        static CreateForMesh(mesh: AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean): AdvancedDynamicTexture;
+        static CreateFullscreenUI(name: string, foreground?: boolean, scene?: Nullable<Scene>, sampling?: number): AdvancedDynamicTexture;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Measure {
+        left: number;
+        top: number;
+        width: number;
+        height: number;
+        constructor(left: number, top: number, width: number, height: number);
+        copyFrom(other: Measure): void;
+        isEqualsTo(other: Measure): boolean;
+        static Empty(): Measure;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Vector2WithInfo extends Vector2 {
+        buttonIndex: number;
+        constructor(source: Vector2, buttonIndex?: number);
+    }
+    class Matrix2D {
+        m: Float32Array;
+        constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
+        fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D;
+        determinant(): number;
+        invertToRef(result: Matrix2D): Matrix2D;
+        multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D;
+        transformCoordinates(x: number, y: number, result: Vector2): Matrix2D;
+        static Identity(): Matrix2D;
+        static TranslationToRef(x: number, y: number, result: Matrix2D): void;
+        static ScalingToRef(x: number, y: number, result: Matrix2D): void;
+        static RotationToRef(angle: number, result: Matrix2D): void;
+        private static _TempPreTranslationMatrix;
+        private static _TempPostTranslationMatrix;
+        private static _TempRotationMatrix;
+        private static _TempScalingMatrix;
+        private static _TempCompose0;
+        private static _TempCompose1;
+        private static _TempCompose2;
+        static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class ValueAndUnit {
+        unit: number;
+        negativeValueAllowed: boolean;
+        private _value;
+        ignoreAdaptiveScaling: boolean;
+        constructor(value: number, unit?: number, negativeValueAllowed?: boolean);
+        readonly isPercentage: boolean;
+        readonly isPixel: boolean;
+        readonly internalValue: number;
+        getValueInPixel(host: AdvancedDynamicTexture, refValue: number): number;
+        getValue(host: AdvancedDynamicTexture): number;
+        toString(host: AdvancedDynamicTexture): string;
+        fromString(source: string | number): boolean;
+        private static _Regex;
+        private static _UNITMODE_PERCENTAGE;
+        private static _UNITMODE_PIXEL;
+        static readonly UNITMODE_PERCENTAGE: number;
+        static readonly UNITMODE_PIXEL: number;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Control {
+        name: string | undefined;
+        private _alpha;
+        private _alphaSet;
+        private _zIndex;
+        _root: Nullable<Container>;
+        _host: AdvancedDynamicTexture;
+        parent: Nullable<Container>;
+        _currentMeasure: Measure;
+        private _fontFamily;
+        private _fontStyle;
+        private _fontSize;
+        private _font;
+        _width: ValueAndUnit;
+        _height: ValueAndUnit;
+        protected _fontOffset: {
+            ascent: number;
+            height: number;
+            descent: number;
+        };
+        private _color;
+        protected _horizontalAlignment: number;
+        protected _verticalAlignment: number;
+        private _isDirty;
+        protected _cachedParentMeasure: Measure;
+        private _paddingLeft;
+        private _paddingRight;
+        private _paddingTop;
+        private _paddingBottom;
+        _left: ValueAndUnit;
+        _top: ValueAndUnit;
+        private _scaleX;
+        private _scaleY;
+        private _rotation;
+        private _transformCenterX;
+        private _transformCenterY;
+        private _transformMatrix;
+        protected _invertTransformMatrix: Matrix2D;
+        protected _transformedPosition: Vector2;
+        private _isMatrixDirty;
+        private _cachedOffsetX;
+        private _cachedOffsetY;
+        private _isVisible;
+        _linkedMesh: Nullable<AbstractMesh>;
+        private _fontSet;
+        private _dummyVector2;
+        private _downCount;
+        private _enterCount;
+        private _doNotRender;
+        isHitTestVisible: boolean;
+        isPointerBlocker: boolean;
+        isFocusInvisible: boolean;
+        shadowOffsetX: number;
+        shadowOffsetY: number;
+        shadowBlur: number;
+        shadowColor: string;
+        protected _linkOffsetX: ValueAndUnit;
+        protected _linkOffsetY: ValueAndUnit;
+        readonly typeName: string;
+        /**
+        * An event triggered when the pointer move over the control.
+        * @type {BABYLON.Observable}
+        */
+        onPointerMoveObservable: Observable<Vector2>;
+        /**
+        * An event triggered when the pointer move out of the control.
+        * @type {BABYLON.Observable}
+        */
+        onPointerOutObservable: Observable<Control>;
+        /**
+        * An event triggered when the pointer taps the control
+        * @type {BABYLON.Observable}
+        */
+        onPointerDownObservable: Observable<Vector2WithInfo>;
+        /**
+        * An event triggered when pointer up
+        * @type {BABYLON.Observable}
+        */
+        onPointerUpObservable: Observable<Vector2WithInfo>;
+        /**
+        * An event triggered when pointer enters the control
+        * @type {BABYLON.Observable}
+        */
+        onPointerEnterObservable: Observable<Control>;
+        /**
+        * An event triggered when the control is marked as dirty
+        * @type {BABYLON.Observable}
+        */
+        onDirtyObservable: Observable<Control>;
+        /**
+       * An event triggered after the control is drawn
+       * @type {BABYLON.Observable}
+       */
+        onAfterDrawObservable: Observable<Control>;
+        alpha: number;
+        scaleX: number;
+        scaleY: number;
+        rotation: number;
+        transformCenterY: number;
+        transformCenterX: number;
+        horizontalAlignment: number;
+        verticalAlignment: number;
+        width: string | number;
+        readonly widthInPixels: number;
+        height: string | number;
+        readonly heightInPixels: number;
+        fontFamily: string;
+        fontStyle: string;
+        readonly fontSizeInPixels: number;
+        fontSize: string | number;
+        color: string;
+        zIndex: number;
+        notRenderable: boolean;
+        isVisible: boolean;
+        readonly isDirty: boolean;
+        paddingLeft: string | number;
+        readonly paddingLeftInPixels: number;
+        paddingRight: string | number;
+        readonly paddingRightInPixels: number;
+        paddingTop: string | number;
+        readonly paddingTopInPixels: number;
+        paddingBottom: string | number;
+        readonly paddingBottomInPixels: number;
+        left: string | number;
+        readonly leftInPixels: number;
+        top: string | number;
+        readonly topInPixels: number;
+        linkOffsetX: string | number;
+        readonly linkOffsetXInPixels: number;
+        linkOffsetY: string | number;
+        readonly linkOffsetYInPixels: number;
+        readonly centerX: number;
+        readonly centerY: number;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        getLocalCoordinates(globalCoordinates: Vector2): Vector2;
+        getLocalCoordinatesToRef(globalCoordinates: Vector2, result: Vector2): Control;
+        getParentLocalCoordinates(globalCoordinates: Vector2): Vector2;
+        moveToVector3(position: Vector3, scene: Scene): void;
+        linkWithMesh(mesh: Nullable<AbstractMesh>): void;
+        _moveToProjectedPosition(projectedPosition: Vector3): void;
+        _markMatrixAsDirty(): void;
+        _markAsDirty(): void;
+        _markAllAsDirty(): void;
+        _link(root: Nullable<Container>, host: AdvancedDynamicTexture): void;
+        protected _transform(context: CanvasRenderingContext2D): void;
+        protected _applyStates(context: CanvasRenderingContext2D): void;
+        protected _processMeasures(parentMeasure: Measure, context: CanvasRenderingContext2D): boolean;
+        protected _clip(context: CanvasRenderingContext2D): void;
+        _measure(): void;
+        protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        contains(x: number, y: number): boolean;
+        _processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
+        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerEnter(target: Control): boolean;
+        _onPointerOut(target: Control): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
+        forcePointerUp(): void;
+        _processObservables(type: number, x: number, y: number, buttonIndex: number): boolean;
+        private _prepareFont();
+        dispose(): void;
+        private static _HORIZONTAL_ALIGNMENT_LEFT;
+        private static _HORIZONTAL_ALIGNMENT_RIGHT;
+        private static _HORIZONTAL_ALIGNMENT_CENTER;
+        private static _VERTICAL_ALIGNMENT_TOP;
+        private static _VERTICAL_ALIGNMENT_BOTTOM;
+        private static _VERTICAL_ALIGNMENT_CENTER;
+        static readonly HORIZONTAL_ALIGNMENT_LEFT: number;
+        static readonly HORIZONTAL_ALIGNMENT_RIGHT: number;
+        static readonly HORIZONTAL_ALIGNMENT_CENTER: number;
+        static readonly VERTICAL_ALIGNMENT_TOP: number;
+        static readonly VERTICAL_ALIGNMENT_BOTTOM: number;
+        static readonly VERTICAL_ALIGNMENT_CENTER: number;
+        private static _FontHeightSizes;
+        static _GetFontOffset(font: string): {
+            ascent: number;
+            height: number;
+            descent: number;
+        };
+        static AddHeader(control: Control, text: string, size: string | number, options: {
+            isHorizontal: boolean;
+            controlFirst: boolean;
+        }): StackPanel;
+        protected static drawEllipse(x: number, y: number, width: number, height: number, context: CanvasRenderingContext2D): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Container extends Control {
+        name: string | undefined;
+        protected _children: Control[];
+        protected _measureForChildren: Measure;
+        protected _background: string;
+        background: string;
+        readonly children: Control[];
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        getChildByName(name: string): Nullable<Control>;
+        getChildByType(name: string, type: string): Nullable<Control>;
+        containsControl(control: Control): boolean;
+        addControl(control: Control): Container;
+        removeControl(control: Control): Container;
+        _reOrderControl(control: Control): void;
+        _markMatrixAsDirty(): void;
+        _markAllAsDirty(): void;
+        protected _localDraw(context: CanvasRenderingContext2D): void;
+        _link(root: Nullable<Container>, host: AdvancedDynamicTexture): void;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        _processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
+        protected _clipForChildren(context: CanvasRenderingContext2D): void;
+        protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        dispose(): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class StackPanel extends Container {
+        name: string | undefined;
+        private _isVertical;
+        private _manualWidth;
+        private _manualHeight;
+        private _doNotTrackManualChanges;
+        private _tempMeasureStore;
+        isVertical: boolean;
+        width: string | number;
+        height: string | number;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Rectangle extends Container {
+        name: string | undefined;
+        private _thickness;
+        private _cornerRadius;
+        thickness: number;
+        cornerRadius: number;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        protected _localDraw(context: CanvasRenderingContext2D): void;
+        protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        private _drawRoundedRect(context, offset?);
+        protected _clipForChildren(context: CanvasRenderingContext2D): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Ellipse extends Container {
+        name: string | undefined;
+        private _thickness;
+        thickness: number;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        protected _localDraw(context: CanvasRenderingContext2D): void;
+        protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        protected _clipForChildren(context: CanvasRenderingContext2D): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Line extends Control {
+        name: string | undefined;
+        private _lineWidth;
+        private _x1;
+        private _y1;
+        private _x2;
+        private _y2;
+        private _dash;
+        private _connectedControl;
+        private _connectedControlDirtyObserver;
+        dash: Array<number>;
+        connectedControl: Control;
+        x1: string | number;
+        y1: string | number;
+        x2: string | number;
+        y2: string | number;
+        lineWidth: number;
+        horizontalAlignment: number;
+        verticalAlignment: number;
+        private readonly _effectiveX2;
+        private readonly _effectiveY2;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        _measure(): void;
+        protected _computeAlignment(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        _moveToProjectedPosition(projectedPosition: Vector3): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Slider extends Control {
+        name: string | undefined;
+        private _thumbWidth;
+        private _minimum;
+        private _maximum;
+        private _value;
+        private _background;
+        private _borderColor;
+        private _barOffset;
+        private _isThumbCircle;
+        onValueChangedObservable: Observable<number>;
+        borderColor: string;
+        background: string;
+        barOffset: string | number;
+        readonly barOffsetInPixels: number;
+        thumbWidth: string | number;
+        readonly thumbWidthInPixels: number;
+        minimum: number;
+        maximum: number;
+        value: number;
+        isThumbCircle: boolean;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        private _pointerIsDown;
+        private _updateValueFromPointer(x, y);
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Checkbox extends Control {
+        name: string | undefined;
+        private _isChecked;
+        private _background;
+        private _checkSizeRatio;
+        private _thickness;
+        thickness: number;
+        onIsCheckedChangedObservable: Observable<boolean>;
+        checkSizeRatio: number;
+        background: string;
+        isChecked: boolean;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class RadioButton extends Control {
+        name: string | undefined;
+        private _isChecked;
+        private _background;
+        private _checkSizeRatio;
+        private _thickness;
+        thickness: number;
+        group: string;
+        onIsCheckedChangedObservable: Observable<boolean>;
+        checkSizeRatio: number;
+        background: string;
+        isChecked: boolean;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class TextBlock extends Control {
+        name: string | undefined;
+        private _text;
+        private _textWrapping;
+        private _textHorizontalAlignment;
+        private _textVerticalAlignment;
+        private _lines;
+        private _resizeToFit;
+        /**
+        * An event triggered after the text is changed
+        * @type {BABYLON.Observable}
+        */
+        onTextChangedObservable: Observable<TextBlock>;
+        resizeToFit: boolean;
+        textWrapping: boolean;
+        text: string;
+        textHorizontalAlignment: number;
+        textVerticalAlignment: number;
+        constructor(name?: string | undefined, text?: string);
+        protected _getTypeName(): string;
+        private _drawText(text, textWidth, y, context);
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        protected _additionalProcessing(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        protected _parseLine(line: string | undefined, context: CanvasRenderingContext2D): object;
+        protected _parseLineWithTextWrapping(line: string | undefined, context: CanvasRenderingContext2D): object;
+        protected _renderLines(context: CanvasRenderingContext2D): void;
+        dispose(): void;
+    }
+}
+
+
+declare var DOMImage: new (width?: number | undefined, height?: number | undefined) => HTMLImageElement;
+declare module BABYLON.GUI {
+    class Image extends Control {
+        name: string | undefined;
+        private _domImage;
+        private _imageWidth;
+        private _imageHeight;
+        private _loaded;
+        private _stretch;
+        private _source;
+        private _autoScale;
+        private _sourceLeft;
+        private _sourceTop;
+        private _sourceWidth;
+        private _sourceHeight;
+        private _cellWidth;
+        private _cellHeight;
+        private _cellId;
+        sourceLeft: number;
+        sourceTop: number;
+        sourceWidth: number;
+        sourceHeight: number;
+        autoScale: boolean;
+        stretch: number;
+        domImage: HTMLImageElement;
+        private _onImageLoaded();
+        source: Nullable<string>;
+        cellWidth: number;
+        cellHeight: number;
+        cellId: number;
+        constructor(name?: string | undefined, url?: Nullable<string>);
+        protected _getTypeName(): string;
+        synchronizeSizeWithContent(): void;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        private static _STRETCH_NONE;
+        private static _STRETCH_FILL;
+        private static _STRETCH_UNIFORM;
+        private static _STRETCH_EXTEND;
+        static readonly STRETCH_NONE: number;
+        static readonly STRETCH_FILL: number;
+        static readonly STRETCH_UNIFORM: number;
+        static readonly STRETCH_EXTEND: number;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class Button extends Rectangle {
+        name: string | undefined;
+        pointerEnterAnimation: () => void;
+        pointerOutAnimation: () => void;
+        pointerDownAnimation: () => void;
+        pointerUpAnimation: () => void;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        _processPicking(x: number, y: number, type: number, buttonIndex: number): boolean;
+        _onPointerEnter(target: Control): boolean;
+        _onPointerOut(target: Control): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
+        static CreateImageButton(name: string, text: string, imageUrl: string): Button;
+        static CreateImageOnlyButton(name: string, imageUrl: string): Button;
+        static CreateSimpleButton(name: string, text: string): Button;
+        static CreateImageWithCenterTextButton(name: string, text: string, imageUrl: string): Button;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class ColorPicker extends Control {
+        name: string | undefined;
+        private _colorWheelCanvas;
+        private _value;
+        private _tmpColor;
+        private _pointerStartedOnSquare;
+        private _pointerStartedOnWheel;
+        private _squareLeft;
+        private _squareTop;
+        private _squareSize;
+        private _h;
+        private _s;
+        private _v;
+        onValueChangedObservable: Observable<Color3>;
+        value: Color3;
+        width: string | number;
+        height: string | number;
+        size: string | number;
+        constructor(name?: string | undefined);
+        protected _getTypeName(): string;
+        private _updateSquareProps();
+        private _drawGradientSquare(hueValue, left, top, width, height, context);
+        private _drawCircle(centerX, centerY, radius, context);
+        private _createColorWheelCanvas(radius, thickness);
+        private _RGBtoHSV(color, result);
+        private _HSVtoRGB(hue, saturation, value, result);
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        private _pointerIsDown;
+        private _updateValueFromPointer(x, y);
+        private _isPointOnSquare(coordinates);
+        private _isPointOnWheel(coordinates);
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerMove(target: Control, coordinates: Vector2): void;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class InputText extends Control implements IFocusableControl {
+        name: string | undefined;
+        private _text;
+        private _placeholderText;
+        private _background;
+        private _focusedBackground;
+        private _placeholderColor;
+        private _thickness;
+        private _margin;
+        private _autoStretchWidth;
+        private _maxWidth;
+        private _isFocused;
+        private _blinkTimeout;
+        private _blinkIsEven;
+        private _cursorOffset;
+        private _scrollLeft;
+        private _textWidth;
+        private _clickedCoordinate;
+        promptMessage: string;
+        onTextChangedObservable: Observable<InputText>;
+        onFocusObservable: Observable<InputText>;
+        onBlurObservable: Observable<InputText>;
+        maxWidth: string | number;
+        readonly maxWidthInPixels: number;
+        margin: string;
+        readonly marginInPixels: number;
+        autoStretchWidth: boolean;
+        thickness: number;
+        focusedBackground: string;
+        background: string;
+        placeholderColor: string;
+        placeholderText: string;
+        text: string;
+        width: string | number;
+        constructor(name?: string | undefined, text?: string);
+        onBlur(): void;
+        onFocus(): void;
+        protected _getTypeName(): string;
+        processKey(keyCode: number, key?: string): void;
+        processKeyboard(evt: KeyboardEvent): void;
+        _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
+        _onPointerDown(target: Control, coordinates: Vector2, buttonIndex: number): boolean;
+        _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void;
+        dispose(): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    class KeyPropertySet {
+        width?: string;
+        height?: string;
+        paddingLeft?: string;
+        paddingRight?: string;
+        paddingTop?: string;
+        paddingBottom?: string;
+        color?: string;
+        background?: string;
+    }
+    class VirtualKeyboard extends StackPanel {
+        onKeyPressObservable: Observable<string>;
+        defaultButtonWidth: string;
+        defaultButtonHeight: string;
+        defaultButtonPaddingLeft: string;
+        defaultButtonPaddingRight: string;
+        defaultButtonPaddingTop: string;
+        defaultButtonPaddingBottom: string;
+        defaultButtonColor: string;
+        defaultButtonBackground: string;
+        shiftButtonColor: string;
+        selectedShiftThickness: number;
+        shiftState: number;
+        protected _getTypeName(): string;
+        private _createKey(key, propertySet);
+        addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
+        applyShiftState(shiftState: number): void;
+        private _connectedInputText;
+        private _onFocusObserver;
+        private _onBlurObserver;
+        private _onKeyPressObserver;
+        readonly connectedInputText: Nullable<InputText>;
+        connect(input: InputText): void;
+        disconnect(): void;
+        static CreateDefaultLayout(): VirtualKeyboard;
+    }
+}

+ 36 - 0
dist/gui/package.json

@@ -0,0 +1,36 @@
+{
+    "author": {
+        "name": "David CATUHE"
+    },
+    "name": "babylonjs-gui",
+    "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
+    "version": "3.1.0",
+    "repository": {
+        "type": "git",
+        "url": "https://github.com/BabylonJS/Babylon.js.git"
+    },
+    "main": "babylon.gui.min.js",
+    "files": [
+        "babylon.gui.js",
+        "babylon.gui.min.js",
+        "babylon.gui.d.ts",
+        "babylon.gui.module.d.ts",
+        "readme.md",
+        "package.json"
+    ],
+    "typings": "babylon.gui.module.d.ts",
+    "keywords": [
+        "3D",
+        "javascript",
+        "html5",
+        "webgl",
+        "gui"
+    ],
+    "license": "Apache-2.0",
+    "peerDependencies": {
+        "babylonjs": ">=3.1.0-alpha"
+    },
+    "engines": {
+        "node": "*"
+    }
+}

+ 41 - 0
dist/gui/readme.md

@@ -0,0 +1,41 @@
+Babylon.js GUI module
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/overviews/gui
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/gui/babylon.gui.js
+* https://preview.babylonjs.com/gui/babylon.gui.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-gui
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-gui",
+        "angularFTW"
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as GUI from 'babylonjs-gui';
+```
+
+Using webpack to package your project will use the minified js file.

File diff suppressed because it is too large
+ 4 - 991
dist/inspector/babylon.inspector.bundle.js


+ 81 - 11
dist/inspector/babylon.inspector.css

@@ -1,20 +1,26 @@
 @import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css);
 @import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css);
 @import url(https://fonts.googleapis.com/css?family=Inconsolata);
 @import url(https://fonts.googleapis.com/css?family=Inconsolata);
+
+@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css);
+@import url(https://fonts.googleapis.com/css?family=Inconsolata);
 .insp-wrapper {
 .insp-wrapper {
   user-select: none;
   user-select: none;
   display: flex;
   display: flex;
   font-size: 0.9em;
   font-size: 0.9em;
   font-family: "Inconsolata", sans-serif;
   font-family: "Inconsolata", sans-serif;
   background-color: #242424;
   background-color: #242424;
-  /**
- * A tool contained in the tree panel (available for each item of the tree)
+  /**
+ * A tool contained in the tree panel (available for each item of the tree)
+ */
+  /**
+ * The toolbar contains : 
+ * - a refresh tool - refresh the whole panel
+ * - a popup tool - Open the inspector in a new panel
+ * ...
  */
  */
-  /**
- * The toolbar contains : 
- * - a refresh tool - refresh the whole panel
- * - a popup tool - Open the inspector in a new panel
- * ...
- */ }
+  /*
+* 1. Set to 0 height and width, and remove border for a slider without a thumb
+*/ }
   .insp-wrapper .gutter {
   .insp-wrapper .gutter {
     background-color: #2c2c2c; }
     background-color: #2c2c2c; }
     .insp-wrapper .gutter.gutter-vertical:not(.blocked) {
     .insp-wrapper .gutter.gutter-vertical:not(.blocked) {
@@ -23,6 +29,7 @@
       cursor: ew-resize; }
       cursor: ew-resize; }
   .insp-wrapper .insp-right-panel {
   .insp-wrapper .insp-right-panel {
     width: 750px;
     width: 750px;
+    overflow-y: auto;
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
     flex-shrink: 0; }
     flex-shrink: 0; }
@@ -87,7 +94,8 @@
     .insp-wrapper .tab-panel .texture-image {
     .insp-wrapper .tab-panel .texture-image {
       max-height: 400px; }
       max-height: 400px; }
     .insp-wrapper .tab-panel .scene-actions {
     .insp-wrapper .tab-panel .scene-actions {
-      overflow-y: auto; }
+      overflow-y: auto;
+      padding-left: 5px; }
       .insp-wrapper .tab-panel .scene-actions .actions-title {
       .insp-wrapper .tab-panel .scene-actions .actions-title {
         font-size: 1.1em;
         font-size: 1.1em;
         padding-bottom: 10px;
         padding-bottom: 10px;
@@ -265,6 +273,10 @@
         display: inline-block;
         display: inline-block;
         font-family: 'FontAwesome', sans-serif;
         font-family: 'FontAwesome', sans-serif;
         content: "\f054"; }
         content: "\f054"; }
+      .insp-wrapper .insp-tree .line.unfolded.transformNode > span:first-of-type {
+        color: #f29766; }
+      .insp-wrapper .insp-tree .line.folded.transformNode > span:first-of-type {
+        color: #f29766; }
       .insp-wrapper .insp-tree .line .line-content {
       .insp-wrapper .insp-tree .line .line-content {
         padding-left: 15px; }
         padding-left: 15px; }
         .insp-wrapper .insp-tree .line .line-content:hover {
         .insp-wrapper .insp-tree .line .line-content:hover {
@@ -277,12 +289,16 @@
     overflow-x: auto;
     overflow-x: auto;
     color: #ccc;
     color: #ccc;
     font-family: "Inconsolata", sans-serif; }
     font-family: "Inconsolata", sans-serif; }
+    .insp-wrapper .insp-details .details {
+      padding-left: 5px; }
     .insp-wrapper .insp-details .base-row, .insp-wrapper .insp-details .row, .insp-wrapper .insp-details .header-row {
     .insp-wrapper .insp-details .base-row, .insp-wrapper .insp-details .row, .insp-wrapper .insp-details .header-row {
       display: flex;
       display: flex;
       width: 100%; }
       width: 100%; }
       .insp-wrapper .insp-details .base-row .base-property, .insp-wrapper .insp-details .row .base-property, .insp-wrapper .insp-details .header-row .base-property, .insp-wrapper .insp-details .base-row .prop-name, .insp-wrapper .insp-details .row .prop-name, .insp-wrapper .insp-details .header-row .prop-name, .insp-wrapper .insp-details .base-row .prop-value, .insp-wrapper .insp-details .row .prop-value, .insp-wrapper .insp-details .header-row .prop-value {
       .insp-wrapper .insp-details .base-row .base-property, .insp-wrapper .insp-details .row .base-property, .insp-wrapper .insp-details .header-row .base-property, .insp-wrapper .insp-details .base-row .prop-name, .insp-wrapper .insp-details .row .prop-name, .insp-wrapper .insp-details .header-row .prop-name, .insp-wrapper .insp-details .base-row .prop-value, .insp-wrapper .insp-details .row .prop-value, .insp-wrapper .insp-details .header-row .prop-value {
-        word-wrap: break-word;
-        padding: 2px 0 2px 0; }
+        padding: 2px 0 2px 0;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+        overflow: hidden; }
       .insp-wrapper .insp-details .base-row .prop-name, .insp-wrapper .insp-details .row .prop-name, .insp-wrapper .insp-details .header-row .prop-name {
       .insp-wrapper .insp-details .base-row .prop-name, .insp-wrapper .insp-details .row .prop-name, .insp-wrapper .insp-details .header-row .prop-name {
         width: 35%; }
         width: 35%; }
       .insp-wrapper .insp-details .base-row .prop-value, .insp-wrapper .insp-details .row .prop-value, .insp-wrapper .insp-details .header-row .prop-value {
       .insp-wrapper .insp-details .base-row .prop-value, .insp-wrapper .insp-details .row .prop-value, .insp-wrapper .insp-details .header-row .prop-value {
@@ -323,6 +339,8 @@
       height: 10px;
       height: 10px;
       display: inline-block;
       display: inline-block;
       margin-left: 5px; }
       margin-left: 5px; }
+    .insp-wrapper .insp-details .color-element {
+      top: 2px; }
     .insp-wrapper .insp-details .texture-element {
     .insp-wrapper .insp-details .texture-element {
       color: #f29766;
       color: #f29766;
       margin-left: 10px; }
       margin-left: 10px; }
@@ -421,3 +439,55 @@
       color: #b3b3b3;
       color: #b3b3b3;
       padding: 3px 0 3px 10px;
       padding: 3px 0 3px 10px;
       margin: 6px 0 6px 0; }
       margin: 6px 0 6px 0; }
+  .insp-wrapper input[type="range"] {
+    margin: auto;
+    -webkit-appearance: none;
+    position: relative;
+    overflow: hidden;
+    height: 15px;
+    width: 50%;
+    cursor: pointer;
+    border-radius: 0;
+    /* iOS */ }
+  .insp-wrapper ::-webkit-slider-runnable-track {
+    background: #ddd; }
+  .insp-wrapper ::-webkit-slider-thumb {
+    -webkit-appearance: none;
+    width: 20px;
+    /* 1 */
+    height: 15px;
+    /* 1 */
+    background: #fff;
+    box-shadow: -100vw 0 0 100vw dodgerblue;
+    border: 0px solid #999;
+    /* 1 */ }
+  .insp-wrapper ::-moz-range-track {
+    height: 15px;
+    background: #ddd; }
+  .insp-wrapper ::-moz-range-thumb {
+    background: #fff;
+    height: 15px;
+    width: 20px;
+    border: 0px solid #999;
+    border-radius: 0 !important;
+    box-shadow: -100vw 0 0 100vw dodgerblue;
+    box-sizing: border-box; }
+  .insp-wrapper ::-ms-fill-lower {
+    background: dodgerblue; }
+  .insp-wrapper ::-ms-thumb {
+    background: #fff;
+    border: 0px solid #999;
+    height: 15px;
+    width: 20px;
+    box-sizing: border-box; }
+  .insp-wrapper ::-ms-ticks-after {
+    display: none; }
+  .insp-wrapper ::-ms-ticks-before {
+    display: none; }
+  .insp-wrapper ::-ms-track {
+    background: #ddd;
+    color: transparent;
+    height: 15px;
+    border: none; }
+  .insp-wrapper ::-ms-tooltip {
+    display: none; }

+ 193 - 198
dist/inspector/babylon.inspector.d.ts

@@ -6,8 +6,6 @@ declare module INSPECTOR {
         /** The div containing the content of the active tab */
         /** The div containing the content of the active tab */
         private _tabPanel;
         private _tabPanel;
         /** The panel containing the list if items */
         /** The panel containing the list if items */
-        /** The list if tree items displayed in the tree panel. */
-        private _items;
         private _tabbar;
         private _tabbar;
         private _scene;
         private _scene;
         /** The HTML document relative to this inspector (the window or the popup depending on its mode) */
         /** The HTML document relative to this inspector (the window or the popup depending on its mode) */
@@ -24,7 +22,7 @@ declare module INSPECTOR {
          * If the parameter 'popup' is false, the inspector is created as a right panel on the main window.
          * If the parameter 'popup' is false, the inspector is created as a right panel on the main window.
          * If the parameter 'popup' is true, the inspector is created in another popup.
          * If the parameter 'popup' is true, the inspector is created in another popup.
          */
          */
-        constructor(scene: BABYLON.Scene, popup?: boolean, initialTab?: number, parentElement?: HTMLElement, newColors?: {
+        constructor(scene: BABYLON.Scene, popup?: boolean, initialTab?: number, parentElement?: BABYLON.Nullable<HTMLElement>, newColors?: {
             backgroundColor?: string;
             backgroundColor?: string;
             backgroundColorLighter?: string;
             backgroundColorLighter?: string;
             backgroundColorLighter2?: string;
             backgroundColorLighter2?: string;
@@ -65,6 +63,7 @@ declare module INSPECTOR {
     }
     }
 }
 }
 
 
+
 declare module INSPECTOR {
 declare module INSPECTOR {
     var PROPERTIES: {
     var PROPERTIES: {
         format: (obj: any) => any;
         format: (obj: any) => any;
@@ -74,36 +73,65 @@ declare module INSPECTOR {
         };
         };
         'Vector2': {
         'Vector2': {
             type: typeof BABYLON.Vector2;
             type: typeof BABYLON.Vector2;
-            properties: string[];
             format: (vec: BABYLON.Vector2) => string;
             format: (vec: BABYLON.Vector2) => string;
         };
         };
         'Vector3': {
         'Vector3': {
             type: typeof BABYLON.Vector3;
             type: typeof BABYLON.Vector3;
-            properties: string[];
             format: (vec: BABYLON.Vector3) => string;
             format: (vec: BABYLON.Vector3) => string;
         };
         };
         'Color3': {
         'Color3': {
             type: typeof BABYLON.Color3;
             type: typeof BABYLON.Color3;
-            properties: string[];
             format: (color: BABYLON.Color3) => string;
             format: (color: BABYLON.Color3) => string;
+            slider: {
+                r: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+                g: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+                b: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+            };
+        };
+        'Color4': {
+            type: typeof BABYLON.Color4;
+            format: (color: BABYLON.Color4) => string;
+            slider: {
+                r: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+                g: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+                b: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+            };
         };
         };
         'Quaternion': {
         'Quaternion': {
             type: typeof BABYLON.Quaternion;
             type: typeof BABYLON.Quaternion;
-            properties: string[];
         };
         };
         'Size': {
         'Size': {
             type: typeof BABYLON.Size;
             type: typeof BABYLON.Size;
-            properties: string[];
             format: (size: BABYLON.Size) => string;
             format: (size: BABYLON.Size) => string;
         };
         };
         'Texture': {
         'Texture': {
             type: typeof BABYLON.Texture;
             type: typeof BABYLON.Texture;
-            properties: string[];
             format: (tex: BABYLON.Texture) => string;
             format: (tex: BABYLON.Texture) => string;
         };
         };
-        'MapTexture': {
-            type: typeof BABYLON.MapTexture;
-        };
         'RenderTargetTexture': {
         'RenderTargetTexture': {
             type: typeof BABYLON.RenderTargetTexture;
             type: typeof BABYLON.RenderTargetTexture;
         };
         };
@@ -113,156 +141,95 @@ declare module INSPECTOR {
         'BaseTexture': {
         'BaseTexture': {
             type: typeof BABYLON.BaseTexture;
             type: typeof BABYLON.BaseTexture;
         };
         };
-        'FontTexture': {
-            type: typeof BABYLON.FontTexture;
+        'CubeTexture': {
+            type: typeof BABYLON.CubeTexture;
+        };
+        'HDRCubeTexture': {
+            type: typeof BABYLON.HDRCubeTexture;
         };
         };
         'Sound': {
         'Sound': {
             type: typeof BABYLON.Sound;
             type: typeof BABYLON.Sound;
-            properties: string[];
         };
         };
         'ArcRotateCamera': {
         'ArcRotateCamera': {
             type: typeof BABYLON.ArcRotateCamera;
             type: typeof BABYLON.ArcRotateCamera;
-            properties: string[];
+            slider: {
+                alpha: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+                beta: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+                fov: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+            };
         };
         };
         'FreeCamera': {
         'FreeCamera': {
             type: typeof BABYLON.FreeCamera;
             type: typeof BABYLON.FreeCamera;
-            properties: string[];
+            slider: {
+                fov: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+            };
         };
         };
         'Scene': {
         'Scene': {
             type: typeof BABYLON.Scene;
             type: typeof BABYLON.Scene;
-            properties: string[];
+        };
+        'TransformNode': {
+            type: typeof BABYLON.TransformNode;
+            format: (m: BABYLON.TransformNode) => string;
+        };
+        'AbstractMesh': {
+            type: typeof BABYLON.AbstractMesh;
+            format: (m: BABYLON.AbstractMesh) => string;
         };
         };
         'Mesh': {
         'Mesh': {
             type: typeof BABYLON.Mesh;
             type: typeof BABYLON.Mesh;
-            properties: string[];
             format: (m: BABYLON.Mesh) => string;
             format: (m: BABYLON.Mesh) => string;
+            slider: {
+                visibility: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+            };
         };
         };
         'StandardMaterial': {
         'StandardMaterial': {
             type: typeof BABYLON.StandardMaterial;
             type: typeof BABYLON.StandardMaterial;
-            properties: string[];
             format: (mat: BABYLON.StandardMaterial) => string;
             format: (mat: BABYLON.StandardMaterial) => string;
-        };
-        'PrimitiveAlignment': {
-            type: typeof BABYLON.PrimitiveAlignment;
-            properties: string[];
-        };
-        'PrimitiveThickness': {
-            type: typeof BABYLON.PrimitiveThickness;
-            properties: string[];
-        };
-        'BoundingInfo2D': {
-            type: typeof BABYLON.BoundingInfo2D;
-            properties: string[];
-        };
-        'SolidColorBrush2D': {
-            type: typeof BABYLON.SolidColorBrush2D;
-            properties: string[];
-        };
-        'GradientColorBrush2D': {
-            type: typeof BABYLON.GradientColorBrush2D;
-            properties: string[];
+            slider: {
+                alpha: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+            };
         };
         };
         'PBRMaterial': {
         'PBRMaterial': {
             type: typeof BABYLON.PBRMaterial;
             type: typeof BABYLON.PBRMaterial;
-            properties: string[];
-        };
-        'Canvas2D': {
-            type: typeof BABYLON.Canvas2D;
-        };
-        'Canvas2DEngineBoundData': {
-            type: typeof BABYLON.Canvas2DEngineBoundData;
-        };
-        'Ellipse2D': {
-            type: typeof BABYLON.Ellipse2D;
-        };
-        'Ellipse2DInstanceData': {
-            type: typeof BABYLON.Ellipse2DInstanceData;
-        };
-        'Ellipse2DRenderCache': {
-            type: typeof BABYLON.Ellipse2DRenderCache;
-        };
-        'Group2D': {
-            type: typeof BABYLON.Group2D;
-        };
-        'IntersectInfo2D': {
-            type: typeof BABYLON.IntersectInfo2D;
-        };
-        'Lines2D': {
-            type: typeof BABYLON.Lines2D;
-        };
-        'Lines2DInstanceData': {
-            type: typeof BABYLON.Lines2DInstanceData;
-        };
-        'Lines2DRenderCache': {
-            type: typeof BABYLON.Lines2DRenderCache;
-        };
-        'PrepareRender2DContext': {
-            type: typeof BABYLON.PrepareRender2DContext;
-        };
-        'Prim2DBase': {
-            type: typeof BABYLON.Prim2DBase;
-        };
-        'Prim2DClassInfo': {
-            type: typeof BABYLON.Prim2DClassInfo;
-        };
-        'Prim2DPropInfo': {
-            type: typeof BABYLON.Prim2DPropInfo;
-        };
-        'Rectangle2D': {
-            type: typeof BABYLON.Rectangle2D;
-        };
-        'Rectangle2DInstanceData': {
-            type: typeof BABYLON.Rectangle2DInstanceData;
-        };
-        'Rectangle2DRenderCache': {
-            type: typeof BABYLON.Rectangle2DRenderCache;
-        };
-        'Render2DContext': {
-            type: typeof BABYLON.Render2DContext;
-        };
-        'RenderablePrim2D': {
-            type: typeof BABYLON.RenderablePrim2D;
-        };
-        'ScreenSpaceCanvas2D': {
-            type: typeof BABYLON.ScreenSpaceCanvas2D;
-        };
-        'Shape2D': {
-            type: typeof BABYLON.Shape2D;
-        };
-        'Shape2DInstanceData': {
-            type: typeof BABYLON.Shape2DInstanceData;
-        };
-        'Sprite2D': {
-            type: typeof BABYLON.Sprite2D;
-        };
-        'Sprite2DInstanceData': {
-            type: typeof BABYLON.Sprite2DInstanceData;
-        };
-        'Sprite2DRenderCache': {
-            type: typeof BABYLON.Sprite2DRenderCache;
-        };
-        'Text2D': {
-            type: typeof BABYLON.Text2D;
-        };
-        'Text2DInstanceData': {
-            type: typeof BABYLON.Text2DInstanceData;
-        };
-        'Text2DRenderCache': {
-            type: typeof BABYLON.Text2DRenderCache;
-        };
-        'WorldSpaceCanvas2D': {
-            type: typeof BABYLON.WorldSpaceCanvas2D;
-        };
-        'WorldSpaceCanvas2DNode': {
-            type: typeof BABYLON.WorldSpaceCanvas2DNode;
+            slider: {
+                alpha: {
+                    min: number;
+                    max: number;
+                    step: number;
+                };
+            };
         };
         };
         'PhysicsImpostor': {
         'PhysicsImpostor': {
             type: typeof BABYLON.PhysicsImpostor;
             type: typeof BABYLON.PhysicsImpostor;
-            properties: string[];
         };
         };
     };
     };
 }
 }
 
 
+
 declare module INSPECTOR {
 declare module INSPECTOR {
     /**
     /**
      * Function that add gui objects properties to the variable PROPERTIES
      * Function that add gui objects properties to the variable PROPERTIES
@@ -286,17 +253,14 @@ declare module INSPECTOR {
          * Build the html element
          * Build the html element
          */
          */
         protected _build(): void;
         protected _build(): void;
-        abstract update(data?: any): any;
+        abstract update(data?: any): void;
         /** Default dispose method if needed */
         /** Default dispose method if needed */
         dispose(): void;
         dispose(): void;
     }
     }
 }
 }
 
 
 declare module INSPECTOR {
 declare module INSPECTOR {
-    interface IHighlight {
-        highlight: (b: boolean) => void;
-    }
-    abstract class Adapter implements IHighlight {
+    abstract class Adapter {
         protected _obj: any;
         protected _obj: any;
         private static _name;
         private static _name;
         constructor(obj: any);
         constructor(obj: any);
@@ -306,8 +270,6 @@ declare module INSPECTOR {
         abstract type(): string;
         abstract type(): string;
         /** Returns the list of properties to be displayed for this adapter */
         /** Returns the list of properties to be displayed for this adapter */
         abstract getProperties(): Array<PropertyLine>;
         abstract getProperties(): Array<PropertyLine>;
-        /** Returns the actual object behind this adapter */
-        readonly actualObject: any;
         /** Returns true if the given object correspond to this  */
         /** Returns true if the given object correspond to this  */
         correspondsTo(obj: any): boolean;
         correspondsTo(obj: any): boolean;
         /** Returns the adapter unique name */
         /** Returns the adapter unique name */
@@ -318,8 +280,6 @@ declare module INSPECTOR {
         readonly object: any;
         readonly object: any;
         /** Returns the list of tools available for this adapter */
         /** Returns the list of tools available for this adapter */
         abstract getTools(): Array<AbstractTreeTool>;
         abstract getTools(): Array<AbstractTreeTool>;
-        /** Should be overriden in subclasses */
-        highlight(b: boolean): void;
     }
     }
 }
 }
 
 
@@ -398,7 +358,6 @@ declare module INSPECTOR {
 
 
 declare module INSPECTOR {
 declare module INSPECTOR {
     class LightAdapter extends Adapter implements IToolVisible {
     class LightAdapter extends Adapter implements IToolVisible {
-        private static _PROPERTIES;
         constructor(obj: BABYLON.Light);
         constructor(obj: BABYLON.Light);
         /** Returns the name displayed in the tree */
         /** Returns the name displayed in the tree */
         id(): string;
         id(): string;
@@ -409,9 +368,6 @@ declare module INSPECTOR {
         getTools(): Array<AbstractTreeTool>;
         getTools(): Array<AbstractTreeTool>;
         setVisible(b: boolean): void;
         setVisible(b: boolean): void;
         isVisible(): boolean;
         isVisible(): boolean;
-        /** Returns some information about this mesh */
-        /** Overrides super.highlight */
-        highlight(b: boolean): void;
     }
     }
 }
 }
 
 
@@ -426,18 +382,15 @@ declare module INSPECTOR {
         getProperties(): Array<PropertyLine>;
         getProperties(): Array<PropertyLine>;
         /** No tools for a material adapter */
         /** No tools for a material adapter */
         getTools(): Array<AbstractTreeTool>;
         getTools(): Array<AbstractTreeTool>;
-        /** Overrides super.highlight.
-         * Highlighting a material outlines all meshes linked to this material
-         */
-        highlight(b: boolean): void;
     }
     }
 }
 }
 
 
 declare module INSPECTOR {
 declare module INSPECTOR {
     class MeshAdapter extends Adapter implements IToolVisible, IToolDebug, IToolBoundingBox, IToolInfo {
     class MeshAdapter extends Adapter implements IToolVisible, IToolDebug, IToolBoundingBox, IToolInfo {
         /** Keep track of the axis of the actual object */
         /** Keep track of the axis of the actual object */
-        private _axis;
-        constructor(obj: BABYLON.AbstractMesh);
+        private _axesViewer;
+        private onBeforeRenderObserver;
+        constructor(mesh: BABYLON.Node);
         /** Returns the name displayed in the tree */
         /** Returns the name displayed in the tree */
         id(): string;
         id(): string;
         /** Returns the type of this object - displayed in the tree */
         /** Returns the type of this object - displayed in the tree */
@@ -449,11 +402,9 @@ declare module INSPECTOR {
         isVisible(): boolean;
         isVisible(): boolean;
         isBoxVisible(): boolean;
         isBoxVisible(): boolean;
         setBoxVisible(b: boolean): boolean;
         setBoxVisible(b: boolean): boolean;
-        debug(b: boolean): void;
+        debug(enable: boolean): void;
         /** Returns some information about this mesh */
         /** Returns some information about this mesh */
         getInfo(): string;
         getInfo(): string;
-        /** Overrides super.highlight */
-        highlight(b: boolean): void;
         /** Draw X, Y and Z axis for the actual object if this adapter.
         /** Draw X, Y and Z axis for the actual object if this adapter.
          * Should be called only one time as it will fill this._axis
          * Should be called only one time as it will fill this._axis
          */
          */
@@ -549,7 +500,18 @@ declare module INSPECTOR {
         private _validateInputHandler;
         private _validateInputHandler;
         /** Handler used to validate the input by pressing 'esc' */
         /** Handler used to validate the input by pressing 'esc' */
         private _escapeInputHandler;
         private _escapeInputHandler;
-        constructor(prop: Property, parent?: PropertyLine, level?: number);
+        /** Handler used on focus out */
+        private _focusOutInputHandler;
+        /** Handler used to get mouse position */
+        private _onMouseDownHandler;
+        private _onMouseDragHandler;
+        private _onMouseUpHandler;
+        private _textValue;
+        /** Save previous Y mouse position */
+        private _prevY;
+        /**Save value while slider is on */
+        private _preValue;
+        constructor(prop: Property, parent?: BABYLON.Nullable<PropertyLine>, level?: number);
         /**
         /**
          * Init the input element and al its handler :
          * Init the input element and al its handler :
          * - a click in the window remove the input and restore the old property value
          * - a click in the window remove the input and restore the old property value
@@ -561,6 +523,7 @@ declare module INSPECTOR {
          * On escape : removes the input
          * On escape : removes the input
          */
          */
         private _validateInput(e);
         private _validateInput(e);
+        validateInput(value: any, forceupdate?: boolean): void;
         /**
         /**
          * On escape : removes the input
          * On escape : removes the input
          */
          */
@@ -600,19 +563,39 @@ declare module INSPECTOR {
          */
          */
         update(): void;
         update(): void;
         /**
         /**
-         * Returns true if the given instance is a simple type
-         */
-        private static _IS_TYPE_SIMPLE(inst);
-        /**
          * Returns true if the type of this property is simple, false otherwise.
          * Returns true if the type of this property is simple, false otherwise.
          * Returns true if the value is null
          * Returns true if the value is null
          */
          */
         private _isSimple();
         private _isSimple();
         toHtml(): HTMLElement;
         toHtml(): HTMLElement;
+        closeDetails(): void;
         /**
         /**
          * Add sub properties in case of a complex type
          * Add sub properties in case of a complex type
          */
          */
         private _addDetails();
         private _addDetails();
+        /**
+         * Refresh mouse position on y axis
+         * @param e
+         */
+        private _onMouseDrag(e);
+        /**
+         * Save new value from slider
+         * @param e
+         */
+        private _onMouseUp(e);
+        /**
+         * Start record mouse position
+         * @param e
+         */
+        private _onMouseDown(e);
+        /**
+         * Create input entry
+         */
+        private _checkboxInput();
+        private _rangeInput();
+        private _rangeHandler();
+        private _isSliderType();
+        private _getSliderProperty();
     }
     }
 }
 }
 
 
@@ -629,6 +612,20 @@ declare module INSPECTOR {
 
 
 declare module INSPECTOR {
 declare module INSPECTOR {
     /**
     /**
+     * Represents a html div element.
+     * The div is built when an instance of BasicElement is created.
+     */
+    class ColorPickerElement extends BasicElement {
+        protected _input: HTMLInputElement;
+        private pline;
+        constructor(color: BABYLON.Color4 | BABYLON.Color3, propertyLine: PropertyLine);
+        update(color?: BABYLON.Color4 | BABYLON.Color3): void;
+        private _toRgba(color);
+    }
+}
+
+declare module INSPECTOR {
+    /**
     * Display a very small div. A new canvas is created, with a new Babylon.js scene, containing only the
     * Display a very small div. A new canvas is created, with a new Babylon.js scene, containing only the
     * cube texture in a cube
     * cube texture in a cube
     */
     */
@@ -704,7 +701,7 @@ declare module INSPECTOR {
         private _elem;
         private _elem;
         /** The tooltip div */
         /** The tooltip div */
         private _infoDiv;
         private _infoDiv;
-        constructor(elem: HTMLElement, tip: string, attachTo?: HTMLElement);
+        constructor(elem: HTMLElement, tip: string, attachTo?: BABYLON.Nullable<HTMLElement>);
     }
     }
 }
 }
 
 
@@ -724,6 +721,10 @@ declare module INSPECTOR {
          */
          */
         static IsBrowserEdge(): boolean;
         static IsBrowserEdge(): boolean;
         /**
         /**
+         * Returns true if the user browser is IE.
+         */
+        static IsBrowserIE(): boolean;
+        /**
          * Returns the name of the type of the given object, where the name
          * Returns the name of the type of the given object, where the name
          * is in PROPERTIES constant.
          * is in PROPERTIES constant.
          * Returns 'Undefined' if no type exists for this object
          * Returns 'Undefined' if no type exists for this object
@@ -736,12 +737,16 @@ declare module INSPECTOR {
         /** Send the event which name is given in parameter to the window */
         /** Send the event which name is given in parameter to the window */
         static SEND_EVENT(eventName: string): void;
         static SEND_EVENT(eventName: string): void;
         /** Returns the given number with 2 decimal number max if a decimal part exists */
         /** Returns the given number with 2 decimal number max if a decimal part exists */
-        static Trunc(nb: any): number;
+        static Trunc(nb: number): number;
         /**
         /**
          * Useful function used to create a div
          * Useful function used to create a div
          */
          */
-        static CreateDiv(className?: string, parent?: HTMLElement): HTMLElement;
-        static CreateElement(element: string, className?: string, parent?: HTMLElement): HTMLElement;
+        static CreateDiv(className?: BABYLON.Nullable<string>, parent?: HTMLElement): HTMLElement;
+        /**
+         * Useful function used to create a input
+         */
+        static CreateInput(className?: string, parent?: HTMLElement): HTMLInputElement;
+        static CreateElement(element: string, className?: BABYLON.Nullable<string>, parent?: HTMLElement): HTMLElement;
         /**
         /**
          * Removes all children of the given div.
          * Removes all children of the given div.
          */
          */
@@ -752,14 +757,23 @@ declare module INSPECTOR {
         static Css(elem: HTMLElement, cssAttribute: string): string;
         static Css(elem: HTMLElement, cssAttribute: string): string;
         static LoadScript(): void;
         static LoadScript(): void;
         static IsSystemName(name: string): boolean;
         static IsSystemName(name: string): boolean;
+        /**
+         * Return an array of PropertyLine for an obj
+         * @param obj
+         */
+        static GetAllLinesProperties(obj: any): Array<PropertyLine>;
+        /**
+         * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
+         * @param obj
+         */
+        static GetAllLinesPropertiesAsString(obj: any, dontTakeThis?: Array<string>): Array<string>;
+        static Capitalize(str: string): string;
     }
     }
 }
 }
 
 
 declare module INSPECTOR {
 declare module INSPECTOR {
     class Scheduler {
     class Scheduler {
         private static _instance;
         private static _instance;
-        /** The number of the set interval */
-        private _timer;
         /** Is this scheduler in pause ? */
         /** Is this scheduler in pause ? */
         pause: boolean;
         pause: boolean;
         /** All properties are refreshed every 250ms */
         /** All properties are refreshed every 250ms */
@@ -794,11 +808,9 @@ declare module INSPECTOR {
         /** Add this in the propertytab with the searchbar */
         /** Add this in the propertytab with the searchbar */
         filter(str: string): void;
         filter(str: string): void;
         /** Dispose properly this tab */
         /** Dispose properly this tab */
-        abstract dispose(): any;
+        abstract dispose(): void;
         /** Select an item in the tree */
         /** Select an item in the tree */
         select(item: TreeItem): void;
         select(item: TreeItem): void;
-        /** Highlight the given node, and downplay all others */
-        highlightNode(item?: TreeItem): void;
         /**
         /**
          * Returns the total width in pixel of this tab, 0 by default
          * Returns the total width in pixel of this tab, 0 by default
         */
         */
@@ -806,6 +818,7 @@ declare module INSPECTOR {
     }
     }
 }
 }
 
 
+declare function Split(elements: HTMLDivElement[], options: any): void;
 declare module INSPECTOR {
 declare module INSPECTOR {
     /**
     /**
      * A Property tab can creates two panels:
      * A Property tab can creates two panels:
@@ -829,12 +842,10 @@ declare module INSPECTOR {
         displayDetails(item: TreeItem): void;
         displayDetails(item: TreeItem): void;
         /** Select an item in the tree */
         /** Select an item in the tree */
         select(item: TreeItem): void;
         select(item: TreeItem): void;
-        /** Highlight the given node, and downplay all others */
-        highlightNode(item?: TreeItem): void;
         /** Set the given item as active in the tree */
         /** Set the given item as active in the tree */
         activateNode(item: TreeItem): void;
         activateNode(item: TreeItem): void;
         /** Returns the treeitem corersponding to the given obj, null if not found */
         /** Returns the treeitem corersponding to the given obj, null if not found */
-        getItemFor(_obj: any): TreeItem;
+        getItemFor(_obj: any): BABYLON.Nullable<TreeItem>;
         filter(filter: string): void;
         filter(filter: string): void;
         /** Builds the tree panel */
         /** Builds the tree panel */
         protected abstract _getTree(): Array<TreeItem>;
         protected abstract _getTree(): Array<TreeItem>;
@@ -887,8 +898,6 @@ declare module INSPECTOR {
         select(item: TreeItem): void;
         select(item: TreeItem): void;
         /** Set the given item as active in the tree */
         /** Set the given item as active in the tree */
         activateNode(item: TreeItem): void;
         activateNode(item: TreeItem): void;
-        /** Highlight the given node, and downplay all others */
-        highlightNode(item?: TreeItem): void;
     }
     }
 }
 }
 
 
@@ -906,6 +915,7 @@ declare module INSPECTOR {
     }
     }
 }
 }
 
 
+
 declare module INSPECTOR {
 declare module INSPECTOR {
     class MeshTab extends PropertyTab {
     class MeshTab extends PropertyTab {
         constructor(tabbar: TabBar, inspector: Inspector);
         constructor(tabbar: TabBar, inspector: Inspector);
@@ -913,6 +923,7 @@ declare module INSPECTOR {
     }
     }
 }
 }
 
 
+declare function Split(elements: HTMLElement[], options: any): void;
 declare module INSPECTOR {
 declare module INSPECTOR {
     class SceneTab extends Tab {
     class SceneTab extends Tab {
         private _inspector;
         private _inspector;
@@ -935,24 +946,7 @@ declare module INSPECTOR {
     }
     }
 }
 }
 
 
-declare module INSPECTOR {
-    class ShaderTab extends Tab {
-        private _inspector;
-        private _vertexPanel;
-        private _fragmentPanel;
-        constructor(tabbar: TabBar, insp: Inspector);
-        private _selectShader(event);
-        /** Overrides super.dispose */
-        dispose(): void;
-        /** Returns the position of the first { and the corresponding } */
-        private _getBracket(str);
-        /**
-         * Beautify the given string : correct indentation
-         */
-        private _beautify(glsl, level?);
-    }
-}
-
+declare function Split(elements: HTMLDivElement[], options: any): void;
 declare module INSPECTOR {
 declare module INSPECTOR {
     /**
     /**
      * The console tab will have two features :
      * The console tab will have two features :
@@ -969,6 +963,7 @@ declare module INSPECTOR {
         constructor(tabbar: TabBar, insp: Inspector);
         constructor(tabbar: TabBar, insp: Inspector);
         /** Overrides super.dispose */
         /** Overrides super.dispose */
         dispose(): void;
         dispose(): void;
+        active(b: boolean): void;
         private _message(type, message, caller);
         private _message(type, message, caller);
         private _addConsoleLog(...params);
         private _addConsoleLog(...params);
         private _addConsoleWarn(...params);
         private _addConsoleWarn(...params);
@@ -988,11 +983,15 @@ declare module INSPECTOR {
         private _engine;
         private _engine;
         private _glInfo;
         private _glInfo;
         private _updateLoopHandler;
         private _updateLoopHandler;
+        private _sceneInstrumentation;
+        private _engineInstrumentation;
+        private _connectToInstrumentation();
         constructor(tabbar: TabBar, insp: Inspector);
         constructor(tabbar: TabBar, insp: Inspector);
         private _createStatLabel(content, parent);
         private _createStatLabel(content, parent);
         /** Update each properties of the stats panel */
         /** Update each properties of the stats panel */
         private _update();
         private _update();
         dispose(): void;
         dispose(): void;
+        active(b: boolean): void;
     }
     }
 }
 }
 
 
@@ -1031,7 +1030,7 @@ declare module INSPECTOR {
          */
          */
         switchMeshTab(mesh?: BABYLON.AbstractMesh): void;
         switchMeshTab(mesh?: BABYLON.AbstractMesh): void;
         /** Returns the active tab */
         /** Returns the active tab */
-        getActiveTab(): Tab;
+        getActiveTab(): BABYLON.Nullable<Tab>;
         getActiveTabIndex(): number;
         getActiveTabIndex(): number;
         readonly inspector: Inspector;
         readonly inspector: Inspector;
         /**
         /**
@@ -1060,7 +1059,7 @@ declare module INSPECTOR {
          * Updates the icon of this tool with the given string
          * Updates the icon of this tool with the given string
          */
          */
         protected _updateIcon(icon: string): void;
         protected _updateIcon(icon: string): void;
-        abstract action(): any;
+        abstract action(): void;
     }
     }
 }
 }
 
 
@@ -1181,15 +1180,13 @@ declare module INSPECTOR {
         /**
         /**
          * Add an event listener on the item :
          * Add an event listener on the item :
          * - one click display details
          * - one click display details
-         * - on mouse hover the item is highlighted
          */
          */
         protected _addEvent(): void;
         protected _addEvent(): void;
-        /** Highlight or downplay this node */
-        highlight(b: boolean): void;
         /** Returns true if the node is folded, false otherwise */
         /** Returns true if the node is folded, false otherwise */
         private _isFolded();
         private _isFolded();
         /** Set this item as active (background lighter) in the tree panel */
         /** Set this item as active (background lighter) in the tree panel */
         active(b: boolean): void;
         active(b: boolean): void;
+        getDiv(): HTMLElement;
     }
     }
 }
 }
 
 
@@ -1252,7 +1249,6 @@ declare module INSPECTOR {
      */
      */
     class SoundInteractions extends AbstractTreeTool {
     class SoundInteractions extends AbstractTreeTool {
         private playSound;
         private playSound;
-        private b;
         constructor(playSound: ISoundInteractions);
         constructor(playSound: ISoundInteractions);
         protected action(): void;
         protected action(): void;
         private _playSound();
         private _playSound();
@@ -1304,7 +1300,6 @@ declare module INSPECTOR {
      */
      */
     class Info extends AbstractTreeTool {
     class Info extends AbstractTreeTool {
         private _obj;
         private _obj;
-        private _tooltip;
         constructor(obj: IToolInfo);
         constructor(obj: IToolInfo);
         protected action(): void;
         protected action(): void;
     }
     }

File diff suppressed because it is too large
+ 765 - 1022
dist/inspector/babylon.inspector.js


File diff suppressed because it is too large
+ 4 - 3
dist/inspector/babylon.inspector.min.js


+ 33 - 0
dist/inspector/package.json

@@ -0,0 +1,33 @@
+{
+    "author": {
+        "name": "David CATUHE"
+    },
+    "name": "babylonjs-inspector",
+    "description": "The Babylon.js inspector.",
+    "version": "3.1.0",
+    "repository": {
+        "type": "git",
+        "url": "https://github.com/BabylonJS/Babylon.js.git"
+    },
+    "main": "babylon.inspector.bundle.js",
+    "files": [
+        "babylon.inspector.bundle.js",
+        "readme.md",
+        "package.json"
+    ],
+    "keywords": [
+        "3D",
+        "javascript",
+        "html5",
+        "webgl",
+        "babylonjs",
+        "inspector"
+    ],
+    "license": "Apache-2.0",
+    "peerDependencies": {
+        "babylonjs": ">=3.1.0-alpha"
+    },
+    "engines": {
+        "node": "*"
+    }
+}

+ 34 - 0
dist/inspector/readme.md

@@ -0,0 +1,34 @@
+Babylon.js inspector module
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/how_to/debug_layer and search "inspector".
+
+# Installation instructions
+
+The inspector will be **automatically** (async) loaded when starting the debug layer, if not already included. So technically, nothing needs to be done!
+
+If you wish however to use a different version of the inspector or host it on your own, follow these instructions:
+
+## CDN
+
+The latest compiled js file is offered on our public CDN here:
+
+* https://preview.babylonjs.com/inspector/babylonjs.inspector.bundle.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-inspector
+```
+Afterwards it can be imported to the project using:
+
+```
+import * as BABYLON from 'babylonjs';
+import 'babylonjs-inspector';
+```
+
+This will create a global INSPECTOR variable that will be used bay BabylonJS
+
+Webpack is supported.

+ 186 - 61
dist/loaders/babylon.glTF1FileLoader.d.ts

@@ -1,25 +1,98 @@
 
 
 declare module BABYLON {
 declare module BABYLON {
+    enum GLTFLoaderCoordinateSystemMode {
+        /**
+         * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+         */
+        AUTO = 0,
+        /**
+         * Sets the useRightHandedSystem flag on the scene.
+         */
+        FORCE_RIGHT_HANDED = 1,
+    }
+    enum GLTFLoaderAnimationStartMode {
+        /**
+         * No animation will start.
+         */
+        NONE = 0,
+        /**
+         * The first animation will start.
+         */
+        FIRST = 1,
+        /**
+         * All animations will start.
+         */
+        ALL = 2,
+    }
     interface IGLTFLoaderData {
     interface IGLTFLoaderData {
         json: Object;
         json: Object;
-        bin: ArrayBufferView;
+        bin: Nullable<ArrayBufferView>;
     }
     }
-    interface IGLTFLoader {
-        importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void) => void;
-        loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void) => void;
+    interface IGLTFLoader extends IDisposable {
+        importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void) => void;
+        loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void) => void;
     }
     }
-    class GLTFFileLoader implements ISceneLoaderPluginAsync {
+    class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
         static CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
-        static HomogeneousCoordinates: boolean;
+        /**
+         * Raised when the asset has been parsed.
+         * The data.json property stores the glTF JSON.
+         * The data.bin property stores the BIN chunk from a glTF binary or null if the input is not a glTF binary.
+         */
+        onParsed: (data: IGLTFLoaderData) => void;
         static IncrementalLoading: boolean;
         static IncrementalLoading: boolean;
+        static HomogeneousCoordinates: boolean;
+        /**
+         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+         */
+        coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+         * The animation start mode (NONE, FIRST, ALL).
+         */
+        animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+         * Set to true to compile materials before raising the success callback.
+         */
+        compileMaterials: boolean;
+        /**
+         * Set to true to also compile materials with clip planes.
+         */
+        useClipPlane: boolean;
+        /**
+         * Set to true to compile shadow generators before raising the success callback.
+         */
+        compileShadowGenerators: boolean;
+        /**
+         * Raised when the loader creates a mesh after parsing the glTF properties of the mesh.
+         */
+        onMeshLoaded: (mesh: AbstractMesh) => void;
+        /**
+         * Raised when the loader creates a texture after parsing the glTF properties of the texture.
+         */
         onTextureLoaded: (texture: BaseTexture) => void;
         onTextureLoaded: (texture: BaseTexture) => void;
+        /**
+         * Raised when the loader creates a material after parsing the glTF properties of the material.
+         */
         onMaterialLoaded: (material: Material) => void;
         onMaterialLoaded: (material: Material) => void;
+        /**
+         * Raised when the asset is completely loaded, immediately before the loader is disposed.
+         * For assets with LODs, raised when all of the LODs are complete.
+         * For assets without LODs, raised when the model is complete, immediately after onSuccess.
+         */
         onComplete: () => void;
         onComplete: () => void;
+        private _loader;
+        name: string;
         extensions: ISceneLoaderPluginExtensions;
         extensions: ISceneLoaderPluginExtensions;
-        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void): void;
-        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): void;
+        /**
+         * Disposes the loader, releases resources during load, and cancels any outstanding requests.
+         */
+        dispose(): void;
+        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
+        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
         canDirectLoad(data: string): boolean;
         canDirectLoad(data: string): boolean;
+        rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
+        createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
         private static _parse(data);
         private static _parse(data);
         private _getLoader(loaderData);
         private _getLoader(loaderData);
         private static _parseBinary(data);
         private static _parseBinary(data);
@@ -27,7 +100,7 @@ declare module BABYLON {
         private static _parseV2(binaryReader);
         private static _parseV2(binaryReader);
         private static _parseVersion(version);
         private static _parseVersion(version);
         private static _compareVersion(a, b);
         private static _compareVersion(a, b);
-        private static _decodeBufferToText(view);
+        private static _decodeBufferToText(buffer);
     }
     }
 }
 }
 
 
@@ -116,7 +189,9 @@ declare module BABYLON.GLTF1 {
     * Interfaces
     * Interfaces
     */
     */
     interface IGLTFProperty {
     interface IGLTFProperty {
-        extensions?: Object;
+        extensions?: {
+            [key: string]: any;
+        };
         extras?: Object;
         extras?: Object;
     }
     }
     interface IGLTFChildRootProperty extends IGLTFProperty {
     interface IGLTFChildRootProperty extends IGLTFProperty {
@@ -137,6 +212,7 @@ declare module BABYLON.GLTF1 {
         buffer: string;
         buffer: string;
         byteOffset: number;
         byteOffset: number;
         byteLength: number;
         byteLength: number;
+        byteStride: number;
         target?: number;
         target?: number;
     }
     }
     interface IGLTFBuffer extends IGLTFChildRootProperty {
     interface IGLTFBuffer extends IGLTFChildRootProperty {
@@ -179,10 +255,16 @@ declare module BABYLON.GLTF1 {
         functions: IGLTFTechniqueStatesFunctions;
         functions: IGLTFTechniqueStatesFunctions;
     }
     }
     interface IGLTFTechnique extends IGLTFChildRootProperty {
     interface IGLTFTechnique extends IGLTFChildRootProperty {
-        parameters: Object;
+        parameters: {
+            [key: string]: IGLTFTechniqueParameter;
+        };
         program: string;
         program: string;
-        attributes: Object;
-        uniforms: Object;
+        attributes: {
+            [key: string]: string;
+        };
+        uniforms: {
+            [key: string]: string;
+        };
         states: IGLTFTechniqueStates;
         states: IGLTFTechniqueStates;
     }
     }
     interface IGLTFMaterial extends IGLTFChildRootProperty {
     interface IGLTFMaterial extends IGLTFChildRootProperty {
@@ -190,7 +272,9 @@ declare module BABYLON.GLTF1 {
         values: string[];
         values: string[];
     }
     }
     interface IGLTFMeshPrimitive extends IGLTFProperty {
     interface IGLTFMeshPrimitive extends IGLTFProperty {
-        attributes: Object;
+        attributes: {
+            [key: string]: string;
+        };
         indices: string;
         indices: string;
         material: string;
         material: string;
         mode?: number;
         mode?: number;
@@ -269,8 +353,12 @@ declare module BABYLON.GLTF1 {
     }
     }
     interface IGLTFAnimation extends IGLTFChildRootProperty {
     interface IGLTFAnimation extends IGLTFChildRootProperty {
         channels?: IGLTFAnimationChannel[];
         channels?: IGLTFAnimationChannel[];
-        parameters?: Object;
-        samplers?: Object;
+        parameters?: {
+            [key: string]: string;
+        };
+        samplers?: {
+            [key: string]: IGLTFAnimationSampler;
+        };
     }
     }
     interface IGLTFNodeInstanceSkin {
     interface IGLTFNodeInstanceSkin {
         skeletons: string[];
         skeletons: string[];
@@ -304,25 +392,61 @@ declare module BABYLON.GLTF1 {
     * Runtime
     * Runtime
     */
     */
     interface IGLTFRuntime {
     interface IGLTFRuntime {
-        extensions: Object;
-        accessors: Object;
-        buffers: Object;
-        bufferViews: Object;
-        meshes: Object;
-        lights: Object;
-        cameras: Object;
-        nodes: Object;
-        images: Object;
-        textures: Object;
-        shaders: Object;
-        programs: Object;
-        samplers: Object;
-        techniques: Object;
-        materials: Object;
-        animations: Object;
-        skins: Object;
+        extensions: {
+            [key: string]: any;
+        };
+        accessors: {
+            [key: string]: IGLTFAccessor;
+        };
+        buffers: {
+            [key: string]: IGLTFBuffer;
+        };
+        bufferViews: {
+            [key: string]: IGLTFBufferView;
+        };
+        meshes: {
+            [key: string]: IGLTFMesh;
+        };
+        lights: {
+            [key: string]: IGLTFLight;
+        };
+        cameras: {
+            [key: string]: IGLTFCamera;
+        };
+        nodes: {
+            [key: string]: IGLTFNode;
+        };
+        images: {
+            [key: string]: IGLTFImage;
+        };
+        textures: {
+            [key: string]: IGLTFTexture;
+        };
+        shaders: {
+            [key: string]: IGLTFShader;
+        };
+        programs: {
+            [key: string]: IGLTFProgram;
+        };
+        samplers: {
+            [key: string]: IGLTFSampler;
+        };
+        techniques: {
+            [key: string]: IGLTFTechnique;
+        };
+        materials: {
+            [key: string]: IGLTFMaterial;
+        };
+        animations: {
+            [key: string]: IGLTFAnimation;
+        };
+        skins: {
+            [key: string]: IGLTFSkins;
+        };
         currentScene?: Object;
         currentScene?: Object;
-        scenes: Object;
+        scenes: {
+            [key: string]: IGLTFScene;
+        };
         extensionsUsed: string[];
         extensionsUsed: string[];
         extensionsRequired?: string[];
         extensionsRequired?: string[];
         buffersCount: number;
         buffersCount: number;
@@ -359,11 +483,11 @@ declare module BABYLON.GLTF1 {
     */
     */
     class GLTFLoaderBase {
     class GLTFLoaderBase {
         static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime;
         static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime;
-        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void, onProgress?: () => void): void;
-        static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void;
-        static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void;
-        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void;
-        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void;
+        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
+        static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: Nullable<ArrayBufferView>) => void, onError: (message: string) => void): void;
+        static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: Nullable<ArrayBufferView>, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
+        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): void;
+        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
     }
     }
     /**
     /**
     * glTF V1 Loader
     * glTF V1 Loader
@@ -373,10 +497,11 @@ declare module BABYLON.GLTF1 {
             [name: string]: GLTFLoaderExtension;
             [name: string]: GLTFLoaderExtension;
         };
         };
         static RegisterExtension(extension: GLTFLoaderExtension): void;
         static RegisterExtension(extension: GLTFLoaderExtension): void;
-        importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void, onProgress?: () => void): boolean;
-        loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void): void;
+        dispose(): void;
+        importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): boolean;
+        loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
         private _loadShadersAsync(gltfRuntime, onload);
         private _loadShadersAsync(gltfRuntime, onload);
-        private _loadBuffersAsync(gltfRuntime, onload, onProgress?);
+        private _loadBuffersAsync(gltfRuntime, onLoad, onProgress?);
         private _createNodes(gltfRuntime);
         private _createNodes(gltfRuntime);
     }
     }
 }
 }
@@ -461,43 +586,43 @@ declare module BABYLON.GLTF1 {
         * Defines an override for loading the runtime
         * Defines an override for loading the runtime
         * Return true to stop further extensions from loading the runtime
         * Return true to stop further extensions from loading the runtime
         */
         */
-        loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): boolean;
+        loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): boolean;
         /**
         /**
          * Defines an onverride for creating gltf runtime
          * Defines an onverride for creating gltf runtime
          * Return true to stop further extensions from creating the runtime
          * Return true to stop further extensions from creating the runtime
          */
          */
-        loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): boolean;
+        loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean;
         /**
         /**
         * Defines an override for loading buffers
         * Defines an override for loading buffers
         * Return true to stop further extensions from loading this buffer
         * Return true to stop further extensions from loading this buffer
         */
         */
-        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void, onProgress?: () => void): boolean;
+        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): boolean;
         /**
         /**
         * Defines an override for loading texture buffers
         * Defines an override for loading texture buffers
         * Return true to stop further extensions from loading this texture data
         * Return true to stop further extensions from loading this texture data
         */
         */
-        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
+        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
         /**
         /**
         * Defines an override for creating textures
         * Defines an override for creating textures
         * Return true to stop further extensions from loading this texture
         * Return true to stop further extensions from loading this texture
         */
         */
-        createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): boolean;
+        createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: (message: string) => void): boolean;
         /**
         /**
         * Defines an override for loading shader strings
         * Defines an override for loading shader strings
         * Return true to stop further extensions from loading this shader data
         * Return true to stop further extensions from loading this shader data
         */
         */
-        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): boolean;
+        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
         /**
         /**
         * Defines an override for loading materials
         * Defines an override for loading materials
         * Return true to stop further extensions from loading this material
         * Return true to stop further extensions from loading this material
         */
         */
-        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): boolean;
-        static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void;
-        static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void;
-        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void, onProgress?: () => void): void;
-        static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void;
-        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void;
-        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void;
+        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
+        static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): void;
+        static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): void;
+        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
+        static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
+        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: (message: string) => void): void;
+        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
         private static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
         private static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
         private static CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
         private static CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
         private static ApplyExtensions(func, defaultFunc);
         private static ApplyExtensions(func, defaultFunc);
@@ -509,10 +634,10 @@ declare module BABYLON.GLTF1 {
     class GLTFBinaryExtension extends GLTFLoaderExtension {
     class GLTFBinaryExtension extends GLTFLoaderExtension {
         private _bin;
         private _bin;
         constructor();
         constructor();
-        loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): boolean;
-        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
-        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
-        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): boolean;
+        loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): boolean;
+        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
+        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
+        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
     }
     }
 }
 }
 
 
@@ -520,8 +645,8 @@ declare module BABYLON.GLTF1 {
 declare module BABYLON.GLTF1 {
 declare module BABYLON.GLTF1 {
     class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
     class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
         constructor();
         constructor();
-        loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): boolean;
-        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): boolean;
+        loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean;
+        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
         private _loadTexture(gltfRuntime, id, material, propertyPath, onError);
         private _loadTexture(gltfRuntime, id, material, propertyPath, onError);
     }
     }
 }
 }

File diff suppressed because it is too large
+ 274 - 206
dist/loaders/babylon.glTF1FileLoader.js


File diff suppressed because it is too large
+ 2 - 2
dist/loaders/babylon.glTF1FileLoader.min.js


+ 215 - 95
dist/loaders/babylon.glTF2FileLoader.d.ts

@@ -1,25 +1,98 @@
 
 
 declare module BABYLON {
 declare module BABYLON {
+    enum GLTFLoaderCoordinateSystemMode {
+        /**
+         * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+         */
+        AUTO = 0,
+        /**
+         * Sets the useRightHandedSystem flag on the scene.
+         */
+        FORCE_RIGHT_HANDED = 1,
+    }
+    enum GLTFLoaderAnimationStartMode {
+        /**
+         * No animation will start.
+         */
+        NONE = 0,
+        /**
+         * The first animation will start.
+         */
+        FIRST = 1,
+        /**
+         * All animations will start.
+         */
+        ALL = 2,
+    }
     interface IGLTFLoaderData {
     interface IGLTFLoaderData {
         json: Object;
         json: Object;
-        bin: ArrayBufferView;
+        bin: Nullable<ArrayBufferView>;
     }
     }
-    interface IGLTFLoader {
-        importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void) => void;
-        loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void) => void;
+    interface IGLTFLoader extends IDisposable {
+        importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void) => void;
+        loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void) => void;
     }
     }
-    class GLTFFileLoader implements ISceneLoaderPluginAsync {
+    class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
         static CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
-        static HomogeneousCoordinates: boolean;
+        /**
+         * Raised when the asset has been parsed.
+         * The data.json property stores the glTF JSON.
+         * The data.bin property stores the BIN chunk from a glTF binary or null if the input is not a glTF binary.
+         */
+        onParsed: (data: IGLTFLoaderData) => void;
         static IncrementalLoading: boolean;
         static IncrementalLoading: boolean;
+        static HomogeneousCoordinates: boolean;
+        /**
+         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+         */
+        coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+         * The animation start mode (NONE, FIRST, ALL).
+         */
+        animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+         * Set to true to compile materials before raising the success callback.
+         */
+        compileMaterials: boolean;
+        /**
+         * Set to true to also compile materials with clip planes.
+         */
+        useClipPlane: boolean;
+        /**
+         * Set to true to compile shadow generators before raising the success callback.
+         */
+        compileShadowGenerators: boolean;
+        /**
+         * Raised when the loader creates a mesh after parsing the glTF properties of the mesh.
+         */
+        onMeshLoaded: (mesh: AbstractMesh) => void;
+        /**
+         * Raised when the loader creates a texture after parsing the glTF properties of the texture.
+         */
         onTextureLoaded: (texture: BaseTexture) => void;
         onTextureLoaded: (texture: BaseTexture) => void;
+        /**
+         * Raised when the loader creates a material after parsing the glTF properties of the material.
+         */
         onMaterialLoaded: (material: Material) => void;
         onMaterialLoaded: (material: Material) => void;
+        /**
+         * Raised when the asset is completely loaded, immediately before the loader is disposed.
+         * For assets with LODs, raised when all of the LODs are complete.
+         * For assets without LODs, raised when the model is complete, immediately after onSuccess.
+         */
         onComplete: () => void;
         onComplete: () => void;
+        private _loader;
+        name: string;
         extensions: ISceneLoaderPluginExtensions;
         extensions: ISceneLoaderPluginExtensions;
-        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void): void;
-        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): void;
+        /**
+         * Disposes the loader, releases resources during load, and cancels any outstanding requests.
+         */
+        dispose(): void;
+        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
+        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
         canDirectLoad(data: string): boolean;
         canDirectLoad(data: string): boolean;
+        rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
+        createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
         private static _parse(data);
         private static _parse(data);
         private _getLoader(loaderData);
         private _getLoader(loaderData);
         private static _parseBinary(data);
         private static _parseBinary(data);
@@ -27,7 +100,7 @@ declare module BABYLON {
         private static _parseV2(binaryReader);
         private static _parseV2(binaryReader);
         private static _parseVersion(version);
         private static _parseVersion(version);
         private static _compareVersion(a, b);
         private static _compareVersion(a, b);
-        private static _decodeBufferToText(view);
+        private static _decodeBufferToText(buffer);
     }
     }
 }
 }
 
 
@@ -74,7 +147,9 @@ declare module BABYLON.GLTF2 {
     * Interfaces
     * Interfaces
     */
     */
     interface IGLTFProperty {
     interface IGLTFProperty {
-        extensions?: Object;
+        extensions?: {
+            [key: string]: any;
+        };
         extras?: any;
         extras?: any;
     }
     }
     interface IGLTFChildRootProperty extends IGLTFProperty {
     interface IGLTFChildRootProperty extends IGLTFProperty {
@@ -104,6 +179,7 @@ declare module BABYLON.GLTF2 {
         max: number[];
         max: number[];
         min: number[];
         min: number[];
         sparse?: IGLTFAccessorSparse;
         sparse?: IGLTFAccessorSparse;
+        index: number;
     }
     }
     interface IGLTFAnimationChannel extends IGLTFProperty {
     interface IGLTFAnimationChannel extends IGLTFProperty {
         sampler: number;
         sampler: number;
@@ -121,7 +197,8 @@ declare module BABYLON.GLTF2 {
     interface IGLTFAnimation extends IGLTFChildRootProperty {
     interface IGLTFAnimation extends IGLTFChildRootProperty {
         channels: IGLTFAnimationChannel[];
         channels: IGLTFAnimationChannel[];
         samplers: IGLTFAnimationSampler[];
         samplers: IGLTFAnimationSampler[];
-        targets?: any[];
+        index: number;
+        targets: any[];
     }
     }
     interface IGLTFAsset extends IGLTFChildRootProperty {
     interface IGLTFAsset extends IGLTFChildRootProperty {
         copyright?: string;
         copyright?: string;
@@ -132,14 +209,16 @@ declare module BABYLON.GLTF2 {
     interface IGLTFBuffer extends IGLTFChildRootProperty {
     interface IGLTFBuffer extends IGLTFChildRootProperty {
         uri?: string;
         uri?: string;
         byteLength: number;
         byteLength: number;
-        loadedData: ArrayBufferView;
-        loadedObservable: Observable<IGLTFBuffer>;
+        index: number;
+        loadedData?: ArrayBufferView;
+        loadedObservable?: Observable<IGLTFBuffer>;
     }
     }
     interface IGLTFBufferView extends IGLTFChildRootProperty {
     interface IGLTFBufferView extends IGLTFChildRootProperty {
         buffer: number;
         buffer: number;
         byteOffset?: number;
         byteOffset?: number;
         byteLength: number;
         byteLength: number;
         byteStride?: number;
         byteStride?: number;
+        index: number;
     }
     }
     interface IGLTFCameraOrthographic extends IGLTFProperty {
     interface IGLTFCameraOrthographic extends IGLTFProperty {
         xmag: number;
         xmag: number;
@@ -162,6 +241,7 @@ declare module BABYLON.GLTF2 {
         uri?: string;
         uri?: string;
         mimeType?: string;
         mimeType?: string;
         bufferView?: number;
         bufferView?: number;
+        index: number;
     }
     }
     interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo {
     interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo {
         scale: number;
         scale: number;
@@ -185,8 +265,8 @@ declare module BABYLON.GLTF2 {
         alphaMode?: string;
         alphaMode?: string;
         alphaCutoff: number;
         alphaCutoff: number;
         doubleSided?: boolean;
         doubleSided?: boolean;
-        index?: number;
-        babylonMaterial?: Material;
+        index: number;
+        babylonMaterial: Material;
     }
     }
     interface IGLTFMeshPrimitive extends IGLTFProperty {
     interface IGLTFMeshPrimitive extends IGLTFProperty {
         attributes: {
         attributes: {
@@ -195,13 +275,16 @@ declare module BABYLON.GLTF2 {
         indices?: number;
         indices?: number;
         material?: number;
         material?: number;
         mode?: EMeshPrimitiveMode;
         mode?: EMeshPrimitiveMode;
-        targets?: [{
+        targets?: {
             [name: string]: number;
             [name: string]: number;
-        }];
+        }[];
+        vertexData: VertexData;
+        targetsVertexData: VertexData[];
     }
     }
     interface IGLTFMesh extends IGLTFChildRootProperty {
     interface IGLTFMesh extends IGLTFChildRootProperty {
         primitives: IGLTFMeshPrimitive[];
         primitives: IGLTFMeshPrimitive[];
         weights?: number[];
         weights?: number[];
+        index: number;
     }
     }
     interface IGLTFNode extends IGLTFChildRootProperty {
     interface IGLTFNode extends IGLTFChildRootProperty {
         camera?: number;
         camera?: number;
@@ -213,12 +296,9 @@ declare module BABYLON.GLTF2 {
         scale?: number[];
         scale?: number[];
         translation?: number[];
         translation?: number[];
         weights?: number[];
         weights?: number[];
-        index?: number;
-        parent?: IGLTFNode;
-        babylonMesh?: Mesh;
-        babylonSkinToBones?: {
-            [skin: number]: Bone;
-        };
+        index: number;
+        parent: IGLTFNode;
+        babylonMesh: Mesh;
         babylonAnimationTargets?: Node[];
         babylonAnimationTargets?: Node[];
     }
     }
     interface IGLTFSampler extends IGLTFChildRootProperty {
     interface IGLTFSampler extends IGLTFChildRootProperty {
@@ -226,22 +306,29 @@ declare module BABYLON.GLTF2 {
         minFilter?: ETextureMinFilter;
         minFilter?: ETextureMinFilter;
         wrapS?: ETextureWrapMode;
         wrapS?: ETextureWrapMode;
         wrapT?: ETextureWrapMode;
         wrapT?: ETextureWrapMode;
+        index: number;
+        noMipMaps: boolean;
+        samplingMode: number;
+        wrapU: number;
+        wrapV: number;
     }
     }
     interface IGLTFScene extends IGLTFChildRootProperty {
     interface IGLTFScene extends IGLTFChildRootProperty {
         nodes: number[];
         nodes: number[];
+        index: number;
     }
     }
     interface IGLTFSkin extends IGLTFChildRootProperty {
     interface IGLTFSkin extends IGLTFChildRootProperty {
         inverseBindMatrices?: number;
         inverseBindMatrices?: number;
         skeleton?: number;
         skeleton?: number;
         joints: number[];
         joints: number[];
-        index?: number;
-        babylonSkeleton?: Skeleton;
+        index: number;
+        babylonSkeleton: Skeleton;
     }
     }
     interface IGLTFTexture extends IGLTFChildRootProperty {
     interface IGLTFTexture extends IGLTFChildRootProperty {
         sampler?: number;
         sampler?: number;
         source: number;
         source: number;
-        babylonTextures?: Texture[];
-        blobURL?: string;
+        index: number;
+        url?: string;
+        dataReadyObservable?: Observable<IGLTFTexture>;
     }
     }
     interface IGLTFTextureInfo {
     interface IGLTFTextureInfo {
         index: number;
         index: number;
@@ -256,7 +343,6 @@ declare module BABYLON.GLTF2 {
         cameras?: IGLTFCamera[];
         cameras?: IGLTFCamera[];
         extensionsUsed?: string[];
         extensionsUsed?: string[];
         extensionsRequired?: string[];
         extensionsRequired?: string[];
-        glExtensionsUsed?: string[];
         images?: IGLTFImage[];
         images?: IGLTFImage[];
         materials?: IGLTFMaterial[];
         materials?: IGLTFMaterial[];
         meshes?: IGLTFMesh[];
         meshes?: IGLTFMesh[];
@@ -272,62 +358,104 @@ declare module BABYLON.GLTF2 {
 
 
 declare module BABYLON.GLTF2 {
 declare module BABYLON.GLTF2 {
     class GLTFLoader implements IGLTFLoader {
     class GLTFLoader implements IGLTFLoader {
+        _gltf: IGLTF;
+        _babylonScene: Scene;
+        private _disposed;
         private _parent;
         private _parent;
-        private _gltf;
-        private _errors;
-        private _babylonScene;
         private _rootUrl;
         private _rootUrl;
         private _defaultMaterial;
         private _defaultMaterial;
-        private _onSuccess;
-        private _onError;
+        private _defaultSampler;
+        private _rootNode;
+        private _successCallback;
+        private _progressCallback;
+        private _errorCallback;
         private _renderReady;
         private _renderReady;
+        private _requests;
+        private _renderReadyObservable;
         private _renderPendingCount;
         private _renderPendingCount;
         private _loaderPendingCount;
         private _loaderPendingCount;
+        private _loaderTrackers;
         static Extensions: {
         static Extensions: {
             [name: string]: GLTFLoaderExtension;
             [name: string]: GLTFLoaderExtension;
         };
         };
         static RegisterExtension(extension: GLTFLoaderExtension): void;
         static RegisterExtension(extension: GLTFLoaderExtension): void;
-        readonly gltf: IGLTF;
-        readonly babylonScene: Scene;
+        private static _progressEventFactory;
+        private static _createProgressEventByConstructor(name, data);
+        private static _createProgressEventByDocument(name, data);
         constructor(parent: GLTFFileLoader);
         constructor(parent: GLTFFileLoader);
-        importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void): void;
-        loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void): void;
-        private _loadAsync(nodeNames, scene, data, rootUrl, onSuccess, onError);
+        dispose(): void;
+        importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
+        loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
+        private _loadAsync(nodeNames, scene, data, rootUrl, onSuccess, onProgress, onError);
+        private _onProgress();
+        _executeWhenRenderReady(func: () => void): void;
         private _onRenderReady();
         private _onRenderReady();
-        private _onLoaderComplete();
+        private _onComplete();
         private _loadData(data);
         private _loadData(data);
-        private _showMeshes();
+        private _getMeshes();
+        private _getSkeletons();
         private _startAnimations();
         private _startAnimations();
-        private _clear();
-        private _loadScene(nodeNames);
-        private _loadSkin(node);
-        private _updateBone(node, parentNode, skin, inverseBindMatrixData);
-        private _createBone(node, skin);
-        private _loadMesh(node);
-        private _loadMeshData(node, mesh, babylonMesh);
-        private _assignMaterial(multiMaterial, index, subMaterial);
-        private _loadVertexDataAsync(primitive, onSuccess);
-        private _createMorphTargets(node, mesh, primitive, babylonMesh);
-        private _loadMorphTargetsData(mesh, primitive, vertexData, babylonMesh);
-        private _loadTransform(node, babylonMesh);
-        private _traverseNodes(indices, action, parentNode?);
-        private _traverseNode(index, action, parentNode?);
+        private _loadDefaultScene(nodeNames);
+        private _loadScene(context, scene, nodeNames);
+        _loadNode(context: string, node: IGLTFNode): void;
+        private _loadMesh(context, node, mesh);
+        private _loadAllVertexDataAsync(context, mesh, onSuccess);
+        /**
+         * Converts a data bufferview into a Float4 Texture Coordinate Array, based on the accessor component type
+         * @param {ArrayBufferView} data
+         * @param {IGLTFAccessor} accessor
+         */
+        private _convertToFloat4TextureCoordArray(context, data, accessor);
+        /**
+         * Converts a data bufferview into a Float4 Color Array, based on the accessor component type
+         * @param {ArrayBufferView} data
+         * @param {IGLTFAccessor} accessor
+         */
+        private _convertToFloat4ColorArray(context, data, accessor);
+        private _loadVertexDataAsync(context, mesh, primitive, onSuccess);
+        private _createMorphTargets(context, node, mesh);
+        private _loadMorphTargets(context, node, mesh);
+        private _loadAllMorphTargetVertexDataAsync(context, node, mesh, onSuccess);
+        private _loadMorphTargetVertexDataAsync(context, vertexData, attributes, onSuccess);
+        private _loadTransform(node);
+        private _loadSkinAsync(context, skin, onSuccess);
+        private _createBone(node, skin, parent, localMatrix, baseMatrix, index);
+        private _loadBones(context, skin, inverseBindMatrixData);
+        private _loadBone(node, skin, inverseBindMatrixData, babylonBones);
+        private _getNodeMatrix(node);
+        private _traverseNodes(context, indices, action, parentNode);
+        _traverseNode(context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): void;
         private _loadAnimations();
         private _loadAnimations();
-        private _loadAnimationChannel(animation, animationIndex, channelIndex);
-        private _loadBufferAsync(index, onSuccess);
-        private _loadBufferViewAsync(bufferView, byteOffset, byteLength, componentType, onSuccess);
-        private _loadAccessorAsync(accessor, onSuccess);
-        addPendingData(data: any): void;
-        removePendingData(data: any): void;
-        addLoaderPendingData(data: any): void;
-        removeLoaderPendingData(data: any): void;
+        private _loadAnimation(context, animation);
+        private _loadAnimationChannel(animation, channelContext, channel, samplerContext, sampler);
+        private _loadBufferAsync(context, buffer, onSuccess);
+        private _loadBufferViewAsync(context, bufferView, onSuccess);
+        private _loadAccessorAsync(context, accessor, onSuccess);
+        private _buildArrayBuffer<T>(typedArray, data, byteOffset, count, numComponents, byteStride?);
+        _addPendingData(data: any): void;
+        _removePendingData(data: any): void;
+        _addLoaderPendingData(data: any): void;
+        _removeLoaderPendingData(data: any): void;
+        _whenAction(action: () => void, onComplete: () => void): void;
         private _getDefaultMaterial();
         private _getDefaultMaterial();
-        private _loadMaterialMetallicRoughnessProperties(material);
-        loadMaterial(index: number, assign: (material: Material) => void): void;
-        createPbrMaterial(material: IGLTFMaterial): void;
-        loadMaterialBaseProperties(material: IGLTFMaterial): void;
-        loadMaterialAlphaProperties(material: IGLTFMaterial): void;
-        loadTexture(textureInfo: IGLTFTextureInfo): Texture;
+        private _loadMaterialMetallicRoughnessProperties(context, material);
+        _loadMaterial(context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): void;
+        _createPbrMaterial(material: IGLTFMaterial): void;
+        _loadMaterialBaseProperties(context: string, material: IGLTFMaterial): void;
+        _loadMaterialAlphaProperties(context: string, material: IGLTFMaterial, colorFactor: number[]): void;
+        _loadTexture(context: string, texture: IGLTFTexture, coordinatesIndex?: number): Texture;
+        private _loadSampler(context, sampler);
+        private _loadImageAsync(context, image, onSuccess);
+        _loadUriAsync(context: string, uri: string, onSuccess: (data: ArrayBufferView) => void): void;
+        _tryCatchOnError(handler: () => void): void;
+        private static _AssignIndices(array?);
+        static _GetProperty<T extends IGLTFProperty>(array?: ArrayLike<T>, index?: number): Nullable<T>;
+        private static _GetTextureWrapMode(context, mode?);
+        private static _GetTextureSamplingMode(context, magFilter?, minFilter?);
+        private static _GetNumComponents(context, type);
+        private _compileMaterialAsync(babylonMaterial, babylonMesh, onSuccess);
+        private _compileMaterialsAsync(onSuccess);
+        private _compileShadowGeneratorsAsync(onSuccess);
     }
     }
 }
 }
 
 
@@ -347,27 +475,7 @@ declare module BABYLON.GLTF2 {
         * @param uri: the uri to decode
         * @param uri: the uri to decode
         */
         */
         static DecodeBase64(uri: string): ArrayBuffer;
         static DecodeBase64(uri: string): ArrayBuffer;
-        static ForEach(view: Uint16Array | Uint32Array | Float32Array, func: (nvalue: number, index: number) => void): void;
-        /**
-        * Returns the wrap mode of the texture
-        * @param mode: the mode value
-        */
-        static GetWrapMode(mode: number): number;
-        /**
-         * Returns the byte stride giving an accessor
-         * @param accessor: the GLTF accessor objet
-         */
-        static GetByteStrideFromType(accessor: IGLTFAccessor): number;
-        /**
-         * Returns the texture filter mode giving a mode value
-         * @param mode: the filter mode value
-         */
-        static GetTextureFilterMode(mode: number): ETextureMinFilter;
-        /**
-         * Decodes a buffer view into a string
-         * @param view: the buffer view
-         */
-        static DecodeBufferToText(view: ArrayBufferView): string;
+        static ValidateUri(uri: string): boolean;
     }
     }
 }
 }
 
 
@@ -376,9 +484,14 @@ declare module BABYLON.GLTF2 {
     abstract class GLTFLoaderExtension {
     abstract class GLTFLoaderExtension {
         enabled: boolean;
         enabled: boolean;
         readonly abstract name: string;
         readonly abstract name: string;
-        protected loadMaterial(loader: GLTFLoader, material: IGLTFMaterial, assign: (material: Material) => void): boolean;
+        protected _traverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
+        protected _loadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
+        protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
+        protected _loadExtension<T>(context: string, property: IGLTFProperty, action: (context: string, extension: T, onComplete: () => void) => void): boolean;
         static _Extensions: GLTFLoaderExtension[];
         static _Extensions: GLTFLoaderExtension[];
-        static LoadMaterial(loader: GLTFLoader, material: IGLTFMaterial, assign: (material: Material) => void): boolean;
+        static TraverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
+        static LoadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
+        static LoadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
         private static _ApplyExtensions(action);
         private static _ApplyExtensions(action);
     }
     }
 }
 }
@@ -386,9 +499,16 @@ declare module BABYLON.GLTF2 {
 
 
 declare module BABYLON.GLTF2.Extensions {
 declare module BABYLON.GLTF2.Extensions {
     class MSFTLOD extends GLTFLoaderExtension {
     class MSFTLOD extends GLTFLoaderExtension {
+        /**
+         * Specify the minimal delay between LODs in ms (default = 250)
+         */
+        Delay: number;
         readonly name: string;
         readonly name: string;
-        protected loadMaterial(loader: GLTFLoader, material: IGLTFMaterial, assign: (material: Material) => void): boolean;
-        private loadMaterialLOD(loader, material, materialLODs, lod, assign);
+        protected _traverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
+        protected _loadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
+        private _loadNodeLOD(loader, context, nodes, index, onComplete);
+        protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
+        private _loadMaterialLOD(loader, context, materials, index, assign, onComplete);
     }
     }
 }
 }
 
 
@@ -396,7 +516,7 @@ declare module BABYLON.GLTF2.Extensions {
 declare module BABYLON.GLTF2.Extensions {
 declare module BABYLON.GLTF2.Extensions {
     class KHRMaterialsPbrSpecularGlossiness extends GLTFLoaderExtension {
     class KHRMaterialsPbrSpecularGlossiness extends GLTFLoaderExtension {
         readonly name: string;
         readonly name: string;
-        protected loadMaterial(loader: GLTFLoader, material: IGLTFMaterial, assign: (material: Material) => void): boolean;
-        private _loadSpecularGlossinessProperties(loader, material, properties);
+        protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
+        private _loadSpecularGlossinessProperties(loader, context, material, properties);
     }
     }
 }
 }

File diff suppressed because it is too large
+ 1597 - 754
dist/loaders/babylon.glTF2FileLoader.js


File diff suppressed because it is too large
+ 2 - 1
dist/loaders/babylon.glTF2FileLoader.min.js


+ 319 - 147
dist/loaders/babylon.glTFFileLoader.d.ts

@@ -1,25 +1,98 @@
 
 
 declare module BABYLON {
 declare module BABYLON {
+    enum GLTFLoaderCoordinateSystemMode {
+        /**
+         * Automatically convert the glTF right-handed data to the appropriate system based on the current coordinate system mode of the scene.
+         */
+        AUTO = 0,
+        /**
+         * Sets the useRightHandedSystem flag on the scene.
+         */
+        FORCE_RIGHT_HANDED = 1,
+    }
+    enum GLTFLoaderAnimationStartMode {
+        /**
+         * No animation will start.
+         */
+        NONE = 0,
+        /**
+         * The first animation will start.
+         */
+        FIRST = 1,
+        /**
+         * All animations will start.
+         */
+        ALL = 2,
+    }
     interface IGLTFLoaderData {
     interface IGLTFLoaderData {
         json: Object;
         json: Object;
-        bin: ArrayBufferView;
+        bin: Nullable<ArrayBufferView>;
     }
     }
-    interface IGLTFLoader {
-        importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void) => void;
-        loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void) => void;
+    interface IGLTFLoader extends IDisposable {
+        importMeshAsync: (meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void) => void;
+        loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void) => void;
     }
     }
-    class GLTFFileLoader implements ISceneLoaderPluginAsync {
+    class GLTFFileLoader implements IDisposable, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
         static CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV1: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
         static CreateGLTFLoaderV2: (parent: GLTFFileLoader) => IGLTFLoader;
-        static HomogeneousCoordinates: boolean;
+        /**
+         * Raised when the asset has been parsed.
+         * The data.json property stores the glTF JSON.
+         * The data.bin property stores the BIN chunk from a glTF binary or null if the input is not a glTF binary.
+         */
+        onParsed: (data: IGLTFLoaderData) => void;
         static IncrementalLoading: boolean;
         static IncrementalLoading: boolean;
+        static HomogeneousCoordinates: boolean;
+        /**
+         * The coordinate system mode (AUTO, FORCE_RIGHT_HANDED).
+         */
+        coordinateSystemMode: GLTFLoaderCoordinateSystemMode;
+        /**
+         * The animation start mode (NONE, FIRST, ALL).
+         */
+        animationStartMode: GLTFLoaderAnimationStartMode;
+        /**
+         * Set to true to compile materials before raising the success callback.
+         */
+        compileMaterials: boolean;
+        /**
+         * Set to true to also compile materials with clip planes.
+         */
+        useClipPlane: boolean;
+        /**
+         * Set to true to compile shadow generators before raising the success callback.
+         */
+        compileShadowGenerators: boolean;
+        /**
+         * Raised when the loader creates a mesh after parsing the glTF properties of the mesh.
+         */
+        onMeshLoaded: (mesh: AbstractMesh) => void;
+        /**
+         * Raised when the loader creates a texture after parsing the glTF properties of the texture.
+         */
         onTextureLoaded: (texture: BaseTexture) => void;
         onTextureLoaded: (texture: BaseTexture) => void;
+        /**
+         * Raised when the loader creates a material after parsing the glTF properties of the material.
+         */
         onMaterialLoaded: (material: Material) => void;
         onMaterialLoaded: (material: Material) => void;
+        /**
+         * Raised when the asset is completely loaded, immediately before the loader is disposed.
+         * For assets with LODs, raised when all of the LODs are complete.
+         * For assets without LODs, raised when the model is complete, immediately after onSuccess.
+         */
         onComplete: () => void;
         onComplete: () => void;
+        private _loader;
+        name: string;
         extensions: ISceneLoaderPluginExtensions;
         extensions: ISceneLoaderPluginExtensions;
-        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void): void;
-        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onError: () => void): void;
+        /**
+         * Disposes the loader, releases resources during load, and cancels any outstanding requests.
+         */
+        dispose(): void;
+        importMeshAsync(meshesNames: any, scene: Scene, data: any, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
+        loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
         canDirectLoad(data: string): boolean;
         canDirectLoad(data: string): boolean;
+        rewriteRootURL: (rootUrl: string, responseURL?: string) => string;
+        createPlugin(): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
         private static _parse(data);
         private static _parse(data);
         private _getLoader(loaderData);
         private _getLoader(loaderData);
         private static _parseBinary(data);
         private static _parseBinary(data);
@@ -27,7 +100,7 @@ declare module BABYLON {
         private static _parseV2(binaryReader);
         private static _parseV2(binaryReader);
         private static _parseVersion(version);
         private static _parseVersion(version);
         private static _compareVersion(a, b);
         private static _compareVersion(a, b);
-        private static _decodeBufferToText(view);
+        private static _decodeBufferToText(buffer);
     }
     }
 }
 }
 
 
@@ -116,7 +189,9 @@ declare module BABYLON.GLTF1 {
     * Interfaces
     * Interfaces
     */
     */
     interface IGLTFProperty {
     interface IGLTFProperty {
-        extensions?: Object;
+        extensions?: {
+            [key: string]: any;
+        };
         extras?: Object;
         extras?: Object;
     }
     }
     interface IGLTFChildRootProperty extends IGLTFProperty {
     interface IGLTFChildRootProperty extends IGLTFProperty {
@@ -137,6 +212,7 @@ declare module BABYLON.GLTF1 {
         buffer: string;
         buffer: string;
         byteOffset: number;
         byteOffset: number;
         byteLength: number;
         byteLength: number;
+        byteStride: number;
         target?: number;
         target?: number;
     }
     }
     interface IGLTFBuffer extends IGLTFChildRootProperty {
     interface IGLTFBuffer extends IGLTFChildRootProperty {
@@ -179,10 +255,16 @@ declare module BABYLON.GLTF1 {
         functions: IGLTFTechniqueStatesFunctions;
         functions: IGLTFTechniqueStatesFunctions;
     }
     }
     interface IGLTFTechnique extends IGLTFChildRootProperty {
     interface IGLTFTechnique extends IGLTFChildRootProperty {
-        parameters: Object;
+        parameters: {
+            [key: string]: IGLTFTechniqueParameter;
+        };
         program: string;
         program: string;
-        attributes: Object;
-        uniforms: Object;
+        attributes: {
+            [key: string]: string;
+        };
+        uniforms: {
+            [key: string]: string;
+        };
         states: IGLTFTechniqueStates;
         states: IGLTFTechniqueStates;
     }
     }
     interface IGLTFMaterial extends IGLTFChildRootProperty {
     interface IGLTFMaterial extends IGLTFChildRootProperty {
@@ -190,7 +272,9 @@ declare module BABYLON.GLTF1 {
         values: string[];
         values: string[];
     }
     }
     interface IGLTFMeshPrimitive extends IGLTFProperty {
     interface IGLTFMeshPrimitive extends IGLTFProperty {
-        attributes: Object;
+        attributes: {
+            [key: string]: string;
+        };
         indices: string;
         indices: string;
         material: string;
         material: string;
         mode?: number;
         mode?: number;
@@ -269,8 +353,12 @@ declare module BABYLON.GLTF1 {
     }
     }
     interface IGLTFAnimation extends IGLTFChildRootProperty {
     interface IGLTFAnimation extends IGLTFChildRootProperty {
         channels?: IGLTFAnimationChannel[];
         channels?: IGLTFAnimationChannel[];
-        parameters?: Object;
-        samplers?: Object;
+        parameters?: {
+            [key: string]: string;
+        };
+        samplers?: {
+            [key: string]: IGLTFAnimationSampler;
+        };
     }
     }
     interface IGLTFNodeInstanceSkin {
     interface IGLTFNodeInstanceSkin {
         skeletons: string[];
         skeletons: string[];
@@ -304,25 +392,61 @@ declare module BABYLON.GLTF1 {
     * Runtime
     * Runtime
     */
     */
     interface IGLTFRuntime {
     interface IGLTFRuntime {
-        extensions: Object;
-        accessors: Object;
-        buffers: Object;
-        bufferViews: Object;
-        meshes: Object;
-        lights: Object;
-        cameras: Object;
-        nodes: Object;
-        images: Object;
-        textures: Object;
-        shaders: Object;
-        programs: Object;
-        samplers: Object;
-        techniques: Object;
-        materials: Object;
-        animations: Object;
-        skins: Object;
+        extensions: {
+            [key: string]: any;
+        };
+        accessors: {
+            [key: string]: IGLTFAccessor;
+        };
+        buffers: {
+            [key: string]: IGLTFBuffer;
+        };
+        bufferViews: {
+            [key: string]: IGLTFBufferView;
+        };
+        meshes: {
+            [key: string]: IGLTFMesh;
+        };
+        lights: {
+            [key: string]: IGLTFLight;
+        };
+        cameras: {
+            [key: string]: IGLTFCamera;
+        };
+        nodes: {
+            [key: string]: IGLTFNode;
+        };
+        images: {
+            [key: string]: IGLTFImage;
+        };
+        textures: {
+            [key: string]: IGLTFTexture;
+        };
+        shaders: {
+            [key: string]: IGLTFShader;
+        };
+        programs: {
+            [key: string]: IGLTFProgram;
+        };
+        samplers: {
+            [key: string]: IGLTFSampler;
+        };
+        techniques: {
+            [key: string]: IGLTFTechnique;
+        };
+        materials: {
+            [key: string]: IGLTFMaterial;
+        };
+        animations: {
+            [key: string]: IGLTFAnimation;
+        };
+        skins: {
+            [key: string]: IGLTFSkins;
+        };
         currentScene?: Object;
         currentScene?: Object;
-        scenes: Object;
+        scenes: {
+            [key: string]: IGLTFScene;
+        };
         extensionsUsed: string[];
         extensionsUsed: string[];
         extensionsRequired?: string[];
         extensionsRequired?: string[];
         buffersCount: number;
         buffersCount: number;
@@ -359,11 +483,11 @@ declare module BABYLON.GLTF1 {
     */
     */
     class GLTFLoaderBase {
     class GLTFLoaderBase {
         static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime;
         static CreateRuntime(parsedData: any, scene: Scene, rootUrl: string): IGLTFRuntime;
-        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void, onProgress?: () => void): void;
-        static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): void;
-        static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): void;
-        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): void;
-        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void;
+        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
+        static LoadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: Nullable<ArrayBufferView>) => void, onError: (message: string) => void): void;
+        static CreateTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: Nullable<ArrayBufferView>, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
+        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): void;
+        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
     }
     }
     /**
     /**
     * glTF V1 Loader
     * glTF V1 Loader
@@ -373,10 +497,11 @@ declare module BABYLON.GLTF1 {
             [name: string]: GLTFLoaderExtension;
             [name: string]: GLTFLoaderExtension;
         };
         };
         static RegisterExtension(extension: GLTFLoaderExtension): void;
         static RegisterExtension(extension: GLTFLoaderExtension): void;
-        importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError?: () => void, onProgress?: () => void): boolean;
-        loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void): void;
+        dispose(): void;
+        importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): boolean;
+        loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
         private _loadShadersAsync(gltfRuntime, onload);
         private _loadShadersAsync(gltfRuntime, onload);
-        private _loadBuffersAsync(gltfRuntime, onload, onProgress?);
+        private _loadBuffersAsync(gltfRuntime, onLoad, onProgress?);
         private _createNodes(gltfRuntime);
         private _createNodes(gltfRuntime);
     }
     }
 }
 }
@@ -461,43 +586,43 @@ declare module BABYLON.GLTF1 {
         * Defines an override for loading the runtime
         * Defines an override for loading the runtime
         * Return true to stop further extensions from loading the runtime
         * Return true to stop further extensions from loading the runtime
         */
         */
-        loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): boolean;
+        loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): boolean;
         /**
         /**
          * Defines an onverride for creating gltf runtime
          * Defines an onverride for creating gltf runtime
          * Return true to stop further extensions from creating the runtime
          * Return true to stop further extensions from creating the runtime
          */
          */
-        loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): boolean;
+        loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean;
         /**
         /**
         * Defines an override for loading buffers
         * Defines an override for loading buffers
         * Return true to stop further extensions from loading this buffer
         * Return true to stop further extensions from loading this buffer
         */
         */
-        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void, onProgress?: () => void): boolean;
+        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): boolean;
         /**
         /**
         * Defines an override for loading texture buffers
         * Defines an override for loading texture buffers
         * Return true to stop further extensions from loading this texture data
         * Return true to stop further extensions from loading this texture data
         */
         */
-        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
+        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
         /**
         /**
         * Defines an override for creating textures
         * Defines an override for creating textures
         * Return true to stop further extensions from loading this texture
         * Return true to stop further extensions from loading this texture
         */
         */
-        createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: () => void): boolean;
+        createTextureAsync(gltfRuntime: IGLTFRuntime, id: string, buffer: ArrayBufferView, onSuccess: (texture: Texture) => void, onError: (message: string) => void): boolean;
         /**
         /**
         * Defines an override for loading shader strings
         * Defines an override for loading shader strings
         * Return true to stop further extensions from loading this shader data
         * Return true to stop further extensions from loading this shader data
         */
         */
-        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): boolean;
+        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
         /**
         /**
         * Defines an override for loading materials
         * Defines an override for loading materials
         * Return true to stop further extensions from loading this material
         * Return true to stop further extensions from loading this material
         */
         */
-        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): boolean;
-        static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): void;
-        static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): void;
-        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: () => void, onProgress?: () => void): void;
-        static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: () => void): void;
-        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: () => void): void;
-        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): void;
+        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
+        static LoadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): void;
+        static LoadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): void;
+        static LoadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (bufferView: ArrayBufferView) => void, onError: (message: string) => void, onProgress?: () => void): void;
+        static LoadTextureAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (texture: Texture) => void, onError: (message: string) => void): void;
+        static LoadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderData: string) => void, onError: (message: string) => void): void;
+        static LoadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): void;
         private static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
         private static LoadTextureBufferAsync(gltfRuntime, id, onSuccess, onError);
         private static CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
         private static CreateTextureAsync(gltfRuntime, id, buffer, onSuccess, onError);
         private static ApplyExtensions(func, defaultFunc);
         private static ApplyExtensions(func, defaultFunc);
@@ -509,10 +634,10 @@ declare module BABYLON.GLTF1 {
     class GLTFBinaryExtension extends GLTFLoaderExtension {
     class GLTFBinaryExtension extends GLTFLoaderExtension {
         private _bin;
         private _bin;
         constructor();
         constructor();
-        loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: () => void): boolean;
-        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
-        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: () => void): boolean;
-        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: () => void): boolean;
+        loadRuntimeAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (gltfRuntime: IGLTFRuntime) => void, onError: (message: string) => void): boolean;
+        loadBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
+        loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void, onError: (message: string) => void): boolean;
+        loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void, onError: (message: string) => void): boolean;
     }
     }
 }
 }
 
 
@@ -520,8 +645,8 @@ declare module BABYLON.GLTF1 {
 declare module BABYLON.GLTF1 {
 declare module BABYLON.GLTF1 {
     class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
     class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
         constructor();
         constructor();
-        loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: () => void): boolean;
-        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: () => void): boolean;
+        loadRuntimeExtensionsAsync(gltfRuntime: IGLTFRuntime, onSuccess: () => void, onError: (message: string) => void): boolean;
+        loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
         private _loadTexture(gltfRuntime, id, material, propertyPath, onError);
         private _loadTexture(gltfRuntime, id, material, propertyPath, onError);
     }
     }
 }
 }
@@ -569,7 +694,9 @@ declare module BABYLON.GLTF2 {
     * Interfaces
     * Interfaces
     */
     */
     interface IGLTFProperty {
     interface IGLTFProperty {
-        extensions?: Object;
+        extensions?: {
+            [key: string]: any;
+        };
         extras?: any;
         extras?: any;
     }
     }
     interface IGLTFChildRootProperty extends IGLTFProperty {
     interface IGLTFChildRootProperty extends IGLTFProperty {
@@ -599,6 +726,7 @@ declare module BABYLON.GLTF2 {
         max: number[];
         max: number[];
         min: number[];
         min: number[];
         sparse?: IGLTFAccessorSparse;
         sparse?: IGLTFAccessorSparse;
+        index: number;
     }
     }
     interface IGLTFAnimationChannel extends IGLTFProperty {
     interface IGLTFAnimationChannel extends IGLTFProperty {
         sampler: number;
         sampler: number;
@@ -616,7 +744,8 @@ declare module BABYLON.GLTF2 {
     interface IGLTFAnimation extends IGLTFChildRootProperty {
     interface IGLTFAnimation extends IGLTFChildRootProperty {
         channels: IGLTFAnimationChannel[];
         channels: IGLTFAnimationChannel[];
         samplers: IGLTFAnimationSampler[];
         samplers: IGLTFAnimationSampler[];
-        targets?: any[];
+        index: number;
+        targets: any[];
     }
     }
     interface IGLTFAsset extends IGLTFChildRootProperty {
     interface IGLTFAsset extends IGLTFChildRootProperty {
         copyright?: string;
         copyright?: string;
@@ -627,14 +756,16 @@ declare module BABYLON.GLTF2 {
     interface IGLTFBuffer extends IGLTFChildRootProperty {
     interface IGLTFBuffer extends IGLTFChildRootProperty {
         uri?: string;
         uri?: string;
         byteLength: number;
         byteLength: number;
-        loadedData: ArrayBufferView;
-        loadedObservable: Observable<IGLTFBuffer>;
+        index: number;
+        loadedData?: ArrayBufferView;
+        loadedObservable?: Observable<IGLTFBuffer>;
     }
     }
     interface IGLTFBufferView extends IGLTFChildRootProperty {
     interface IGLTFBufferView extends IGLTFChildRootProperty {
         buffer: number;
         buffer: number;
         byteOffset?: number;
         byteOffset?: number;
         byteLength: number;
         byteLength: number;
         byteStride?: number;
         byteStride?: number;
+        index: number;
     }
     }
     interface IGLTFCameraOrthographic extends IGLTFProperty {
     interface IGLTFCameraOrthographic extends IGLTFProperty {
         xmag: number;
         xmag: number;
@@ -657,6 +788,7 @@ declare module BABYLON.GLTF2 {
         uri?: string;
         uri?: string;
         mimeType?: string;
         mimeType?: string;
         bufferView?: number;
         bufferView?: number;
+        index: number;
     }
     }
     interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo {
     interface IGLTFMaterialNormalTextureInfo extends IGLTFTextureInfo {
         scale: number;
         scale: number;
@@ -680,8 +812,8 @@ declare module BABYLON.GLTF2 {
         alphaMode?: string;
         alphaMode?: string;
         alphaCutoff: number;
         alphaCutoff: number;
         doubleSided?: boolean;
         doubleSided?: boolean;
-        index?: number;
-        babylonMaterial?: Material;
+        index: number;
+        babylonMaterial: Material;
     }
     }
     interface IGLTFMeshPrimitive extends IGLTFProperty {
     interface IGLTFMeshPrimitive extends IGLTFProperty {
         attributes: {
         attributes: {
@@ -690,13 +822,16 @@ declare module BABYLON.GLTF2 {
         indices?: number;
         indices?: number;
         material?: number;
         material?: number;
         mode?: EMeshPrimitiveMode;
         mode?: EMeshPrimitiveMode;
-        targets?: [{
+        targets?: {
             [name: string]: number;
             [name: string]: number;
-        }];
+        }[];
+        vertexData: VertexData;
+        targetsVertexData: VertexData[];
     }
     }
     interface IGLTFMesh extends IGLTFChildRootProperty {
     interface IGLTFMesh extends IGLTFChildRootProperty {
         primitives: IGLTFMeshPrimitive[];
         primitives: IGLTFMeshPrimitive[];
         weights?: number[];
         weights?: number[];
+        index: number;
     }
     }
     interface IGLTFNode extends IGLTFChildRootProperty {
     interface IGLTFNode extends IGLTFChildRootProperty {
         camera?: number;
         camera?: number;
@@ -708,12 +843,9 @@ declare module BABYLON.GLTF2 {
         scale?: number[];
         scale?: number[];
         translation?: number[];
         translation?: number[];
         weights?: number[];
         weights?: number[];
-        index?: number;
-        parent?: IGLTFNode;
-        babylonMesh?: Mesh;
-        babylonSkinToBones?: {
-            [skin: number]: Bone;
-        };
+        index: number;
+        parent: IGLTFNode;
+        babylonMesh: Mesh;
         babylonAnimationTargets?: Node[];
         babylonAnimationTargets?: Node[];
     }
     }
     interface IGLTFSampler extends IGLTFChildRootProperty {
     interface IGLTFSampler extends IGLTFChildRootProperty {
@@ -721,22 +853,29 @@ declare module BABYLON.GLTF2 {
         minFilter?: ETextureMinFilter;
         minFilter?: ETextureMinFilter;
         wrapS?: ETextureWrapMode;
         wrapS?: ETextureWrapMode;
         wrapT?: ETextureWrapMode;
         wrapT?: ETextureWrapMode;
+        index: number;
+        noMipMaps: boolean;
+        samplingMode: number;
+        wrapU: number;
+        wrapV: number;
     }
     }
     interface IGLTFScene extends IGLTFChildRootProperty {
     interface IGLTFScene extends IGLTFChildRootProperty {
         nodes: number[];
         nodes: number[];
+        index: number;
     }
     }
     interface IGLTFSkin extends IGLTFChildRootProperty {
     interface IGLTFSkin extends IGLTFChildRootProperty {
         inverseBindMatrices?: number;
         inverseBindMatrices?: number;
         skeleton?: number;
         skeleton?: number;
         joints: number[];
         joints: number[];
-        index?: number;
-        babylonSkeleton?: Skeleton;
+        index: number;
+        babylonSkeleton: Skeleton;
     }
     }
     interface IGLTFTexture extends IGLTFChildRootProperty {
     interface IGLTFTexture extends IGLTFChildRootProperty {
         sampler?: number;
         sampler?: number;
         source: number;
         source: number;
-        babylonTextures?: Texture[];
-        blobURL?: string;
+        index: number;
+        url?: string;
+        dataReadyObservable?: Observable<IGLTFTexture>;
     }
     }
     interface IGLTFTextureInfo {
     interface IGLTFTextureInfo {
         index: number;
         index: number;
@@ -751,7 +890,6 @@ declare module BABYLON.GLTF2 {
         cameras?: IGLTFCamera[];
         cameras?: IGLTFCamera[];
         extensionsUsed?: string[];
         extensionsUsed?: string[];
         extensionsRequired?: string[];
         extensionsRequired?: string[];
-        glExtensionsUsed?: string[];
         images?: IGLTFImage[];
         images?: IGLTFImage[];
         materials?: IGLTFMaterial[];
         materials?: IGLTFMaterial[];
         meshes?: IGLTFMesh[];
         meshes?: IGLTFMesh[];
@@ -767,62 +905,104 @@ declare module BABYLON.GLTF2 {
 
 
 declare module BABYLON.GLTF2 {
 declare module BABYLON.GLTF2 {
     class GLTFLoader implements IGLTFLoader {
     class GLTFLoader implements IGLTFLoader {
+        _gltf: IGLTF;
+        _babylonScene: Scene;
+        private _disposed;
         private _parent;
         private _parent;
-        private _gltf;
-        private _errors;
-        private _babylonScene;
         private _rootUrl;
         private _rootUrl;
         private _defaultMaterial;
         private _defaultMaterial;
-        private _onSuccess;
-        private _onError;
+        private _defaultSampler;
+        private _rootNode;
+        private _successCallback;
+        private _progressCallback;
+        private _errorCallback;
         private _renderReady;
         private _renderReady;
+        private _requests;
+        private _renderReadyObservable;
         private _renderPendingCount;
         private _renderPendingCount;
         private _loaderPendingCount;
         private _loaderPendingCount;
+        private _loaderTrackers;
         static Extensions: {
         static Extensions: {
             [name: string]: GLTFLoaderExtension;
             [name: string]: GLTFLoaderExtension;
         };
         };
         static RegisterExtension(extension: GLTFLoaderExtension): void;
         static RegisterExtension(extension: GLTFLoaderExtension): void;
-        readonly gltf: IGLTF;
-        readonly babylonScene: Scene;
+        private static _progressEventFactory;
+        private static _createProgressEventByConstructor(name, data);
+        private static _createProgressEventByDocument(name, data);
         constructor(parent: GLTFFileLoader);
         constructor(parent: GLTFFileLoader);
-        importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onError: () => void): void;
-        loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onError: () => void): void;
-        private _loadAsync(nodeNames, scene, data, rootUrl, onSuccess, onError);
+        dispose(): void;
+        importMeshAsync(meshesNames: any, scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
+        loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onSuccess: () => void, onProgress: (event: ProgressEvent) => void, onError: (message: string) => void): void;
+        private _loadAsync(nodeNames, scene, data, rootUrl, onSuccess, onProgress, onError);
+        private _onProgress();
+        _executeWhenRenderReady(func: () => void): void;
         private _onRenderReady();
         private _onRenderReady();
-        private _onLoaderComplete();
+        private _onComplete();
         private _loadData(data);
         private _loadData(data);
-        private _showMeshes();
+        private _getMeshes();
+        private _getSkeletons();
         private _startAnimations();
         private _startAnimations();
-        private _clear();
-        private _loadScene(nodeNames);
-        private _loadSkin(node);
-        private _updateBone(node, parentNode, skin, inverseBindMatrixData);
-        private _createBone(node, skin);
-        private _loadMesh(node);
-        private _loadMeshData(node, mesh, babylonMesh);
-        private _assignMaterial(multiMaterial, index, subMaterial);
-        private _loadVertexDataAsync(primitive, onSuccess);
-        private _createMorphTargets(node, mesh, primitive, babylonMesh);
-        private _loadMorphTargetsData(mesh, primitive, vertexData, babylonMesh);
-        private _loadTransform(node, babylonMesh);
-        private _traverseNodes(indices, action, parentNode?);
-        private _traverseNode(index, action, parentNode?);
+        private _loadDefaultScene(nodeNames);
+        private _loadScene(context, scene, nodeNames);
+        _loadNode(context: string, node: IGLTFNode): void;
+        private _loadMesh(context, node, mesh);
+        private _loadAllVertexDataAsync(context, mesh, onSuccess);
+        /**
+         * Converts a data bufferview into a Float4 Texture Coordinate Array, based on the accessor component type
+         * @param {ArrayBufferView} data
+         * @param {IGLTFAccessor} accessor
+         */
+        private _convertToFloat4TextureCoordArray(context, data, accessor);
+        /**
+         * Converts a data bufferview into a Float4 Color Array, based on the accessor component type
+         * @param {ArrayBufferView} data
+         * @param {IGLTFAccessor} accessor
+         */
+        private _convertToFloat4ColorArray(context, data, accessor);
+        private _loadVertexDataAsync(context, mesh, primitive, onSuccess);
+        private _createMorphTargets(context, node, mesh);
+        private _loadMorphTargets(context, node, mesh);
+        private _loadAllMorphTargetVertexDataAsync(context, node, mesh, onSuccess);
+        private _loadMorphTargetVertexDataAsync(context, vertexData, attributes, onSuccess);
+        private _loadTransform(node);
+        private _loadSkinAsync(context, skin, onSuccess);
+        private _createBone(node, skin, parent, localMatrix, baseMatrix, index);
+        private _loadBones(context, skin, inverseBindMatrixData);
+        private _loadBone(node, skin, inverseBindMatrixData, babylonBones);
+        private _getNodeMatrix(node);
+        private _traverseNodes(context, indices, action, parentNode);
+        _traverseNode(context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): void;
         private _loadAnimations();
         private _loadAnimations();
-        private _loadAnimationChannel(animation, animationIndex, channelIndex);
-        private _loadBufferAsync(index, onSuccess);
-        private _loadBufferViewAsync(bufferView, byteOffset, byteLength, componentType, onSuccess);
-        private _loadAccessorAsync(accessor, onSuccess);
-        addPendingData(data: any): void;
-        removePendingData(data: any): void;
-        addLoaderPendingData(data: any): void;
-        removeLoaderPendingData(data: any): void;
+        private _loadAnimation(context, animation);
+        private _loadAnimationChannel(animation, channelContext, channel, samplerContext, sampler);
+        private _loadBufferAsync(context, buffer, onSuccess);
+        private _loadBufferViewAsync(context, bufferView, onSuccess);
+        private _loadAccessorAsync(context, accessor, onSuccess);
+        private _buildArrayBuffer<T>(typedArray, data, byteOffset, count, numComponents, byteStride?);
+        _addPendingData(data: any): void;
+        _removePendingData(data: any): void;
+        _addLoaderPendingData(data: any): void;
+        _removeLoaderPendingData(data: any): void;
+        _whenAction(action: () => void, onComplete: () => void): void;
         private _getDefaultMaterial();
         private _getDefaultMaterial();
-        private _loadMaterialMetallicRoughnessProperties(material);
-        loadMaterial(index: number, assign: (material: Material) => void): void;
-        createPbrMaterial(material: IGLTFMaterial): void;
-        loadMaterialBaseProperties(material: IGLTFMaterial): void;
-        loadMaterialAlphaProperties(material: IGLTFMaterial): void;
-        loadTexture(textureInfo: IGLTFTextureInfo): Texture;
+        private _loadMaterialMetallicRoughnessProperties(context, material);
+        _loadMaterial(context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): void;
+        _createPbrMaterial(material: IGLTFMaterial): void;
+        _loadMaterialBaseProperties(context: string, material: IGLTFMaterial): void;
+        _loadMaterialAlphaProperties(context: string, material: IGLTFMaterial, colorFactor: number[]): void;
+        _loadTexture(context: string, texture: IGLTFTexture, coordinatesIndex?: number): Texture;
+        private _loadSampler(context, sampler);
+        private _loadImageAsync(context, image, onSuccess);
+        _loadUriAsync(context: string, uri: string, onSuccess: (data: ArrayBufferView) => void): void;
+        _tryCatchOnError(handler: () => void): void;
+        private static _AssignIndices(array?);
+        static _GetProperty<T extends IGLTFProperty>(array?: ArrayLike<T>, index?: number): Nullable<T>;
+        private static _GetTextureWrapMode(context, mode?);
+        private static _GetTextureSamplingMode(context, magFilter?, minFilter?);
+        private static _GetNumComponents(context, type);
+        private _compileMaterialAsync(babylonMaterial, babylonMesh, onSuccess);
+        private _compileMaterialsAsync(onSuccess);
+        private _compileShadowGeneratorsAsync(onSuccess);
     }
     }
 }
 }
 
 
@@ -842,27 +1022,7 @@ declare module BABYLON.GLTF2 {
         * @param uri: the uri to decode
         * @param uri: the uri to decode
         */
         */
         static DecodeBase64(uri: string): ArrayBuffer;
         static DecodeBase64(uri: string): ArrayBuffer;
-        static ForEach(view: Uint16Array | Uint32Array | Float32Array, func: (nvalue: number, index: number) => void): void;
-        /**
-        * Returns the wrap mode of the texture
-        * @param mode: the mode value
-        */
-        static GetWrapMode(mode: number): number;
-        /**
-         * Returns the byte stride giving an accessor
-         * @param accessor: the GLTF accessor objet
-         */
-        static GetByteStrideFromType(accessor: IGLTFAccessor): number;
-        /**
-         * Returns the texture filter mode giving a mode value
-         * @param mode: the filter mode value
-         */
-        static GetTextureFilterMode(mode: number): ETextureMinFilter;
-        /**
-         * Decodes a buffer view into a string
-         * @param view: the buffer view
-         */
-        static DecodeBufferToText(view: ArrayBufferView): string;
+        static ValidateUri(uri: string): boolean;
     }
     }
 }
 }
 
 
@@ -871,9 +1031,14 @@ declare module BABYLON.GLTF2 {
     abstract class GLTFLoaderExtension {
     abstract class GLTFLoaderExtension {
         enabled: boolean;
         enabled: boolean;
         readonly abstract name: string;
         readonly abstract name: string;
-        protected loadMaterial(loader: GLTFLoader, material: IGLTFMaterial, assign: (material: Material) => void): boolean;
+        protected _traverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
+        protected _loadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
+        protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
+        protected _loadExtension<T>(context: string, property: IGLTFProperty, action: (context: string, extension: T, onComplete: () => void) => void): boolean;
         static _Extensions: GLTFLoaderExtension[];
         static _Extensions: GLTFLoaderExtension[];
-        static LoadMaterial(loader: GLTFLoader, material: IGLTFMaterial, assign: (material: Material) => void): boolean;
+        static TraverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
+        static LoadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
+        static LoadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
         private static _ApplyExtensions(action);
         private static _ApplyExtensions(action);
     }
     }
 }
 }
@@ -881,9 +1046,16 @@ declare module BABYLON.GLTF2 {
 
 
 declare module BABYLON.GLTF2.Extensions {
 declare module BABYLON.GLTF2.Extensions {
     class MSFTLOD extends GLTFLoaderExtension {
     class MSFTLOD extends GLTFLoaderExtension {
+        /**
+         * Specify the minimal delay between LODs in ms (default = 250)
+         */
+        Delay: number;
         readonly name: string;
         readonly name: string;
-        protected loadMaterial(loader: GLTFLoader, material: IGLTFMaterial, assign: (material: Material) => void): boolean;
-        private loadMaterialLOD(loader, material, materialLODs, lod, assign);
+        protected _traverseNode(loader: GLTFLoader, context: string, node: IGLTFNode, action: (node: IGLTFNode, parentNode: IGLTFNode) => boolean, parentNode: IGLTFNode): boolean;
+        protected _loadNode(loader: GLTFLoader, context: string, node: IGLTFNode): boolean;
+        private _loadNodeLOD(loader, context, nodes, index, onComplete);
+        protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
+        private _loadMaterialLOD(loader, context, materials, index, assign, onComplete);
     }
     }
 }
 }
 
 
@@ -891,7 +1063,7 @@ declare module BABYLON.GLTF2.Extensions {
 declare module BABYLON.GLTF2.Extensions {
 declare module BABYLON.GLTF2.Extensions {
     class KHRMaterialsPbrSpecularGlossiness extends GLTFLoaderExtension {
     class KHRMaterialsPbrSpecularGlossiness extends GLTFLoaderExtension {
         readonly name: string;
         readonly name: string;
-        protected loadMaterial(loader: GLTFLoader, material: IGLTFMaterial, assign: (material: Material) => void): boolean;
-        private _loadSpecularGlossinessProperties(loader, material, properties);
+        protected _loadMaterial(loader: GLTFLoader, context: string, material: IGLTFMaterial, assign: (babylonMaterial: Material, isNew: boolean) => void): boolean;
+        private _loadSpecularGlossinessProperties(loader, context, material, properties);
     }
     }
 }
 }

File diff suppressed because it is too large
+ 1737 - 891
dist/loaders/babylon.glTFFileLoader.js


File diff suppressed because it is too large
+ 3 - 2
dist/loaders/babylon.glTFFileLoader.min.js


+ 3 - 2
dist/loaders/babylon.objFileLoader.d.ts

@@ -15,7 +15,7 @@ declare module BABYLON {
          * @param data
          * @param data
          * @param rootUrl
          * @param rootUrl
          */
          */
-        parseMTL: (scene: Scene, data: string, rootUrl: string) => void;
+        parseMTL(scene: BABYLON.Scene, data: string, rootUrl: string): void;
         /**
         /**
          * Gets the texture for the material.
          * Gets the texture for the material.
          *
          *
@@ -30,6 +30,7 @@ declare module BABYLON {
     }
     }
     class OBJFileLoader implements ISceneLoaderPlugin {
     class OBJFileLoader implements ISceneLoaderPlugin {
         static OPTIMIZE_WITH_UV: boolean;
         static OPTIMIZE_WITH_UV: boolean;
+        name: string;
         extensions: string;
         extensions: string;
         obj: RegExp;
         obj: RegExp;
         group: RegExp;
         group: RegExp;
@@ -55,7 +56,7 @@ declare module BABYLON {
          * @private
          * @private
          */
          */
         private _loadMTL(url, rootUrl, onSuccess);
         private _loadMTL(url, rootUrl, onSuccess);
-        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]): boolean;
+        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: Nullable<AbstractMesh[]>, particleSystems: Nullable<ParticleSystem[]>, skeletons: Nullable<Skeleton[]>): boolean;
         load(scene: Scene, data: string, rootUrl: string): boolean;
         load(scene: Scene, data: string, rootUrl: string): boolean;
         /**
         /**
          * Read the OBJ file and create an Array of meshes.
          * Read the OBJ file and create an Array of meshes.

+ 156 - 145
dist/loaders/babylon.objFileLoader.js

@@ -4,164 +4,171 @@ var BABYLON;
     /**
     /**
      * Class reading and parsing the MTL file bundled with the obj file.
      * Class reading and parsing the MTL file bundled with the obj file.
      */
      */
-    var MTLFileLoader = (function () {
+    var MTLFileLoader = /** @class */ (function () {
         function MTLFileLoader() {
         function MTLFileLoader() {
             // All material loaded from the mtl will be set here
             // All material loaded from the mtl will be set here
             this.materials = [];
             this.materials = [];
-            /**
-             * This function will read the mtl file and create each material described inside
-             * This function could be improve by adding :
-             * -some component missing (Ni, Tf...)
-             * -including the specific options available
-             *
-             * @param scene
-             * @param data
-             * @param rootUrl
-             */
-            this.parseMTL = function (scene, data, rootUrl) {
-                //Split the lines from the file
-                var lines = data.split('\n');
-                //Space char
-                var delimiter_pattern = /\s+/;
-                //Array with RGB colors
-                var color;
-                //New material
-                var material;
-                //Look at each line
-                for (var i = 0; i < lines.length; i++) {
-                    var line = lines[i].trim();
-                    // Blank line or comment
-                    if (line.length === 0 || line.charAt(0) === '#') {
-                        continue;
-                    }
-                    //Get the first parameter (keyword)
-                    var pos = line.indexOf(' ');
-                    var key = (pos >= 0) ? line.substring(0, pos) : line;
-                    key = key.toLowerCase();
-                    //Get the data following the key
-                    var value = (pos >= 0) ? line.substring(pos + 1).trim() : "";
-                    //This mtl keyword will create the new material
-                    if (key === "newmtl") {
-                        //Check if it is the first material.
-                        // Materials specifications are described after this keyword.
-                        if (material) {
-                            //Add the previous material in the material array.
-                            this.materials.push(material);
-                        }
-                        //Create a new material.
-                        // value is the name of the material read in the mtl file
-                        material = new BABYLON.StandardMaterial(value, scene);
-                    }
-                    else if (key === "kd") {
-                        // Diffuse color (color under white light) using RGB values
-                        //value  = "r g b"
-                        color = value.split(delimiter_pattern, 3);
-                        //color = [r,g,b]
-                        //Set tghe color into the material
-                        material.diffuseColor = BABYLON.Color3.FromArray(color);
-                    }
-                    else if (key === "ka") {
-                        // Ambient color (color under shadow) using RGB values
-                        //value = "r g b"
-                        color = value.split(delimiter_pattern, 3);
-                        //color = [r,g,b]
-                        //Set tghe color into the material
-                        material.ambientColor = BABYLON.Color3.FromArray(color);
+        }
+        /**
+         * This function will read the mtl file and create each material described inside
+         * This function could be improve by adding :
+         * -some component missing (Ni, Tf...)
+         * -including the specific options available
+         *
+         * @param scene
+         * @param data
+         * @param rootUrl
+         */
+        MTLFileLoader.prototype.parseMTL = function (scene, data, rootUrl) {
+            //Split the lines from the file
+            var lines = data.split('\n');
+            //Space char
+            var delimiter_pattern = /\s+/;
+            //Array with RGB colors
+            var color;
+            //New material
+            var material = null;
+            //Look at each line
+            for (var i = 0; i < lines.length; i++) {
+                var line = lines[i].trim();
+                // Blank line or comment
+                if (line.length === 0 || line.charAt(0) === '#') {
+                    continue;
+                }
+                //Get the first parameter (keyword)
+                var pos = line.indexOf(' ');
+                var key = (pos >= 0) ? line.substring(0, pos) : line;
+                key = key.toLowerCase();
+                //Get the data following the key
+                var value = (pos >= 0) ? line.substring(pos + 1).trim() : "";
+                //This mtl keyword will create the new material
+                if (key === "newmtl") {
+                    //Check if it is the first material.
+                    // Materials specifications are described after this keyword.
+                    if (material) {
+                        //Add the previous material in the material array.
+                        this.materials.push(material);
                     }
                     }
-                    else if (key === "ks") {
-                        // Specular color (color when light is reflected from shiny surface) using RGB values
-                        //value = "r g b"
-                        color = value.split(delimiter_pattern, 3);
-                        //color = [r,g,b]
-                        //Set the color into the material
-                        material.specularColor = BABYLON.Color3.FromArray(color);
+                    //Create a new material.
+                    // value is the name of the material read in the mtl file
+                    material = new BABYLON.StandardMaterial(value, scene);
+                }
+                else if (key === "kd" && material) {
+                    // Diffuse color (color under white light) using RGB values
+                    //value  = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set tghe color into the material
+                    material.diffuseColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ka" && material) {
+                    // Ambient color (color under shadow) using RGB values
+                    //value = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set tghe color into the material
+                    material.ambientColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ks" && material) {
+                    // Specular color (color when light is reflected from shiny surface) using RGB values
+                    //value = "r g b"
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    //color = [r,g,b]
+                    //Set the color into the material
+                    material.specularColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ke" && material) {
+                    // Emissive color using RGB values
+                    color = value.split(delimiter_pattern, 3).map(parseFloat);
+                    material.emissiveColor = BABYLON.Color3.FromArray(color);
+                }
+                else if (key === "ns" && material) {
+                    //value = "Integer"
+                    material.specularPower = parseFloat(value);
+                }
+                else if (key === "d" && material) {
+                    //d is dissolve for current material. It mean alpha for BABYLON
+                    material.alpha = parseFloat(value);
+                    //Texture
+                    //This part can be improved by adding the possible options of texture
+                }
+                else if (key === "map_ka" && material) {
+                    // ambient texture map with a loaded image
+                    //We must first get the folder of the image
+                    material.ambientTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_kd" && material) {
+                    // Diffuse texture map with a loaded image
+                    material.diffuseTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_ks" && material) {
+                    // Specular texture map with a loaded image
+                    //We must first get the folder of the image
+                    material.specularTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_ns") {
+                    //Specular
+                    //Specular highlight component
+                    //We must first get the folder of the image
+                    //
+                    //Not supported by BABYLON
+                    //
+                    //    continue;
+                }
+                else if (key === "map_bump" && material) {
+                    //The bump texture
+                    material.bumpTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                }
+                else if (key === "map_d" && material) {
+                    // The dissolve of the material
+                    material.opacityTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    //Options for illumination
+                }
+                else if (key === "illum") {
+                    //Illumination
+                    if (value === "0") {
+                        //That mean Kd == Kd
                     }
                     }
-                    else if (key === "ns") {
-                        //value = "Integer"
-                        material.specularPower = value;
+                    else if (value === "1") {
+                        //Color on and Ambient on
                     }
                     }
-                    else if (key === "d") {
-                        //d is dissolve for current material. It mean alpha for BABYLON
-                        material.alpha = value;
-                        //Texture
-                        //This part can be improved by adding the possible options of texture
+                    else if (value === "2") {
+                        //Highlight on
                     }
                     }
-                    else if (key === "map_ka") {
-                        // ambient texture map with a loaded image
-                        //We must first get the folder of the image
-                        material.ambientTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    else if (value === "3") {
+                        //Reflection on and Ray trace on
                     }
                     }
-                    else if (key === "map_kd") {
-                        // Diffuse texture map with a loaded image
-                        material.diffuseTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    else if (value === "4") {
+                        //Transparency: Glass on, Reflection: Ray trace on
                     }
                     }
-                    else if (key === "map_ks") {
-                        // Specular texture map with a loaded image
-                        //We must first get the folder of the image
-                        material.specularTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    else if (value === "5") {
+                        //Reflection: Fresnel on and Ray trace on
                     }
                     }
-                    else if (key === "map_ns") {
-                        //Specular
-                        //Specular highlight component
-                        //We must first get the folder of the image
-                        //
-                        //Not supported by BABYLON
-                        //
-                        //    continue;
+                    else if (value === "6") {
+                        //Transparency: Refraction on, Reflection: Fresnel off and Ray trace on
                     }
                     }
-                    else if (key === "map_bump") {
-                        //The bump texture
-                        material.bumpTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
+                    else if (value === "7") {
+                        //Transparency: Refraction on, Reflection: Fresnel on and Ray trace on
                     }
                     }
-                    else if (key === "map_d") {
-                        // The dissolve of the material
-                        material.opacityTexture = MTLFileLoader._getTexture(rootUrl, value, scene);
-                        //Options for illumination
+                    else if (value === "8") {
+                        //Reflection on and Ray trace off
                     }
                     }
-                    else if (key === "illum") {
-                        //Illumination
-                        if (value === "0") {
-                            //That mean Kd == Kd
-                        }
-                        else if (value === "1") {
-                            //Color on and Ambient on
-                        }
-                        else if (value === "2") {
-                            //Highlight on
-                        }
-                        else if (value === "3") {
-                            //Reflection on and Ray trace on
-                        }
-                        else if (value === "4") {
-                            //Transparency: Glass on, Reflection: Ray trace on
-                        }
-                        else if (value === "5") {
-                            //Reflection: Fresnel on and Ray trace on
-                        }
-                        else if (value === "6") {
-                            //Transparency: Refraction on, Reflection: Fresnel off and Ray trace on
-                        }
-                        else if (value === "7") {
-                            //Transparency: Refraction on, Reflection: Fresnel on and Ray trace on
-                        }
-                        else if (value === "8") {
-                            //Reflection on and Ray trace off
-                        }
-                        else if (value === "9") {
-                            //Transparency: Glass on, Reflection: Ray trace off
-                        }
-                        else if (value === "10") {
-                            //Casts shadows onto invisible surfaces
-                        }
+                    else if (value === "9") {
+                        //Transparency: Glass on, Reflection: Ray trace off
                     }
                     }
-                    else {
-                        // console.log("Unhandled expression at line : " + i +'\n' + "with value : " + line);
+                    else if (value === "10") {
+                        //Casts shadows onto invisible surfaces
                     }
                     }
                 }
                 }
-                //At the end of the file, add the last material
+                else {
+                    // console.log("Unhandled expression at line : " + i +'\n' + "with value : " + line);
+                }
+            }
+            //At the end of the file, add the last material
+            if (material) {
                 this.materials.push(material);
                 this.materials.push(material);
-            };
-        }
+            }
+        };
         /**
         /**
          * Gets the texture for the material.
          * Gets the texture for the material.
          *
          *
@@ -173,6 +180,9 @@ var BABYLON;
          * @return The Texture
          * @return The Texture
          */
          */
         MTLFileLoader._getTexture = function (rootUrl, value, scene) {
         MTLFileLoader._getTexture = function (rootUrl, value, scene) {
+            if (!value) {
+                return null;
+            }
             var url = rootUrl;
             var url = rootUrl;
             // Load from input file.
             // Load from input file.
             if (rootUrl === "file:") {
             if (rootUrl === "file:") {
@@ -195,8 +205,9 @@ var BABYLON;
         return MTLFileLoader;
         return MTLFileLoader;
     }());
     }());
     BABYLON.MTLFileLoader = MTLFileLoader;
     BABYLON.MTLFileLoader = MTLFileLoader;
-    var OBJFileLoader = (function () {
+    var OBJFileLoader = /** @class */ (function () {
         function OBJFileLoader() {
         function OBJFileLoader() {
+            this.name = "obj";
             this.extensions = ".obj";
             this.extensions = ".obj";
             this.obj = /^o/;
             this.obj = /^o/;
             this.group = /^g/;
             this.group = /^g/;
@@ -232,7 +243,7 @@ var BABYLON;
             //The complete path to the mtl file
             //The complete path to the mtl file
             var pathOfFile = BABYLON.Tools.BaseUrl + rootUrl + url;
             var pathOfFile = BABYLON.Tools.BaseUrl + rootUrl + url;
             // Loads through the babylon tools to allow fileInput search.
             // Loads through the babylon tools to allow fileInput search.
-            BABYLON.Tools.LoadFile(pathOfFile, onSuccess, null, null, false, function () { console.warn("Error - Unable to load " + pathOfFile); });
+            BABYLON.Tools.LoadFile(pathOfFile, onSuccess, undefined, undefined, false, function () { console.warn("Error - Unable to load " + pathOfFile); });
         };
         };
         OBJFileLoader.prototype.importMesh = function (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons) {
         OBJFileLoader.prototype.importMesh = function (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons) {
             //get the meshes from OBJ file
             //get the meshes from OBJ file
@@ -693,7 +704,7 @@ var BABYLON;
             }
             }
             //Create a BABYLON.Mesh list
             //Create a BABYLON.Mesh list
             var babylonMeshesArray = []; //The mesh for babylon
             var babylonMeshesArray = []; //The mesh for babylon
-            var materialToUse = [];
+            var materialToUse = new Array();
             //Set data for each mesh
             //Set data for each mesh
             for (var j = 0; j < meshesFromObj.length; j++) {
             for (var j = 0; j < meshesFromObj.length; j++) {
                 //check meshesNames (stlFileLoader)
                 //check meshesNames (stlFileLoader)
@@ -765,9 +776,9 @@ var BABYLON;
             //Return an array with all BABYLON.Mesh
             //Return an array with all BABYLON.Mesh
             return babylonMeshesArray;
             return babylonMeshesArray;
         };
         };
+        OBJFileLoader.OPTIMIZE_WITH_UV = false;
         return OBJFileLoader;
         return OBJFileLoader;
     }());
     }());
-    OBJFileLoader.OPTIMIZE_WITH_UV = false;
     BABYLON.OBJFileLoader = OBJFileLoader;
     BABYLON.OBJFileLoader = OBJFileLoader;
     if (BABYLON.SceneLoader) {
     if (BABYLON.SceneLoader) {
         //Add this loader into the register plugin
         //Add this loader into the register plugin

File diff suppressed because it is too large
+ 1 - 1
dist/loaders/babylon.objFileLoader.min.js


+ 2 - 1
dist/loaders/babylon.stlFileLoader.d.ts

@@ -5,8 +5,9 @@ declare module BABYLON {
         facetsPattern: RegExp;
         facetsPattern: RegExp;
         normalPattern: RegExp;
         normalPattern: RegExp;
         vertexPattern: RegExp;
         vertexPattern: RegExp;
+        name: string;
         extensions: ISceneLoaderPluginExtensions;
         extensions: ISceneLoaderPluginExtensions;
-        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]): boolean;
+        importMesh(meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: Nullable<AbstractMesh[]>, particleSystems: Nullable<ParticleSystem[]>, skeletons: Nullable<Skeleton[]>): boolean;
         load(scene: Scene, data: any, rootUrl: string): boolean;
         load(scene: Scene, data: any, rootUrl: string): boolean;
         private isBinary(data);
         private isBinary(data);
         private parseBinary(mesh, data);
         private parseBinary(mesh, data);

+ 3 - 2
dist/loaders/babylon.stlFileLoader.js

@@ -1,12 +1,13 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
-    var STLFileLoader = (function () {
+    var STLFileLoader = /** @class */ (function () {
         function STLFileLoader() {
         function STLFileLoader() {
             this.solidPattern = /solid (\S*)([\S\s]*)endsolid[ ]*(\S*)/g;
             this.solidPattern = /solid (\S*)([\S\s]*)endsolid[ ]*(\S*)/g;
             this.facetsPattern = /facet([\s\S]*?)endfacet/g;
             this.facetsPattern = /facet([\s\S]*?)endfacet/g;
             this.normalPattern = /normal[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
             this.normalPattern = /normal[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
             this.vertexPattern = /vertex[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
             this.vertexPattern = /vertex[\s]+([\-+]?[0-9]+\.?[0-9]*([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+[\s]+([\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?)+/g;
+            this.name = "stl";
             // force data to come in as an ArrayBuffer
             // force data to come in as an ArrayBuffer
             // we'll convert to string if it looks like it's an ASCII .stl
             // we'll convert to string if it looks like it's an ASCII .stl
             this.extensions = {
             this.extensions = {
@@ -81,7 +82,7 @@ var BABYLON;
             // check characters higher than ASCII to confirm binary
             // check characters higher than ASCII to confirm binary
             var fileLength = reader.byteLength;
             var fileLength = reader.byteLength;
             for (var index = 0; index < fileLength; index++) {
             for (var index = 0; index < fileLength; index++) {
-                if (reader.getUint8(index, false) > 127) {
+                if (reader.getUint8(index) > 127) {
                     return true;
                     return true;
                 }
                 }
             }
             }

File diff suppressed because it is too large
+ 1 - 1
dist/loaders/babylon.stlFileLoader.min.js


File diff suppressed because it is too large
+ 5394 - 0
dist/loaders/babylonjs.loaders.js


File diff suppressed because it is too large
+ 3 - 0
dist/loaders/babylonjs.loaders.min.js


File diff suppressed because it is too large
+ 1167 - 0
dist/loaders/babylonjs.loaders.module.d.ts


+ 37 - 0
dist/loaders/package.json

@@ -0,0 +1,37 @@
+{
+    "author": {
+        "name": "David CATUHE"
+    },
+    "name": "babylonjs-loaders",
+    "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
+    "version": "3.1.0",
+    "repository": {
+        "type": "git",
+        "url": "https://github.com/BabylonJS/Babylon.js.git"
+    },
+    "main": "babylonjs.loaders.min.js",
+    "files": [
+        "babylonjs.loaders.js",
+        "babylonjs.loaders.min.js",
+        "babylonjs.loaders.module.d.ts",
+        "readme.md",
+        "package.json"
+    ],
+    "typings": "babylonjs.loaders.module.d.ts",
+    "keywords": [
+        "3D",
+        "javascript",
+        "html5",
+        "webgl",
+        "loaders"
+    ],
+    "license": "Apache-2.0",
+    "peerDependencies": {
+        "babylonjs": ">=3.1.0-alpha"
+    },
+    "engines": {
+        "node": "*"
+    },
+    "_id": "babylonjs-loaders@3.1.0-alpha1",
+    "_from": "babylonjs-loaders@"
+}

+ 44 - 0
dist/loaders/readme.md

@@ -0,0 +1,44 @@
+Babylon.js Loaders module
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/extensions and choose "loaders".
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/loaders/babylonjs.loaders.js
+* https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-loaders
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-loaders",
+        ""
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as BABYLON from 'babylonjs';
+import 'babylonjs-loaders';
+```
+
+This will extend Babylon's namespace with the loaders available.
+
+Using webpack to package your project will use the minified js file.

+ 280 - 0
dist/materialsLibrary/babylon.backgroundMaterial.d.ts

@@ -0,0 +1,280 @@
+
+declare namespace BABYLON {
+    /**
+     * Background material
+     */
+    class BackgroundMaterial extends BABYLON.PushMaterial {
+        /**
+         * Key light Color (multiply against the R channel of the environement texture)
+         */
+        protected _primaryColor: Color3;
+        primaryColor: Color3;
+        /**
+         * Key light Level (allowing HDR output of the background)
+         */
+        protected _primaryLevel: float;
+        primaryLevel: float;
+        /**
+         * Secondary light Color (multiply against the G channel of the environement texture)
+         */
+        protected _secondaryColor: Color3;
+        secondaryColor: Color3;
+        /**
+         * Secondary light Level (allowing HDR output of the background)
+         */
+        protected _secondaryLevel: float;
+        secondaryLevel: float;
+        /**
+         * Tertiary light Color (multiply against the B channel of the environement texture)
+         */
+        protected _tertiaryColor: Color3;
+        tertiaryColor: Color3;
+        /**
+         * Tertiary light Level (allowing HDR output of the background)
+         */
+        protected _tertiaryLevel: float;
+        tertiaryLevel: float;
+        /**
+         * Reflection Texture used in the material.
+         * Should be author in a specific way for the best result (refer to the documentation).
+         */
+        protected _reflectionTexture: Nullable<BaseTexture>;
+        reflectionTexture: Nullable<BaseTexture>;
+        /**
+         * Reflection Texture level of blur.
+         *
+         * Can be use to reuse an existing HDR Texture and target a specific LOD to prevent authoring the
+         * texture twice.
+         */
+        protected _reflectionBlur: float;
+        reflectionBlur: float;
+        /**
+         * Diffuse Texture used in the material.
+         * Should be author in a specific way for the best result (refer to the documentation).
+         */
+        protected _diffuseTexture: Nullable<BaseTexture>;
+        diffuseTexture: Nullable<BaseTexture>;
+        /**
+         * Specify the list of lights casting shadow on the material.
+         * All scene shadow lights will be included if null.
+         */
+        protected _shadowLights: Nullable<IShadowLight[]>;
+        shadowLights: Nullable<IShadowLight[]>;
+        /**
+         * For the lights having a blurred shadow generator, this can add a second blur pass in order to reach
+         * soft lighting on the background.
+         */
+        protected _shadowBlurScale: int;
+        shadowBlurScale: int;
+        /**
+         * Helps adjusting the shadow to a softer level if required.
+         * 0 means black shadows and 1 means no shadows.
+         */
+        protected _shadowLevel: float;
+        shadowLevel: float;
+        /**
+         * In case of opacity Fresnel or reflection falloff, this is use as a scene center.
+         * It is usually zero but might be interesting to modify according to your setup.
+         */
+        protected _sceneCenter: Vector3;
+        sceneCenter: Vector3;
+        /**
+         * This helps specifying that the material is falling off to the sky box at grazing angle.
+         * This helps ensuring a nice transition when the camera goes under the ground.
+         */
+        protected _opacityFresnel: boolean;
+        opacityFresnel: boolean;
+        /**
+         * This helps specifying that the material is falling off from diffuse to the reflection texture at grazing angle.
+         * This helps adding a mirror texture on the ground.
+         */
+        protected _reflectionFresnel: boolean;
+        reflectionFresnel: boolean;
+        /**
+         * This helps specifying the falloff radius off the reflection texture from the sceneCenter.
+         * This helps adding a nice falloff effect to the reflection if used as a mirror for instance.
+         */
+        protected _reflectionFalloffDistance: number;
+        reflectionFalloffDistance: number;
+        /**
+         * This specifies the weight of the reflection against the background in case of reflection Fresnel.
+         */
+        protected _reflectionAmount: number;
+        reflectionAmount: number;
+        /**
+         * This specifies the weight of the reflection at grazing angle.
+         */
+        protected _reflectionReflectance0: number;
+        reflectionReflectance0: number;
+        /**
+         * This specifies the weight of the reflection at a perpendicular point of view.
+         */
+        protected _reflectionReflectance90: number;
+        reflectionReflectance90: number;
+        /**
+         * Helps to directly use the maps channels instead of their level.
+         */
+        protected _useRGBColor: boolean;
+        useRGBColor: boolean;
+        /**
+         * Number of Simultaneous lights allowed on the material.
+         */
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: int;
+        /**
+         * Default configuration related to image processing available in the Background Material.
+         */
+        protected _imageProcessingConfiguration: ImageProcessingConfiguration;
+        /**
+         * Keep track of the image processing observer to allow dispose and replace.
+         */
+        private _imageProcessingObserver;
+        /**
+         * Attaches a new image processing configuration to the PBR Material.
+         * @param configuration (if null the scene configuration will be use)
+         */
+        protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void;
+        /**
+         * Gets the image processing configuration used either in this material.
+         */
+        /**
+         * Sets the Default image processing configuration used either in the this material.
+         *
+         * If sets to null, the scene one is in use.
+         */
+        imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>;
+        /**
+         * Gets wether the color curves effect is enabled.
+         */
+        /**
+         * Sets wether the color curves effect is enabled.
+         */
+        cameraColorCurvesEnabled: boolean;
+        /**
+         * Gets wether the color grading effect is enabled.
+         */
+        /**
+         * Gets wether the color grading effect is enabled.
+         */
+        cameraColorGradingEnabled: boolean;
+        /**
+         * Gets wether tonemapping is enabled or not.
+         */
+        /**
+         * Sets wether tonemapping is enabled or not
+         */
+        cameraToneMappingEnabled: boolean;
+        /**
+         * The camera exposure used on this material.
+         * This property is here and not in the camera to allow controlling exposure without full screen post process.
+         * This corresponds to a photographic exposure.
+         */
+        /**
+         * The camera exposure used on this material.
+         * This property is here and not in the camera to allow controlling exposure without full screen post process.
+         * This corresponds to a photographic exposure.
+         */
+        cameraExposure: float;
+        /**
+         * Gets The camera contrast used on this material.
+         */
+        /**
+         * Sets The camera contrast used on this material.
+         */
+        cameraContrast: float;
+        /**
+         * Gets the Color Grading 2D Lookup Texture.
+         */
+        /**
+         * Sets the Color Grading 2D Lookup Texture.
+         */
+        cameraColorGradingTexture: Nullable<BaseTexture>;
+        /**
+         * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
+         * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
+         * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
+         * corresponding to low luminance, medium luminance, and high luminance areas respectively.
+         */
+        /**
+         * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
+         * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
+         * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
+         * corresponding to low luminance, medium luminance, and high luminance areas respectively.
+         */
+        cameraColorCurves: Nullable<ColorCurves>;
+        private _renderTargets;
+        private _reflectionControls;
+        /**
+         * constructor
+         * @param name The name of the material
+         * @param scene The scene to add the material to
+         */
+        constructor(name: string, scene: BABYLON.Scene);
+        /**
+         * The entire material has been created in order to prevent overdraw.
+         * @returns false
+         */
+        needAlphaTesting(): boolean;
+        /**
+         * The entire material has been created in order to prevent overdraw.
+         * @returns true if blending is enable
+         */
+        needAlphaBlending(): boolean;
+        /**
+         * Checks wether the material is ready to be rendered for a given mesh.
+         * @param mesh The mesh to render
+         * @param subMesh The submesh to check against
+         * @param useInstances Specify wether or not the material is used with instances
+         */
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        /**
+         * Build the uniform buffer used in the material.
+         */
+        buildUniformLayout(): void;
+        /**
+         * Unbind the material.
+         */
+        unbind(): void;
+        /**
+         * Bind only the world matrix to the material.
+         * @param world The world matrix to bind.
+         */
+        bindOnlyWorldMatrix(world: Matrix): void;
+        /**
+         * Bind the material for a dedicated submeh (every used meshes will be considered opaque).
+         * @param world The world matrix to bind.
+         * @param subMesh The submesh to bind for.
+         */
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        /**
+         * Dispose the material.
+         * @forceDisposeEffect Force disposal of the associated effect.
+         * @forceDisposeTextures Force disposal of the associated textures.
+         */
+        dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
+        /**
+         * Clones the material.
+         * @name The cloned name.
+         * @returns The cloned material.
+         */
+        clone(name: string): BackgroundMaterial;
+        /**
+         * Serializes the current material to its JSON representation.
+         * @returns The JSON representation.
+         */
+        serialize(): any;
+        /**
+         * Gets the class name of the material
+         * @returns "BackgroundMaterial"
+         */
+        getClassName(): string;
+        /**
+         * Parse a JSON input to create back a background material.
+         * @param source
+         * @param scene
+         * @param rootUrl
+         * @returns the instantiated BackgroundMaterial.
+         */
+        static Parse(source: any, scene: Scene, rootUrl: string): BackgroundMaterial;
+    }
+}

File diff suppressed because it is too large
+ 920 - 0
dist/materialsLibrary/babylon.backgroundMaterial.js


File diff suppressed because it is too large
+ 1 - 0
dist/materialsLibrary/babylon.backgroundMaterial.min.js


+ 2 - 3
dist/materialsLibrary/babylon.cellMaterial.d.ts

@@ -10,19 +10,18 @@ declare module BABYLON {
         disableLighting: boolean;
         disableLighting: boolean;
         private _maxSimultaneousLights;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         private _renderId;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
         getActiveTextures(): BaseTexture[];
         getActiveTextures(): BaseTexture[];
         hasTexture(texture: BaseTexture): boolean;
         hasTexture(texture: BaseTexture): boolean;
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
+        getClassName(): string;
         clone(name: string): CellMaterial;
         clone(name: string): CellMaterial;
         serialize(): any;
         serialize(): any;
         static Parse(source: any, scene: Scene, rootUrl: string): CellMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): CellMaterial;

File diff suppressed because it is too large
+ 41 - 37
dist/materialsLibrary/babylon.cellMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.cellMaterial.min.js


+ 273 - 3
dist/materialsLibrary/babylon.customMaterial.d.ts

@@ -1,5 +1,275 @@
 
 
 declare module BABYLON {
 declare module BABYLON {
+    class StandardMaterialDefines_OldVer extends MaterialDefines implements IImageProcessingConfigurationDefines {
+        DIFFUSE: boolean;
+        AMBIENT: boolean;
+        OPACITY: boolean;
+        OPACITYRGB: boolean;
+        REFLECTION: boolean;
+        EMISSIVE: boolean;
+        SPECULAR: boolean;
+        BUMP: boolean;
+        PARALLAX: boolean;
+        PARALLAXOCCLUSION: boolean;
+        SPECULAROVERALPHA: boolean;
+        CLIPPLANE: boolean;
+        ALPHATEST: boolean;
+        ALPHAFROMDIFFUSE: boolean;
+        POINTSIZE: boolean;
+        FOG: boolean;
+        SPECULARTERM: boolean;
+        DIFFUSEFRESNEL: boolean;
+        OPACITYFRESNEL: boolean;
+        REFLECTIONFRESNEL: boolean;
+        REFRACTIONFRESNEL: boolean;
+        EMISSIVEFRESNEL: boolean;
+        FRESNEL: boolean;
+        NORMAL: boolean;
+        UV1: boolean;
+        UV2: boolean;
+        VERTEXCOLOR: boolean;
+        VERTEXALPHA: boolean;
+        NUM_BONE_INFLUENCERS: number;
+        BonesPerMesh: number;
+        INSTANCES: boolean;
+        GLOSSINESS: boolean;
+        ROUGHNESS: boolean;
+        EMISSIVEASILLUMINATION: boolean;
+        LINKEMISSIVEWITHDIFFUSE: boolean;
+        REFLECTIONFRESNELFROMSPECULAR: boolean;
+        LIGHTMAP: boolean;
+        USELIGHTMAPASSHADOWMAP: boolean;
+        REFLECTIONMAP_3D: boolean;
+        REFLECTIONMAP_SPHERICAL: boolean;
+        REFLECTIONMAP_PLANAR: boolean;
+        REFLECTIONMAP_CUBIC: boolean;
+        REFLECTIONMAP_PROJECTION: boolean;
+        REFLECTIONMAP_SKYBOX: boolean;
+        REFLECTIONMAP_EXPLICIT: boolean;
+        REFLECTIONMAP_EQUIRECTANGULAR: boolean;
+        REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
+        REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
+        INVERTCUBICMAP: boolean;
+        LOGARITHMICDEPTH: boolean;
+        REFRACTION: boolean;
+        REFRACTIONMAP_3D: boolean;
+        REFLECTIONOVERALPHA: boolean;
+        TWOSIDEDLIGHTING: boolean;
+        SHADOWFLOAT: boolean;
+        MORPHTARGETS: boolean;
+        MORPHTARGETS_NORMAL: boolean;
+        MORPHTARGETS_TANGENT: boolean;
+        NUM_MORPH_INFLUENCERS: number;
+        IMAGEPROCESSING: boolean;
+        VIGNETTE: boolean;
+        VIGNETTEBLENDMODEMULTIPLY: boolean;
+        VIGNETTEBLENDMODEOPAQUE: boolean;
+        TONEMAPPING: boolean;
+        CONTRAST: boolean;
+        COLORCURVES: boolean;
+        COLORGRADING: boolean;
+        COLORGRADING3D: boolean;
+        SAMPLER3DGREENDEPTH: boolean;
+        SAMPLER3DBGRMAP: boolean;
+        IMAGEPROCESSINGPOSTPROCESS: boolean;
+        EXPOSURE: boolean;
+        constructor();
+        setReflectionMode(modeToEnable: string): void;
+    }
+    class StandardMaterial_OldVer extends PushMaterial {
+        private _diffuseTexture;
+        diffuseTexture: BaseTexture;
+        private _ambientTexture;
+        ambientTexture: BaseTexture;
+        private _opacityTexture;
+        opacityTexture: BaseTexture;
+        private _reflectionTexture;
+        reflectionTexture: BaseTexture;
+        private _emissiveTexture;
+        emissiveTexture: BaseTexture;
+        private _specularTexture;
+        specularTexture: BaseTexture;
+        private _bumpTexture;
+        bumpTexture: BaseTexture;
+        private _lightmapTexture;
+        lightmapTexture: BaseTexture;
+        private _refractionTexture;
+        refractionTexture: BaseTexture;
+        ambientColor: Color3;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        emissiveColor: Color3;
+        specularPower: number;
+        private _useAlphaFromDiffuseTexture;
+        useAlphaFromDiffuseTexture: boolean;
+        private _useEmissiveAsIllumination;
+        useEmissiveAsIllumination: boolean;
+        private _linkEmissiveWithDiffuse;
+        linkEmissiveWithDiffuse: boolean;
+        private _useSpecularOverAlpha;
+        useSpecularOverAlpha: boolean;
+        private _useReflectionOverAlpha;
+        useReflectionOverAlpha: boolean;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _useParallax;
+        useParallax: boolean;
+        private _useParallaxOcclusion;
+        useParallaxOcclusion: boolean;
+        parallaxScaleBias: number;
+        private _roughness;
+        roughness: number;
+        indexOfRefraction: number;
+        invertRefractionY: boolean;
+        private _useLightmapAsShadowmap;
+        useLightmapAsShadowmap: boolean;
+        private _diffuseFresnelParameters;
+        diffuseFresnelParameters: FresnelParameters;
+        private _opacityFresnelParameters;
+        opacityFresnelParameters: FresnelParameters;
+        private _reflectionFresnelParameters;
+        reflectionFresnelParameters: FresnelParameters;
+        private _refractionFresnelParameters;
+        refractionFresnelParameters: FresnelParameters;
+        private _emissiveFresnelParameters;
+        emissiveFresnelParameters: FresnelParameters;
+        private _useReflectionFresnelFromSpecular;
+        useReflectionFresnelFromSpecular: boolean;
+        private _useGlossinessFromSpecularMapAlpha;
+        useGlossinessFromSpecularMapAlpha: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        /**
+         * If sets to true, x component of normal map value will invert (x = 1.0 - x).
+         */
+        private _invertNormalMapX;
+        invertNormalMapX: boolean;
+        /**
+         * If sets to true, y component of normal map value will invert (y = 1.0 - y).
+         */
+        private _invertNormalMapY;
+        invertNormalMapY: boolean;
+        /**
+         * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
+         */
+        private _twoSidedLighting;
+        twoSidedLighting: boolean;
+        /**
+         * Default configuration related to image processing available in the standard Material.
+         */
+        protected _imageProcessingConfiguration: ImageProcessingConfiguration;
+        /**
+         * Gets the image processing configuration used either in this material.
+         */
+        /**
+         * Sets the Default image processing configuration used either in the this material.
+         *
+         * If sets to null, the scene one is in use.
+         */
+        imageProcessingConfiguration: ImageProcessingConfiguration;
+        /**
+         * Keep track of the image processing observer to allow dispose and replace.
+         */
+        private _imageProcessingObserver;
+        /**
+         * Attaches a new image processing configuration to the Standard Material.
+         * @param configuration
+         */
+        protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void;
+        /**
+         * Gets wether the color curves effect is enabled.
+         */
+        /**
+         * Sets wether the color curves effect is enabled.
+         */
+        cameraColorCurvesEnabled: boolean;
+        /**
+         * Gets wether the color grading effect is enabled.
+         */
+        /**
+         * Gets wether the color grading effect is enabled.
+         */
+        cameraColorGradingEnabled: boolean;
+        /**
+         * Gets wether tonemapping is enabled or not.
+         */
+        /**
+         * Sets wether tonemapping is enabled or not
+         */
+        cameraToneMappingEnabled: boolean;
+        /**
+         * The camera exposure used on this material.
+         * This property is here and not in the camera to allow controlling exposure without full screen post process.
+         * This corresponds to a photographic exposure.
+         */
+        /**
+         * The camera exposure used on this material.
+         * This property is here and not in the camera to allow controlling exposure without full screen post process.
+         * This corresponds to a photographic exposure.
+         */
+        cameraExposure: number;
+        /**
+         * Gets The camera contrast used on this material.
+         */
+        /**
+         * Sets The camera contrast used on this material.
+         */
+        cameraContrast: number;
+        /**
+         * Gets the Color Grading 2D Lookup Texture.
+         */
+        /**
+         * Sets the Color Grading 2D Lookup Texture.
+         */
+        cameraColorGradingTexture: Nullable<BaseTexture>;
+        customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer) => string;
+        protected _renderTargets: SmartArray<RenderTargetTexture>;
+        protected _worldViewProjectionMatrix: Matrix;
+        protected _globalAmbientColor: Color3;
+        protected _useLogarithmicDepth: boolean;
+        constructor(name: string, scene: Scene);
+        getClassName(): string;
+        useLogarithmicDepth: boolean;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        protected _shouldUseAlphaFromDiffuseTexture(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        /**
+         * Child classes can use it to update shaders
+         */
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        buildUniformLayout(): void;
+        unbind(): void;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
+        clone(name: string): StandardMaterial_OldVer;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial_OldVer;
+        static _DiffuseTextureEnabled: boolean;
+        static DiffuseTextureEnabled: boolean;
+        static _AmbientTextureEnabled: boolean;
+        static AmbientTextureEnabled: boolean;
+        static _OpacityTextureEnabled: boolean;
+        static OpacityTextureEnabled: boolean;
+        static _ReflectionTextureEnabled: boolean;
+        static ReflectionTextureEnabled: boolean;
+        static _EmissiveTextureEnabled: boolean;
+        static EmissiveTextureEnabled: boolean;
+        static _SpecularTextureEnabled: boolean;
+        static SpecularTextureEnabled: boolean;
+        static _BumpTextureEnabled: boolean;
+        static BumpTextureEnabled: boolean;
+        static _LightmapTextureEnabled: boolean;
+        static LightmapTextureEnabled: boolean;
+        static _RefractionTextureEnabled: boolean;
+        static RefractionTextureEnabled: boolean;
+        static _ColorGradingTextureEnabled: boolean;
+        static ColorGradingTextureEnabled: boolean;
+        static _FresnelEnabled: boolean;
+        static FresnelEnabled: boolean;
+    }
     class CustomShaderStructure {
     class CustomShaderStructure {
         FragmentStore: string;
         FragmentStore: string;
         VertexStore: string;
         VertexStore: string;
@@ -23,9 +293,9 @@ declare module BABYLON {
         constructor();
         constructor();
     }
     }
     class StandardShaderVersions {
     class StandardShaderVersions {
-        static Ver3_0: any;
+        static Ver3_0: string;
     }
     }
-    class CustomMaterial extends StandardMaterial {
+    class CustomMaterial extends StandardMaterial_OldVer {
         static ShaderIndexer: number;
         static ShaderIndexer: number;
         CustomParts: ShaderSpecialParts;
         CustomParts: ShaderSpecialParts;
         ShaderVersion: CustomShaderStructure;
         ShaderVersion: CustomShaderStructure;
@@ -37,7 +307,7 @@ declare module BABYLON {
         _newSamplerInstances: Texture[];
         _newSamplerInstances: Texture[];
         AttachAfterBind(mesh: Mesh, effect: Effect): void;
         AttachAfterBind(mesh: Mesh, effect: Effect): void;
         ReviewUniform(name: string, arr: string[]): string[];
         ReviewUniform(name: string, arr: string[]): string[];
-        Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines): string;
+        Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer): string;
         SelectVersion(ver: string): void;
         SelectVersion(ver: string): void;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         AddUniform(name: string, kind: string, param: any): CustomMaterial;
         AddUniform(name: string, kind: string, param: any): CustomMaterial;

File diff suppressed because it is too large
+ 1391 - 11
dist/materialsLibrary/babylon.customMaterial.js


File diff suppressed because it is too large
+ 2 - 1
dist/materialsLibrary/babylon.customMaterial.min.js


+ 5 - 4
dist/materialsLibrary/babylon.fireMaterial.d.ts

@@ -2,11 +2,11 @@
 declare module BABYLON {
 declare module BABYLON {
     class FireMaterial extends PushMaterial {
     class FireMaterial extends PushMaterial {
         private _diffuseTexture;
         private _diffuseTexture;
-        diffuseTexture: BaseTexture;
+        diffuseTexture: Nullable<BaseTexture>;
         private _distortionTexture;
         private _distortionTexture;
-        distortionTexture: BaseTexture;
+        distortionTexture: Nullable<BaseTexture>;
         private _opacityTexture;
         private _opacityTexture;
-        opacityTexture: BaseTexture;
+        opacityTexture: Nullable<BaseTexture>;
         diffuseColor: Color3;
         diffuseColor: Color3;
         speed: number;
         speed: number;
         private _scaledDiffuse;
         private _scaledDiffuse;
@@ -15,12 +15,13 @@ declare module BABYLON {
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
         getActiveTextures(): BaseTexture[];
         getActiveTextures(): BaseTexture[];
         hasTexture(texture: BaseTexture): boolean;
         hasTexture(texture: BaseTexture): boolean;
+        getClassName(): string;
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): FireMaterial;
         clone(name: string): FireMaterial;
         serialize(): any;
         serialize(): any;

File diff suppressed because it is too large
+ 41 - 31
dist/materialsLibrary/babylon.fireMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.fireMaterial.min.js


+ 2 - 2
dist/materialsLibrary/babylon.furMaterial.d.ts

@@ -21,14 +21,13 @@ declare module BABYLON {
         maxSimultaneousLights: number;
         maxSimultaneousLights: number;
         highLevelFur: boolean;
         highLevelFur: boolean;
         _meshes: AbstractMesh[];
         _meshes: AbstractMesh[];
-        private _worldViewProjectionMatrix;
         private _renderId;
         private _renderId;
         private _furTime;
         private _furTime;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         furTime: number;
         furTime: number;
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         updateFur(): void;
         updateFur(): void;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
@@ -38,6 +37,7 @@ declare module BABYLON {
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): FurMaterial;
         clone(name: string): FurMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): FurMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): FurMaterial;
         static GenerateTexture(name: string, scene: Scene): DynamicTexture;
         static GenerateTexture(name: string, scene: Scene): DynamicTexture;
         static FurifyMesh(sourceMesh: Mesh, quality: number): Mesh[];
         static FurifyMesh(sourceMesh: Mesh, quality: number): Mesh[];

File diff suppressed because it is too large
+ 75 - 67
dist/materialsLibrary/babylon.furMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.furMaterial.min.js


+ 2 - 2
dist/materialsLibrary/babylon.gradientMaterial.d.ts

@@ -10,19 +10,19 @@ declare module BABYLON {
         offset: number;
         offset: number;
         smoothness: number;
         smoothness: number;
         disableLighting: boolean;
         disableLighting: boolean;
-        private _worldViewProjectionMatrix;
         private _scaledDiffuse;
         private _scaledDiffuse;
         private _renderId;
         private _renderId;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): GradientMaterial;
         clone(name: string): GradientMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): GradientMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): GradientMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 43 - 38
dist/materialsLibrary/babylon.gradientMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.gradientMaterial.min.js


+ 10 - 0
dist/materialsLibrary/babylon.gridMaterial.d.ts

@@ -18,6 +18,10 @@ declare module BABYLON {
          */
          */
         gridRatio: number;
         gridRatio: number;
         /**
         /**
+         * Allows setting an offset for the grid lines.
+         */
+        gridOffset: Vector3;
+        /**
          * The frequency of thicker lines.
          * The frequency of thicker lines.
          */
          */
         majorUnitFrequency: number;
         majorUnitFrequency: number;
@@ -29,6 +33,10 @@ declare module BABYLON {
          * The grid opacity outside of the lines.
          * The grid opacity outside of the lines.
          */
          */
         opacity: number;
         opacity: number;
+        /**
+         * Determine RBG output is premultiplied by alpha value.
+         */
+        preMultiplyAlpha: boolean;
         private _gridControl;
         private _gridControl;
         private _renderId;
         private _renderId;
         /**
         /**
@@ -41,11 +49,13 @@ declare module BABYLON {
          * Returns wehter or not the grid requires alpha blending.
          * Returns wehter or not the grid requires alpha blending.
          */
          */
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
+        needAlphaBlendingForMesh(mesh: AbstractMesh): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): GridMaterial;
         clone(name: string): GridMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 59 - 35
dist/materialsLibrary/babylon.gridMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.gridMaterial.min.js


+ 2 - 2
dist/materialsLibrary/babylon.lavaMaterial.d.ts

@@ -15,13 +15,12 @@ declare module BABYLON {
         disableLighting: boolean;
         disableLighting: boolean;
         private _maxSimultaneousLights;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _scaledDiffuse;
         private _scaledDiffuse;
         private _renderId;
         private _renderId;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
@@ -30,6 +29,7 @@ declare module BABYLON {
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): LavaMaterial;
         clone(name: string): LavaMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): LavaMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): LavaMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 53 - 48
dist/materialsLibrary/babylon.lavaMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.lavaMaterial.min.js


+ 0 - 337
dist/materialsLibrary/babylon.legacyPbrMaterial.d.ts

@@ -1,337 +0,0 @@
-
-declare module BABYLON {
-    /**
-     * The Physically based material of BJS.
-     *
-     * This offers the main features of a standard PBR material.
-     * For more information, please refer to the documentation :
-     * http://doc.babylonjs.com/extensions/Physically_Based_Rendering
-     */
-    class LegacyPBRMaterial extends BABYLON.Material {
-        /**
-         * Intensity of the direct lights e.g. the four lights available in your scene.
-         * This impacts both the direct diffuse and specular highlights.
-         */
-        directIntensity: number;
-        /**
-         * Intensity of the emissive part of the material.
-         * This helps controlling the emissive effect without modifying the emissive color.
-         */
-        emissiveIntensity: number;
-        /**
-         * Intensity of the environment e.g. how much the environment will light the object
-         * either through harmonics for rough material or through the refelction for shiny ones.
-         */
-        environmentIntensity: number;
-        /**
-         * This is a special control allowing the reduction of the specular highlights coming from the
-         * four lights of the scene. Those highlights may not be needed in full environment lighting.
-         */
-        specularIntensity: number;
-        private _lightingInfos;
-        /**
-         * Debug Control allowing disabling the bump map on this material.
-         */
-        disableBumpMap: boolean;
-        /**
-         * Debug Control helping enforcing or dropping the darkness of shadows.
-         * 1.0 means the shadows have their normal darkness, 0.0 means the shadows are not visible.
-         */
-        overloadedShadowIntensity: number;
-        /**
-         * Debug Control helping dropping the shading effect coming from the diffuse lighting.
-         * 1.0 means the shade have their normal impact, 0.0 means no shading at all.
-         */
-        overloadedShadeIntensity: number;
-        private _overloadedShadowInfos;
-        /**
-         * The camera exposure used on this material.
-         * This property is here and not in the camera to allow controlling exposure without full screen post process.
-         * This corresponds to a photographic exposure.
-         */
-        cameraExposure: number;
-        /**
-         * The camera contrast used on this material.
-         * This property is here and not in the camera to allow controlling contrast without full screen post process.
-         */
-        cameraContrast: number;
-        /**
-         * Color Grading 2D Lookup Texture.
-         * This allows special effects like sepia, black and white to sixties rendering style.
-         */
-        cameraColorGradingTexture: BaseTexture;
-        /**
-         * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
-         * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
-         * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
-         * corresponding to low luminance, medium luminance, and high luminance areas respectively.
-         */
-        cameraColorCurves: ColorCurves;
-        private _cameraInfos;
-        private _microsurfaceTextureLods;
-        /**
-         * Debug Control allowing to overload the ambient color.
-         * This as to be use with the overloadedAmbientIntensity parameter.
-         */
-        overloadedAmbient: Color3;
-        /**
-         * Debug Control indicating how much the overloaded ambient color is used against the default one.
-         */
-        overloadedAmbientIntensity: number;
-        /**
-         * Debug Control allowing to overload the albedo color.
-         * This as to be use with the overloadedAlbedoIntensity parameter.
-         */
-        overloadedAlbedo: Color3;
-        /**
-         * Debug Control indicating how much the overloaded albedo color is used against the default one.
-         */
-        overloadedAlbedoIntensity: number;
-        /**
-         * Debug Control allowing to overload the reflectivity color.
-         * This as to be use with the overloadedReflectivityIntensity parameter.
-         */
-        overloadedReflectivity: Color3;
-        /**
-         * Debug Control indicating how much the overloaded reflectivity color is used against the default one.
-         */
-        overloadedReflectivityIntensity: number;
-        /**
-         * Debug Control allowing to overload the emissive color.
-         * This as to be use with the overloadedEmissiveIntensity parameter.
-         */
-        overloadedEmissive: Color3;
-        /**
-         * Debug Control indicating how much the overloaded emissive color is used against the default one.
-         */
-        overloadedEmissiveIntensity: number;
-        private _overloadedIntensity;
-        /**
-         * Debug Control allowing to overload the reflection color.
-         * This as to be use with the overloadedReflectionIntensity parameter.
-         */
-        overloadedReflection: Color3;
-        /**
-         * Debug Control indicating how much the overloaded reflection color is used against the default one.
-         */
-        overloadedReflectionIntensity: number;
-        /**
-         * Debug Control allowing to overload the microsurface.
-         * This as to be use with the overloadedMicroSurfaceIntensity parameter.
-         */
-        overloadedMicroSurface: number;
-        /**
-         * Debug Control indicating how much the overloaded microsurface is used against the default one.
-         */
-        overloadedMicroSurfaceIntensity: number;
-        private _overloadedMicroSurface;
-        /**
-         * AKA Diffuse Texture in standard nomenclature.
-         */
-        albedoTexture: BaseTexture;
-        /**
-         * AKA Occlusion Texture in other nomenclature.
-         */
-        ambientTexture: BaseTexture;
-        /**
-         * AKA Occlusion Texture Intensity in other nomenclature.
-         */
-        ambientTextureStrength: number;
-        opacityTexture: BaseTexture;
-        reflectionTexture: BaseTexture;
-        emissiveTexture: BaseTexture;
-        /**
-         * AKA Specular texture in other nomenclature.
-         */
-        reflectivityTexture: BaseTexture;
-        /**
-         * Used to switch from specular/glossiness to metallic/roughness workflow.
-         */
-        metallicTexture: BaseTexture;
-        /**
-         * Specifies the metallic scalar of the metallic/roughness workflow.
-         * Can also be used to scale the metalness values of the metallic texture.
-         */
-        metallic: number;
-        /**
-         * Specifies the roughness scalar of the metallic/roughness workflow.
-         * Can also be used to scale the roughness values of the metallic texture.
-         */
-        roughness: number;
-        /**
-         * Used to enable roughness/glossiness fetch from a separate chanel depending on the current mode.
-         * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
-         */
-        microSurfaceTexture: BaseTexture;
-        bumpTexture: BaseTexture;
-        lightmapTexture: BaseTexture;
-        refractionTexture: BaseTexture;
-        ambientColor: Color3;
-        /**
-         * AKA Diffuse Color in other nomenclature.
-         */
-        albedoColor: Color3;
-        /**
-         * AKA Specular Color in other nomenclature.
-         */
-        reflectivityColor: Color3;
-        reflectionColor: Color3;
-        emissiveColor: Color3;
-        /**
-         * AKA Glossiness in other nomenclature.
-         */
-        microSurface: number;
-        /**
-         * source material index of refraction (IOR)' / 'destination material IOR.
-         */
-        indexOfRefraction: number;
-        /**
-         * Controls if refraction needs to be inverted on Y. This could be usefull for procedural texture.
-         */
-        invertRefractionY: boolean;
-        opacityFresnelParameters: FresnelParameters;
-        emissiveFresnelParameters: FresnelParameters;
-        /**
-         * This parameters will make the material used its opacity to control how much it is refracting aginst not.
-         * Materials half opaque for instance using refraction could benefit from this control.
-         */
-        linkRefractionWithTransparency: boolean;
-        /**
-         * The emissive and albedo are linked to never be more than one (Energy conservation).
-         */
-        linkEmissiveWithAlbedo: boolean;
-        useLightmapAsShadowmap: boolean;
-        /**
-         * In this mode, the emissive informtaion will always be added to the lighting once.
-         * A light for instance can be thought as emissive.
-         */
-        useEmissiveAsIllumination: boolean;
-        /**
-         * Secifies that the alpha is coming form the albedo channel alpha channel.
-         */
-        useAlphaFromAlbedoTexture: boolean;
-        /**
-         * Specifies that the material will keeps the specular highlights over a transparent surface (only the most limunous ones).
-         * A car glass is a good exemple of that. When sun reflects on it you can not see what is behind.
-         */
-        useSpecularOverAlpha: boolean;
-        /**
-         * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.
-         */
-        useMicroSurfaceFromReflectivityMapAlpha: boolean;
-        /**
-         * Specifies if the metallic texture contains the roughness information in its alpha channel.
-         */
-        useRoughnessFromMetallicTextureAlpha: boolean;
-        /**
-         * Specifies if the metallic texture contains the roughness information in its green channel.
-         */
-        useRoughnessFromMetallicTextureGreen: boolean;
-        /**
-         * Specifies if the metallic texture contains the metallness information in its blue channel.
-         */
-        useMetallnessFromMetallicTextureBlue: boolean;
-        /**
-         * Specifies if the metallic texture contains the ambient occlusion information in its red channel.
-         */
-        useAmbientOcclusionFromMetallicTextureRed: boolean;
-        /**
-         * Specifies if the ambient texture contains the ambient occlusion information in its red channel only.
-         */
-        useAmbientInGrayScale: boolean;
-        /**
-         * In case the reflectivity map does not contain the microsurface information in its alpha channel,
-         * The material will try to infer what glossiness each pixel should be.
-         */
-        useAutoMicroSurfaceFromReflectivityMap: boolean;
-        /**
-         * Allows to work with scalar in linear mode. This is definitely a matter of preferences and tools used during
-         * the creation of the material.
-         */
-        useScalarInLinearSpace: boolean;
-        /**
-         * BJS is using an harcoded light falloff based on a manually sets up range.
-         * In PBR, one way to represents the fallof is to use the inverse squared root algorythm.
-         * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.
-         */
-        usePhysicalLightFalloff: boolean;
-        /**
-         * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most limunous ones).
-         * A car glass is a good exemple of that. When the street lights reflects on it you can not see what is behind.
-         */
-        useRadianceOverAlpha: boolean;
-        /**
-         * Allows using the bump map in parallax mode.
-         */
-        useParallax: boolean;
-        /**
-         * Allows using the bump map in parallax occlusion mode.
-         */
-        useParallaxOcclusion: boolean;
-        /**
-         * Controls the scale bias of the parallax mode.
-         */
-        parallaxScaleBias: number;
-        /**
-         * If sets to true, disables all the lights affecting the material.
-         */
-        disableLighting: boolean;
-        /**
-         * Number of Simultaneous lights allowed on the material.
-         */
-        maxSimultaneousLights: number;
-        /**
-         * If sets to true, x component of normal map value will invert (x = 1.0 - x).
-         */
-        invertNormalMapX: boolean;
-        /**
-         * If sets to true, y component of normal map value will invert (y = 1.0 - y).
-         */
-        invertNormalMapY: boolean;
-        /**
-         * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
-         */
-        twoSidedLighting: boolean;
-        private _renderTargets;
-        private _worldViewProjectionMatrix;
-        private _globalAmbientColor;
-        private _tempColor;
-        private _renderId;
-        private _defines;
-        private _cachedDefines;
-        private _useLogarithmicDepth;
-        /**
-         * Instantiates a new PBRMaterial instance.
-         *
-         * @param name The material name
-         * @param scene The scene the material will be use in.
-         */
-        constructor(name: string, scene: Scene);
-        getClassName(): string;
-        useLogarithmicDepth: boolean;
-        needAlphaBlending(): boolean;
-        needAlphaTesting(): boolean;
-        private _shouldUseAlphaFromAlbedoTexture();
-        getAlphaTestTexture(): BaseTexture;
-        private _checkCache(scene, mesh?, useInstances?);
-        private convertColorToLinearSpaceToRef(color, ref);
-        private static convertColorToLinearSpaceToRef(color, ref, useScalarInLinear);
-        private static _scaledAlbedo;
-        private static _scaledReflectivity;
-        private static _scaledEmissive;
-        private static _scaledReflection;
-        static BindLights(scene: Scene, mesh: AbstractMesh, effect: Effect, defines: MaterialDefines, useScalarInLinearSpace: boolean, maxSimultaneousLights: number, usePhysicalLightFalloff: boolean): void;
-        isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
-        buildUniformLayout(): void;
-        unbind(): void;
-        bindOnlyWorldMatrix(world: Matrix): void;
-        private _myScene;
-        private _myShadowGenerator;
-        bind(world: Matrix, mesh?: Mesh): void;
-        getAnimatables(): IAnimatable[];
-        dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
-        clone(name: string): LegacyPBRMaterial;
-        serialize(): any;
-        static Parse(source: any, scene: Scene, rootUrl: string): LegacyPBRMaterial;
-    }
-}

File diff suppressed because it is too large
+ 0 - 1531
dist/materialsLibrary/babylon.legacyPbrMaterial.js


File diff suppressed because it is too large
+ 0 - 3
dist/materialsLibrary/babylon.legacyPbrMaterial.min.js


+ 2 - 3
dist/materialsLibrary/babylon.normalMaterial.d.ts

@@ -8,13 +8,11 @@ declare module BABYLON {
         disableLighting: boolean;
         disableLighting: boolean;
         private _maxSimultaneousLights;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         private _renderId;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
@@ -23,6 +21,7 @@ declare module BABYLON {
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): NormalMaterial;
         clone(name: string): NormalMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): NormalMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): NormalMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 35 - 31
dist/materialsLibrary/babylon.normalMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.normalMaterial.min.js


+ 4 - 3
dist/materialsLibrary/babylon.shadowOnlyMaterial.d.ts

@@ -1,17 +1,18 @@
 
 
 declare module BABYLON {
 declare module BABYLON {
     class ShadowOnlyMaterial extends PushMaterial {
     class ShadowOnlyMaterial extends PushMaterial {
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         private _renderId;
+        private _activeLight;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        activeLight: IShadowLight;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         clone(name: string): ShadowOnlyMaterial;
         clone(name: string): ShadowOnlyMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): ShadowOnlyMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): ShadowOnlyMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 44 - 23
dist/materialsLibrary/babylon.shadowOnlyMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.shadowOnlyMaterial.min.js


+ 2 - 3
dist/materialsLibrary/babylon.simpleMaterial.d.ts

@@ -8,13 +8,11 @@ declare module BABYLON {
         disableLighting: boolean;
         disableLighting: boolean;
         private _maxSimultaneousLights;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
-        private _scaledDiffuse;
         private _renderId;
         private _renderId;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
@@ -23,6 +21,7 @@ declare module BABYLON {
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): SimpleMaterial;
         clone(name: string): SimpleMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): SimpleMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): SimpleMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 35 - 31
dist/materialsLibrary/babylon.simpleMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.simpleMaterial.min.js


+ 2 - 1
dist/materialsLibrary/babylon.skyMaterial.d.ts

@@ -16,13 +16,14 @@ declare module BABYLON {
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): SkyMaterial;
         clone(name: string): SkyMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 40 - 36
dist/materialsLibrary/babylon.skyMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.skyMaterial.min.js


+ 2 - 2
dist/materialsLibrary/babylon.terrainMaterial.d.ts

@@ -22,12 +22,11 @@ declare module BABYLON {
         disableLighting: boolean;
         disableLighting: boolean;
         private _maxSimultaneousLights;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _renderId;
         private _renderId;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
@@ -36,6 +35,7 @@ declare module BABYLON {
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): TerrainMaterial;
         clone(name: string): TerrainMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 77 - 72
dist/materialsLibrary/babylon.terrainMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.terrainMaterial.min.js


+ 2 - 2
dist/materialsLibrary/babylon.triPlanarMaterial.d.ts

@@ -22,12 +22,11 @@ declare module BABYLON {
         disableLighting: boolean;
         disableLighting: boolean;
         private _maxSimultaneousLights;
         private _maxSimultaneousLights;
         maxSimultaneousLights: number;
         maxSimultaneousLights: number;
-        private _worldViewProjectionMatrix;
         private _renderId;
         private _renderId;
         constructor(name: string, scene: Scene);
         constructor(name: string, scene: Scene);
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         getAnimatables(): IAnimatable[];
         getAnimatables(): IAnimatable[];
@@ -36,6 +35,7 @@ declare module BABYLON {
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): TriPlanarMaterial;
         clone(name: string): TriPlanarMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial;
     }
     }
 }
 }

File diff suppressed because it is too large
+ 77 - 72
dist/materialsLibrary/babylon.triPlanarMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.triPlanarMaterial.min.js


+ 8 - 5
dist/materialsLibrary/babylon.waterMaterial.d.ts

@@ -66,28 +66,30 @@ declare module BABYLON {
         * @param {number}: Defines the waves speed
         * @param {number}: Defines the waves speed
         */
         */
         waveSpeed: number;
         waveSpeed: number;
+        protected _renderTargets: SmartArray<RenderTargetTexture>;
         private _mesh;
         private _mesh;
         private _refractionRTT;
         private _refractionRTT;
         private _reflectionRTT;
         private _reflectionRTT;
-        private _material;
         private _reflectionTransform;
         private _reflectionTransform;
         private _lastTime;
         private _lastTime;
+        private _lastDeltaTime;
         private _renderId;
         private _renderId;
         private _useLogarithmicDepth;
         private _useLogarithmicDepth;
+        private _waitingRenderList;
         /**
         /**
         * Constructor
         * Constructor
         */
         */
         constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
         constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
         useLogarithmicDepth: boolean;
         useLogarithmicDepth: boolean;
-        readonly refractionTexture: RenderTargetTexture;
-        readonly reflectionTexture: RenderTargetTexture;
+        readonly refractionTexture: Nullable<RenderTargetTexture>;
+        readonly reflectionTexture: Nullable<RenderTargetTexture>;
         addToRenderList(node: any): void;
         addToRenderList(node: any): void;
         enableRenderTargets(enable: boolean): void;
         enableRenderTargets(enable: boolean): void;
-        getRenderList(): AbstractMesh[];
+        getRenderList(): Nullable<AbstractMesh[]>;
         readonly renderTargetsEnabled: boolean;
         readonly renderTargetsEnabled: boolean;
         needAlphaBlending(): boolean;
         needAlphaBlending(): boolean;
         needAlphaTesting(): boolean;
         needAlphaTesting(): boolean;
-        getAlphaTestTexture(): BaseTexture;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
         private _createRenderTargets(scene, renderTargetSize);
         private _createRenderTargets(scene, renderTargetSize);
@@ -97,6 +99,7 @@ declare module BABYLON {
         dispose(forceDisposeEffect?: boolean): void;
         dispose(forceDisposeEffect?: boolean): void;
         clone(name: string): WaterMaterial;
         clone(name: string): WaterMaterial;
         serialize(): any;
         serialize(): any;
+        getClassName(): string;
         static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
         static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
         static CreateDefaultMesh(name: string, scene: Scene): Mesh;
         static CreateDefaultMesh(name: string, scene: Scene): Mesh;
     }
     }

File diff suppressed because it is too large
+ 140 - 100
dist/materialsLibrary/babylon.waterMaterial.js


File diff suppressed because it is too large
+ 1 - 1
dist/materialsLibrary/babylon.waterMaterial.min.js


File diff suppressed because it is too large
+ 6362 - 0
dist/materialsLibrary/babylonjs.materials.js


File diff suppressed because it is too large
+ 7 - 0
dist/materialsLibrary/babylonjs.materials.min.js


+ 861 - 0
dist/materialsLibrary/babylonjs.materials.module.d.ts

@@ -0,0 +1,861 @@
+/// <reference types="babylonjs"/>
+
+declare module 'babylonjs-materials' { 
+    export = BABYLON; 
+}
+
+declare module BABYLON {
+    class ShadowOnlyMaterial extends PushMaterial {
+        private _renderId;
+        private _activeLight;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        activeLight: IShadowLight;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        clone(name: string): ShadowOnlyMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): ShadowOnlyMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class GradientMaterial extends PushMaterial {
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        topColor: Color3;
+        topColorAlpha: number;
+        bottomColor: Color3;
+        bottomColorAlpha: number;
+        offset: number;
+        smoothness: number;
+        disableLighting: boolean;
+        private _scaledDiffuse;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): GradientMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): GradientMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class NormalMaterial extends PushMaterial {
+        private _diffuseTexture;
+        diffuseTexture: BaseTexture;
+        diffuseColor: Color3;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): NormalMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): NormalMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class LavaMaterial extends PushMaterial {
+        private _diffuseTexture;
+        diffuseTexture: BaseTexture;
+        noiseTexture: BaseTexture;
+        fogColor: Color3;
+        speed: number;
+        movingSpeed: number;
+        lowFrequencySpeed: number;
+        fogDensity: number;
+        private _lastTime;
+        diffuseColor: Color3;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _scaledDiffuse;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): LavaMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): LavaMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class SimpleMaterial extends PushMaterial {
+        private _diffuseTexture;
+        diffuseTexture: BaseTexture;
+        diffuseColor: Color3;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): SimpleMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): SimpleMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class WaterMaterial extends PushMaterial {
+        renderTargetSize: Vector2;
+        private _bumpTexture;
+        bumpTexture: BaseTexture;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        /**
+        * @param {number}: Represents the wind force
+        */
+        windForce: number;
+        /**
+        * @param {Vector2}: The direction of the wind in the plane (X, Z)
+        */
+        windDirection: Vector2;
+        /**
+        * @param {number}: Wave height, represents the height of the waves
+        */
+        waveHeight: number;
+        /**
+        * @param {number}: Bump height, represents the bump height related to the bump map
+        */
+        bumpHeight: number;
+        /**
+         * @param {boolean}: Add a smaller moving bump to less steady waves.
+         */
+        private _bumpSuperimpose;
+        bumpSuperimpose: boolean;
+        /**
+         * @param {boolean}: Color refraction and reflection differently with .waterColor2 and .colorBlendFactor2. Non-linear (physically correct) fresnel.
+         */
+        private _fresnelSeparate;
+        fresnelSeparate: boolean;
+        /**
+         * @param {boolean}: bump Waves modify the reflection.
+         */
+        private _bumpAffectsReflection;
+        bumpAffectsReflection: boolean;
+        /**
+        * @param {number}: The water color blended with the refraction (near)
+        */
+        waterColor: Color3;
+        /**
+        * @param {number}: The blend factor related to the water color
+        */
+        colorBlendFactor: number;
+        /**
+         * @param {number}: The water color blended with the reflection (far)
+         */
+        waterColor2: Color3;
+        /**
+         * @param {number}: The blend factor related to the water color (reflection, far)
+         */
+        colorBlendFactor2: number;
+        /**
+        * @param {number}: Represents the maximum length of a wave
+        */
+        waveLength: number;
+        /**
+        * @param {number}: Defines the waves speed
+        */
+        waveSpeed: number;
+        protected _renderTargets: SmartArray<RenderTargetTexture>;
+        private _mesh;
+        private _refractionRTT;
+        private _reflectionRTT;
+        private _reflectionTransform;
+        private _lastTime;
+        private _lastDeltaTime;
+        private _renderId;
+        private _useLogarithmicDepth;
+        private _waitingRenderList;
+        /**
+        * Constructor
+        */
+        constructor(name: string, scene: Scene, renderTargetSize?: Vector2);
+        useLogarithmicDepth: boolean;
+        readonly refractionTexture: Nullable<RenderTargetTexture>;
+        readonly reflectionTexture: Nullable<RenderTargetTexture>;
+        addToRenderList(node: any): void;
+        enableRenderTargets(enable: boolean): void;
+        getRenderList(): Nullable<AbstractMesh[]>;
+        readonly renderTargetsEnabled: boolean;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        private _createRenderTargets(scene, renderTargetSize);
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): WaterMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): WaterMaterial;
+        static CreateDefaultMesh(name: string, scene: Scene): Mesh;
+    }
+}
+
+
+declare module BABYLON {
+    class FireMaterial extends PushMaterial {
+        private _diffuseTexture;
+        diffuseTexture: Nullable<BaseTexture>;
+        private _distortionTexture;
+        distortionTexture: Nullable<BaseTexture>;
+        private _opacityTexture;
+        opacityTexture: Nullable<BaseTexture>;
+        diffuseColor: Color3;
+        speed: number;
+        private _scaledDiffuse;
+        private _renderId;
+        private _lastTime;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        getClassName(): string;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): FireMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): FireMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class FurMaterial extends PushMaterial {
+        private _diffuseTexture;
+        diffuseTexture: BaseTexture;
+        private _heightTexture;
+        heightTexture: BaseTexture;
+        diffuseColor: Color3;
+        furLength: number;
+        furAngle: number;
+        furColor: Color3;
+        furOffset: number;
+        furSpacing: number;
+        furGravity: Vector3;
+        furSpeed: number;
+        furDensity: number;
+        furTexture: DynamicTexture;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        highLevelFur: boolean;
+        _meshes: AbstractMesh[];
+        private _renderId;
+        private _furTime;
+        constructor(name: string, scene: Scene);
+        furTime: number;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        updateFur(): void;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): FurMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): FurMaterial;
+        static GenerateTexture(name: string, scene: Scene): DynamicTexture;
+        static FurifyMesh(sourceMesh: Mesh, quality: number): Mesh[];
+    }
+}
+
+
+declare module BABYLON {
+    class TerrainMaterial extends PushMaterial {
+        private _mixTexture;
+        mixTexture: BaseTexture;
+        private _diffuseTexture1;
+        diffuseTexture1: Texture;
+        private _diffuseTexture2;
+        diffuseTexture2: Texture;
+        private _diffuseTexture3;
+        diffuseTexture3: Texture;
+        private _bumpTexture1;
+        bumpTexture1: Texture;
+        private _bumpTexture2;
+        bumpTexture2: Texture;
+        private _bumpTexture3;
+        bumpTexture3: Texture;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): TerrainMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): TerrainMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class TriPlanarMaterial extends PushMaterial {
+        mixTexture: BaseTexture;
+        private _diffuseTextureX;
+        diffuseTextureX: BaseTexture;
+        private _diffuseTextureY;
+        diffuseTextureY: BaseTexture;
+        private _diffuseTextureZ;
+        diffuseTextureZ: BaseTexture;
+        private _normalTextureX;
+        normalTextureX: BaseTexture;
+        private _normalTextureY;
+        normalTextureY: BaseTexture;
+        private _normalTextureZ;
+        normalTextureZ: BaseTexture;
+        tileSize: number;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        specularPower: number;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): TriPlanarMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): TriPlanarMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class SkyMaterial extends PushMaterial {
+        luminance: number;
+        turbidity: number;
+        rayleigh: number;
+        mieCoefficient: number;
+        mieDirectionalG: number;
+        distance: number;
+        inclination: number;
+        azimuth: number;
+        sunPosition: Vector3;
+        useSunPosition: boolean;
+        private _cameraPosition;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): SkyMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): SkyMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    /**
+     * The grid materials allows you to wrap any shape with a grid.
+     * Colors are customizable.
+     */
+    class GridMaterial extends BABYLON.PushMaterial {
+        /**
+         * Main color of the grid (e.g. between lines)
+         */
+        mainColor: Color3;
+        /**
+         * Color of the grid lines.
+         */
+        lineColor: Color3;
+        /**
+         * The scale of the grid compared to unit.
+         */
+        gridRatio: number;
+        /**
+         * Allows setting an offset for the grid lines.
+         */
+        gridOffset: Vector3;
+        /**
+         * The frequency of thicker lines.
+         */
+        majorUnitFrequency: number;
+        /**
+         * The visibility of minor units in the grid.
+         */
+        minorUnitVisibility: number;
+        /**
+         * The grid opacity outside of the lines.
+         */
+        opacity: number;
+        /**
+         * Determine RBG output is premultiplied by alpha value.
+         */
+        preMultiplyAlpha: boolean;
+        private _gridControl;
+        private _renderId;
+        /**
+         * constructor
+         * @param name The name given to the material in order to identify it afterwards.
+         * @param scene The scene the material is used in.
+         */
+        constructor(name: string, scene: Scene);
+        /**
+         * Returns wehter or not the grid requires alpha blending.
+         */
+        needAlphaBlending(): boolean;
+        needAlphaBlendingForMesh(mesh: AbstractMesh): boolean;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        dispose(forceDisposeEffect?: boolean): void;
+        clone(name: string): GridMaterial;
+        serialize(): any;
+        getClassName(): string;
+        static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class StandardMaterialDefines_OldVer extends MaterialDefines implements IImageProcessingConfigurationDefines {
+        DIFFUSE: boolean;
+        AMBIENT: boolean;
+        OPACITY: boolean;
+        OPACITYRGB: boolean;
+        REFLECTION: boolean;
+        EMISSIVE: boolean;
+        SPECULAR: boolean;
+        BUMP: boolean;
+        PARALLAX: boolean;
+        PARALLAXOCCLUSION: boolean;
+        SPECULAROVERALPHA: boolean;
+        CLIPPLANE: boolean;
+        ALPHATEST: boolean;
+        ALPHAFROMDIFFUSE: boolean;
+        POINTSIZE: boolean;
+        FOG: boolean;
+        SPECULARTERM: boolean;
+        DIFFUSEFRESNEL: boolean;
+        OPACITYFRESNEL: boolean;
+        REFLECTIONFRESNEL: boolean;
+        REFRACTIONFRESNEL: boolean;
+        EMISSIVEFRESNEL: boolean;
+        FRESNEL: boolean;
+        NORMAL: boolean;
+        UV1: boolean;
+        UV2: boolean;
+        VERTEXCOLOR: boolean;
+        VERTEXALPHA: boolean;
+        NUM_BONE_INFLUENCERS: number;
+        BonesPerMesh: number;
+        INSTANCES: boolean;
+        GLOSSINESS: boolean;
+        ROUGHNESS: boolean;
+        EMISSIVEASILLUMINATION: boolean;
+        LINKEMISSIVEWITHDIFFUSE: boolean;
+        REFLECTIONFRESNELFROMSPECULAR: boolean;
+        LIGHTMAP: boolean;
+        USELIGHTMAPASSHADOWMAP: boolean;
+        REFLECTIONMAP_3D: boolean;
+        REFLECTIONMAP_SPHERICAL: boolean;
+        REFLECTIONMAP_PLANAR: boolean;
+        REFLECTIONMAP_CUBIC: boolean;
+        REFLECTIONMAP_PROJECTION: boolean;
+        REFLECTIONMAP_SKYBOX: boolean;
+        REFLECTIONMAP_EXPLICIT: boolean;
+        REFLECTIONMAP_EQUIRECTANGULAR: boolean;
+        REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
+        REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
+        INVERTCUBICMAP: boolean;
+        LOGARITHMICDEPTH: boolean;
+        REFRACTION: boolean;
+        REFRACTIONMAP_3D: boolean;
+        REFLECTIONOVERALPHA: boolean;
+        TWOSIDEDLIGHTING: boolean;
+        SHADOWFLOAT: boolean;
+        MORPHTARGETS: boolean;
+        MORPHTARGETS_NORMAL: boolean;
+        MORPHTARGETS_TANGENT: boolean;
+        NUM_MORPH_INFLUENCERS: number;
+        IMAGEPROCESSING: boolean;
+        VIGNETTE: boolean;
+        VIGNETTEBLENDMODEMULTIPLY: boolean;
+        VIGNETTEBLENDMODEOPAQUE: boolean;
+        TONEMAPPING: boolean;
+        CONTRAST: boolean;
+        COLORCURVES: boolean;
+        COLORGRADING: boolean;
+        COLORGRADING3D: boolean;
+        SAMPLER3DGREENDEPTH: boolean;
+        SAMPLER3DBGRMAP: boolean;
+        IMAGEPROCESSINGPOSTPROCESS: boolean;
+        EXPOSURE: boolean;
+        constructor();
+        setReflectionMode(modeToEnable: string): void;
+    }
+    class StandardMaterial_OldVer extends PushMaterial {
+        private _diffuseTexture;
+        diffuseTexture: BaseTexture;
+        private _ambientTexture;
+        ambientTexture: BaseTexture;
+        private _opacityTexture;
+        opacityTexture: BaseTexture;
+        private _reflectionTexture;
+        reflectionTexture: BaseTexture;
+        private _emissiveTexture;
+        emissiveTexture: BaseTexture;
+        private _specularTexture;
+        specularTexture: BaseTexture;
+        private _bumpTexture;
+        bumpTexture: BaseTexture;
+        private _lightmapTexture;
+        lightmapTexture: BaseTexture;
+        private _refractionTexture;
+        refractionTexture: BaseTexture;
+        ambientColor: Color3;
+        diffuseColor: Color3;
+        specularColor: Color3;
+        emissiveColor: Color3;
+        specularPower: number;
+        private _useAlphaFromDiffuseTexture;
+        useAlphaFromDiffuseTexture: boolean;
+        private _useEmissiveAsIllumination;
+        useEmissiveAsIllumination: boolean;
+        private _linkEmissiveWithDiffuse;
+        linkEmissiveWithDiffuse: boolean;
+        private _useSpecularOverAlpha;
+        useSpecularOverAlpha: boolean;
+        private _useReflectionOverAlpha;
+        useReflectionOverAlpha: boolean;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _useParallax;
+        useParallax: boolean;
+        private _useParallaxOcclusion;
+        useParallaxOcclusion: boolean;
+        parallaxScaleBias: number;
+        private _roughness;
+        roughness: number;
+        indexOfRefraction: number;
+        invertRefractionY: boolean;
+        private _useLightmapAsShadowmap;
+        useLightmapAsShadowmap: boolean;
+        private _diffuseFresnelParameters;
+        diffuseFresnelParameters: FresnelParameters;
+        private _opacityFresnelParameters;
+        opacityFresnelParameters: FresnelParameters;
+        private _reflectionFresnelParameters;
+        reflectionFresnelParameters: FresnelParameters;
+        private _refractionFresnelParameters;
+        refractionFresnelParameters: FresnelParameters;
+        private _emissiveFresnelParameters;
+        emissiveFresnelParameters: FresnelParameters;
+        private _useReflectionFresnelFromSpecular;
+        useReflectionFresnelFromSpecular: boolean;
+        private _useGlossinessFromSpecularMapAlpha;
+        useGlossinessFromSpecularMapAlpha: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        /**
+         * If sets to true, x component of normal map value will invert (x = 1.0 - x).
+         */
+        private _invertNormalMapX;
+        invertNormalMapX: boolean;
+        /**
+         * If sets to true, y component of normal map value will invert (y = 1.0 - y).
+         */
+        private _invertNormalMapY;
+        invertNormalMapY: boolean;
+        /**
+         * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
+         */
+        private _twoSidedLighting;
+        twoSidedLighting: boolean;
+        /**
+         * Default configuration related to image processing available in the standard Material.
+         */
+        protected _imageProcessingConfiguration: ImageProcessingConfiguration;
+        /**
+         * Gets the image processing configuration used either in this material.
+         */
+        /**
+         * Sets the Default image processing configuration used either in the this material.
+         *
+         * If sets to null, the scene one is in use.
+         */
+        imageProcessingConfiguration: ImageProcessingConfiguration;
+        /**
+         * Keep track of the image processing observer to allow dispose and replace.
+         */
+        private _imageProcessingObserver;
+        /**
+         * Attaches a new image processing configuration to the Standard Material.
+         * @param configuration
+         */
+        protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void;
+        /**
+         * Gets wether the color curves effect is enabled.
+         */
+        /**
+         * Sets wether the color curves effect is enabled.
+         */
+        cameraColorCurvesEnabled: boolean;
+        /**
+         * Gets wether the color grading effect is enabled.
+         */
+        /**
+         * Gets wether the color grading effect is enabled.
+         */
+        cameraColorGradingEnabled: boolean;
+        /**
+         * Gets wether tonemapping is enabled or not.
+         */
+        /**
+         * Sets wether tonemapping is enabled or not
+         */
+        cameraToneMappingEnabled: boolean;
+        /**
+         * The camera exposure used on this material.
+         * This property is here and not in the camera to allow controlling exposure without full screen post process.
+         * This corresponds to a photographic exposure.
+         */
+        /**
+         * The camera exposure used on this material.
+         * This property is here and not in the camera to allow controlling exposure without full screen post process.
+         * This corresponds to a photographic exposure.
+         */
+        cameraExposure: number;
+        /**
+         * Gets The camera contrast used on this material.
+         */
+        /**
+         * Sets The camera contrast used on this material.
+         */
+        cameraContrast: number;
+        /**
+         * Gets the Color Grading 2D Lookup Texture.
+         */
+        /**
+         * Sets the Color Grading 2D Lookup Texture.
+         */
+        cameraColorGradingTexture: Nullable<BaseTexture>;
+        customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer) => string;
+        protected _renderTargets: SmartArray<RenderTargetTexture>;
+        protected _worldViewProjectionMatrix: Matrix;
+        protected _globalAmbientColor: Color3;
+        protected _useLogarithmicDepth: boolean;
+        constructor(name: string, scene: Scene);
+        getClassName(): string;
+        useLogarithmicDepth: boolean;
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        protected _shouldUseAlphaFromDiffuseTexture(): boolean;
+        getAlphaTestTexture(): BaseTexture;
+        /**
+         * Child classes can use it to update shaders
+         */
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        buildUniformLayout(): void;
+        unbind(): void;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
+        clone(name: string): StandardMaterial_OldVer;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial_OldVer;
+        static _DiffuseTextureEnabled: boolean;
+        static DiffuseTextureEnabled: boolean;
+        static _AmbientTextureEnabled: boolean;
+        static AmbientTextureEnabled: boolean;
+        static _OpacityTextureEnabled: boolean;
+        static OpacityTextureEnabled: boolean;
+        static _ReflectionTextureEnabled: boolean;
+        static ReflectionTextureEnabled: boolean;
+        static _EmissiveTextureEnabled: boolean;
+        static EmissiveTextureEnabled: boolean;
+        static _SpecularTextureEnabled: boolean;
+        static SpecularTextureEnabled: boolean;
+        static _BumpTextureEnabled: boolean;
+        static BumpTextureEnabled: boolean;
+        static _LightmapTextureEnabled: boolean;
+        static LightmapTextureEnabled: boolean;
+        static _RefractionTextureEnabled: boolean;
+        static RefractionTextureEnabled: boolean;
+        static _ColorGradingTextureEnabled: boolean;
+        static ColorGradingTextureEnabled: boolean;
+        static _FresnelEnabled: boolean;
+        static FresnelEnabled: boolean;
+    }
+    class CustomShaderStructure {
+        FragmentStore: string;
+        VertexStore: string;
+        constructor();
+    }
+    class ShaderSpecialParts {
+        constructor();
+        Fragment_Begin: string;
+        Fragment_Definitions: string;
+        Fragment_MainBegin: string;
+        Fragment_Custom_Diffuse: string;
+        Fragment_Custom_Alpha: string;
+        Fragment_Before_FragColor: string;
+        Vertex_Begin: string;
+        Vertex_Definitions: string;
+        Vertex_MainBegin: string;
+        Vertex_Before_PositionUpdated: string;
+        Vertex_Before_NormalUpdated: string;
+    }
+    class ShaderForVer3_0 extends CustomShaderStructure {
+        constructor();
+    }
+    class StandardShaderVersions {
+        static Ver3_0: string;
+    }
+    class CustomMaterial extends StandardMaterial_OldVer {
+        static ShaderIndexer: number;
+        CustomParts: ShaderSpecialParts;
+        ShaderVersion: CustomShaderStructure;
+        _isCreatedShader: boolean;
+        _createdShaderName: string;
+        _customUniform: string[];
+        _newUniforms: string[];
+        _newUniformInstances: any[];
+        _newSamplerInstances: Texture[];
+        AttachAfterBind(mesh: Mesh, effect: Effect): void;
+        ReviewUniform(name: string, arr: string[]): string[];
+        Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines_OldVer): string;
+        SelectVersion(ver: string): void;
+        constructor(name: string, scene: Scene);
+        AddUniform(name: string, kind: string, param: any): CustomMaterial;
+        Fragment_Begin(shaderPart: string): CustomMaterial;
+        Fragment_Definitions(shaderPart: string): CustomMaterial;
+        Fragment_MainBegin(shaderPart: string): CustomMaterial;
+        Fragment_Custom_Diffuse(shaderPart: string): CustomMaterial;
+        Fragment_Custom_Alpha(shaderPart: string): CustomMaterial;
+        Fragment_Before_FragColor(shaderPart: string): CustomMaterial;
+        Vertex_Begin(shaderPart: string): CustomMaterial;
+        Vertex_Definitions(shaderPart: string): CustomMaterial;
+        Vertex_MainBegin(shaderPart: string): CustomMaterial;
+        Vertex_Before_PositionUpdated(shaderPart: string): CustomMaterial;
+        Vertex_Before_NormalUpdated(shaderPart: string): CustomMaterial;
+    }
+}
+
+
+declare module BABYLON {
+    class CellMaterial extends PushMaterial {
+        private _diffuseTexture;
+        diffuseTexture: BaseTexture;
+        diffuseColor: Color3;
+        _computeHighLevel: boolean;
+        computeHighLevel: boolean;
+        private _disableLighting;
+        disableLighting: boolean;
+        private _maxSimultaneousLights;
+        maxSimultaneousLights: number;
+        private _renderId;
+        constructor(name: string, scene: Scene);
+        needAlphaBlending(): boolean;
+        needAlphaTesting(): boolean;
+        getAlphaTestTexture(): Nullable<BaseTexture>;
+        isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
+        bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
+        getAnimatables(): IAnimatable[];
+        getActiveTextures(): BaseTexture[];
+        hasTexture(texture: BaseTexture): boolean;
+        dispose(forceDisposeEffect?: boolean): void;
+        getClassName(): string;
+        clone(name: string): CellMaterial;
+        serialize(): any;
+        static Parse(source: any, scene: Scene, rootUrl: string): CellMaterial;
+    }
+}

+ 37 - 0
dist/materialsLibrary/package.json

@@ -0,0 +1,37 @@
+{
+    "author": {
+        "name": "David CATUHE"
+    },
+    "name": "babylonjs-materials",
+    "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
+    "version": "3.1.0",
+    "repository": {
+        "type": "git",
+        "url": "https://github.com/BabylonJS/Babylon.js.git"
+    },
+    "main": "babylonjs.materials.min.js",
+    "files": [
+        "babylonjs.materials.js",
+        "babylonjs.materials.min.js",
+        "babylonjs.materials.module.d.ts",
+        "readme.md",
+        "package.json"
+    ],
+    "typings": "babylonjs.materials.module.d.ts",
+    "keywords": [
+        "3D",
+        "javascript",
+        "html5",
+        "webgl",
+        "materials"
+    ],
+    "license": "Apache-2.0",
+    "peerDependencies": {
+        "babylonjs": ">=3.1.0-alpha"
+    },
+    "engines": {
+        "node": "*"
+    },
+    "_id": "babylonjs-materials@3.1.0-alpha1",
+    "_from": "babylonjs-materials@"
+}

+ 51 - 0
dist/materialsLibrary/readme.md

@@ -0,0 +1,51 @@
+Babylon.js Materials Library
+=====================
+
+For usage documentation please visit http://doc.babylonjs.com/extensions and choose "materials library".
+
+# Installation instructions
+
+## CDN
+
+Compiled js files (minified and source) are offered on our public CDN here:
+
+* https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.js
+* https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js
+
+## NPM
+
+To install using npm :
+
+```
+npm install --save babylonjs babylonjs-materials
+```
+
+If using TypeScript, the typing needs to be added to tsconfig.json:
+
+```
+    ....
+    "types": [
+        "babylonjs",
+        "babylonjs-materials",
+        "oneMoreDependencyThatIReallyNeed"
+    ],
+    ....
+```
+
+Afterwards it can be imported to the project using:
+
+```
+import * as BABYLON from 'babylonjs';
+import 'babylonjs-materials';
+```
+
+This will extend Babylon's namespace with the materials available:
+
+```
+// Some awesome code
+let skyMaterial = new BABYLON.SkyMaterial("skyMaterial", scene);
+skyMaterial.backFaceCulling = false;
+// Some more awesome code
+```
+
+Using webpack to package your project will use the minified js file.

+ 0 - 0
dist/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts


Some files were not shown because too many files changed in this diff