浏览代码

Finish GUI documentation

David Catuhe 7 年之前
父节点
当前提交
6d569bfece

文件差异内容过多而无法显示
+ 9427 - 9140
Playground/babylon.d.txt


文件差异内容过多而无法显示
+ 684 - 686
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 46 - 46
dist/preview release/babylon.js


+ 56 - 50
dist/preview release/babylon.max.js

@@ -11972,42 +11972,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_R32F", {
+        Object.defineProperty(Engine, "TEXTUREFORMAT_R", {
             /**
-             * R32F
+             * R
              */
             get: function () {
-                return Engine._TEXTUREFORMAT_R32F;
+                return Engine._TEXTUREFORMAT_R;
             },
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RG32F", {
+        Object.defineProperty(Engine, "TEXTUREFORMAT_RG", {
             /**
-             * RG32F
+             * RG
              */
             get: function () {
-                return Engine._TEXTUREFORMAT_RG32F;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGB32F", {
-            /**
-             * RGB32F
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGB32F;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA32F", {
-            /**
-             * RGBA32F
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGBA32F;
+                return Engine._TEXTUREFORMAT_RG;
             },
             enumerable: true,
             configurable: true
@@ -16056,10 +16036,14 @@ var BABYLON;
          * @param format defines the data format
          * @param invertY defines if data must be stored with Y axis inverted
          * @param compression defines the used compression (can be null)
+         * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
-        Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression) {
+        Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression, textureType) {
             if (compression === void 0) { compression = null; }
+            if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
+            var internalType = this._getWebGLTextureType(textureType);
             var internalFormat = this._getInternalFormat(format);
+            var internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);
             this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
             this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
             if (!this._doNotHandleContextLost) {
@@ -16075,7 +16059,7 @@ var BABYLON;
                 this._gl.compressedTexImage3D(this._gl.TEXTURE_3D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data);
             }
             else {
-                this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalFormat, texture.width, texture.height, texture.depth, 0, internalFormat, this._gl.UNSIGNED_BYTE, data);
+                this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);
             }
             if (texture.generateMipMaps) {
                 this._gl.generateMipmap(this._gl.TEXTURE_3D);
@@ -16095,10 +16079,12 @@ var BABYLON;
          * @param invertY defines if data must be stored with Y axis inverted
          * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
          * @param compression defines the compressed used (can be null)
+         * @param textureType defines the compressed used (can be null)
          * @returns a new raw 3D texture (stored in an InternalTexture)
          */
-        Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression) {
+        Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression, textureType) {
             if (compression === void 0) { compression = null; }
+            if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW3D);
             texture.baseWidth = width;
             texture.baseHeight = height;
@@ -16107,13 +16093,14 @@ var BABYLON;
             texture.height = height;
             texture.depth = depth;
             texture.format = format;
+            texture.type = textureType;
             texture.generateMipMaps = generateMipMaps;
             texture.samplingMode = samplingMode;
             texture.is3D = true;
             if (!this._doNotHandleContextLost) {
                 texture._bufferView = data;
             }
-            this.updateRawTexture3D(texture, data, format, invertY, compression);
+            this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);
             this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
             // Filters
             var filters = getSamplingParameters(samplingMode, generateMipMaps, this._gl);
@@ -17064,17 +17051,15 @@ var BABYLON;
                     internalFormat = this._gl.LUMINANCE_ALPHA;
                     break;
                 case Engine.TEXTUREFORMAT_RGB:
-                case Engine.TEXTUREFORMAT_RGB32F:
                     internalFormat = this._gl.RGB;
                     break;
                 case Engine.TEXTUREFORMAT_RGBA:
-                case Engine.TEXTUREFORMAT_RGBA32F:
                     internalFormat = this._gl.RGBA;
                     break;
-                case Engine.TEXTUREFORMAT_R32F:
+                case Engine.TEXTUREFORMAT_R:
                     internalFormat = this._gl.RED;
                     break;
-                case Engine.TEXTUREFORMAT_RG32F:
+                case Engine.TEXTUREFORMAT_RG:
                     internalFormat = this._gl.RG;
                     break;
             }
@@ -17096,17 +17081,27 @@ var BABYLON;
             if (type === Engine.TEXTURETYPE_FLOAT) {
                 if (format !== undefined) {
                     switch (format) {
-                        case Engine.TEXTUREFORMAT_R32F:
+                        case Engine.TEXTUREFORMAT_R:
                             return this._gl.R32F;
-                        case Engine.TEXTUREFORMAT_RG32F:
+                        case Engine.TEXTUREFORMAT_RG:
                             return this._gl.RG32F;
-                        case Engine.TEXTUREFORMAT_RGB32F:
+                        case Engine.TEXTUREFORMAT_RGB:
                             return this._gl.RGB32F;
                     }
                 }
                 return this._gl.RGBA32F;
             }
-            else if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
+            if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
+                if (format) {
+                    switch (format) {
+                        case Engine.TEXTUREFORMAT_R:
+                            return this._gl.R16F;
+                        case Engine.TEXTUREFORMAT_RG:
+                            return this._gl.RG16F;
+                        case Engine.TEXTUREFORMAT_RGB:
+                            return this._gl.RGB16F;
+                    }
+                }
                 return this._gl.RGBA16F;
             }
             if (format !== undefined) {
@@ -17115,6 +17110,10 @@ var BABYLON;
                         return this._gl.LUMINANCE;
                     case Engine.TEXTUREFORMAT_RGB:
                         return this._gl.RGB;
+                    case Engine.TEXTUREFORMAT_R:
+                        return this._gl.R8;
+                    case Engine.TEXTUREFORMAT_RG:
+                        return this._gl.RG8;
                     case Engine.TEXTUREFORMAT_ALPHA:
                         return this._gl.ALPHA;
                 }
@@ -17464,10 +17463,8 @@ var BABYLON;
         Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
         Engine._TEXTUREFORMAT_RGB = 4;
         Engine._TEXTUREFORMAT_RGBA = 5;
-        Engine._TEXTUREFORMAT_R32F = 6;
-        Engine._TEXTUREFORMAT_RG32F = 7;
-        Engine._TEXTUREFORMAT_RGB32F = 8;
-        Engine._TEXTUREFORMAT_RGBA32F = 9;
+        Engine._TEXTUREFORMAT_R = 6;
+        Engine._TEXTUREFORMAT_RG = 7;
         Engine._TEXTURETYPE_UNSIGNED_INT = 0;
         Engine._TEXTURETYPE_FLOAT = 1;
         Engine._TEXTURETYPE_HALF_FLOAT = 2;
@@ -58016,7 +58013,7 @@ var BABYLON;
                 d.push(Math.random());
                 d.push(Math.random());
             }
-            this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA32F, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
+            this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
             this._randomTexture.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE;
             this._randomTexture.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE;
             this._randomTextureSize = maxTextureSize;
@@ -65626,17 +65623,19 @@ var BABYLON;
          * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
          * @param invertY defines if texture must be stored with Y axis inverted
          * @param samplingMode defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)
+         * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
         function RawTexture3D(data, width, height, depth, 
-        /** Gets or sets the texture format to use*/
-        format, scene, generateMipMaps, invertY, samplingMode) {
+        /** Gets or sets the texture format to use */
+        format, scene, generateMipMaps, invertY, samplingMode, textureType) {
             if (generateMipMaps === void 0) { generateMipMaps = true; }
             if (invertY === void 0) { invertY = false; }
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             var _this = _super.call(this, null, scene, !generateMipMaps, invertY) || this;
             _this.format = format;
             _this._engine = scene.getEngine();
-            _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode);
+            _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, undefined, textureType);
             _this.is3D = true;
             return _this;
         }
@@ -65648,7 +65647,7 @@ var BABYLON;
             if (!this._texture) {
                 return;
             }
-            this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY);
+            this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, undefined, this._texture.type);
         };
         return RawTexture3D;
     }(BABYLON.Texture));
@@ -93470,10 +93469,17 @@ var BABYLON;
             var blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;
             blurTextureWidth = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;
             blurTextureHeight = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;
+            var textureType = 0;
+            if (this._engine.getCaps().textureHalfFloatRender) {
+                textureType = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
+            }
+            else {
+                textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
+            }
             this._blurTexture = new BABYLON.RenderTargetTexture("HighlightLayerBlurRTT", {
                 width: blurTextureWidth,
                 height: blurTextureHeight
-            }, this._scene, false, true, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+            }, this._scene, false, true, textureType);
             this._blurTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._blurTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._blurTexture.anisotropicFilteringLevel = 16;
@@ -93500,7 +93506,7 @@ var BABYLON;
                 this._horizontalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerHBP", new BABYLON.Vector2(1.0, 0), this._options.blurHorizontalSize / 2, {
                     width: blurTextureWidth,
                     height: blurTextureHeight
-                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
                 this._horizontalBlurPostprocess.width = blurTextureWidth;
                 this._horizontalBlurPostprocess.height = blurTextureHeight;
                 this._horizontalBlurPostprocess.onApplyObservable.add(function (effect) {
@@ -93509,7 +93515,7 @@ var BABYLON;
                 this._verticalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerVBP", new BABYLON.Vector2(0, 1.0), this._options.blurVerticalSize / 2, {
                     width: blurTextureWidth,
                     height: blurTextureHeight
-                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
                 this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];
             }
             this._mainTexture.onAfterUnbindObservable.add(function () {

+ 56 - 50
dist/preview release/babylon.no-module.max.js

@@ -11939,42 +11939,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_R32F", {
+        Object.defineProperty(Engine, "TEXTUREFORMAT_R", {
             /**
-             * R32F
+             * R
              */
             get: function () {
-                return Engine._TEXTUREFORMAT_R32F;
+                return Engine._TEXTUREFORMAT_R;
             },
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RG32F", {
+        Object.defineProperty(Engine, "TEXTUREFORMAT_RG", {
             /**
-             * RG32F
+             * RG
              */
             get: function () {
-                return Engine._TEXTUREFORMAT_RG32F;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGB32F", {
-            /**
-             * RGB32F
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGB32F;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA32F", {
-            /**
-             * RGBA32F
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGBA32F;
+                return Engine._TEXTUREFORMAT_RG;
             },
             enumerable: true,
             configurable: true
@@ -16023,10 +16003,14 @@ var BABYLON;
          * @param format defines the data format
          * @param invertY defines if data must be stored with Y axis inverted
          * @param compression defines the used compression (can be null)
+         * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
-        Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression) {
+        Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression, textureType) {
             if (compression === void 0) { compression = null; }
+            if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
+            var internalType = this._getWebGLTextureType(textureType);
             var internalFormat = this._getInternalFormat(format);
+            var internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);
             this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
             this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
             if (!this._doNotHandleContextLost) {
@@ -16042,7 +16026,7 @@ var BABYLON;
                 this._gl.compressedTexImage3D(this._gl.TEXTURE_3D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data);
             }
             else {
-                this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalFormat, texture.width, texture.height, texture.depth, 0, internalFormat, this._gl.UNSIGNED_BYTE, data);
+                this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);
             }
             if (texture.generateMipMaps) {
                 this._gl.generateMipmap(this._gl.TEXTURE_3D);
@@ -16062,10 +16046,12 @@ var BABYLON;
          * @param invertY defines if data must be stored with Y axis inverted
          * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
          * @param compression defines the compressed used (can be null)
+         * @param textureType defines the compressed used (can be null)
          * @returns a new raw 3D texture (stored in an InternalTexture)
          */
-        Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression) {
+        Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression, textureType) {
             if (compression === void 0) { compression = null; }
+            if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW3D);
             texture.baseWidth = width;
             texture.baseHeight = height;
@@ -16074,13 +16060,14 @@ var BABYLON;
             texture.height = height;
             texture.depth = depth;
             texture.format = format;
+            texture.type = textureType;
             texture.generateMipMaps = generateMipMaps;
             texture.samplingMode = samplingMode;
             texture.is3D = true;
             if (!this._doNotHandleContextLost) {
                 texture._bufferView = data;
             }
-            this.updateRawTexture3D(texture, data, format, invertY, compression);
+            this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);
             this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
             // Filters
             var filters = getSamplingParameters(samplingMode, generateMipMaps, this._gl);
@@ -17031,17 +17018,15 @@ var BABYLON;
                     internalFormat = this._gl.LUMINANCE_ALPHA;
                     break;
                 case Engine.TEXTUREFORMAT_RGB:
-                case Engine.TEXTUREFORMAT_RGB32F:
                     internalFormat = this._gl.RGB;
                     break;
                 case Engine.TEXTUREFORMAT_RGBA:
-                case Engine.TEXTUREFORMAT_RGBA32F:
                     internalFormat = this._gl.RGBA;
                     break;
-                case Engine.TEXTUREFORMAT_R32F:
+                case Engine.TEXTUREFORMAT_R:
                     internalFormat = this._gl.RED;
                     break;
-                case Engine.TEXTUREFORMAT_RG32F:
+                case Engine.TEXTUREFORMAT_RG:
                     internalFormat = this._gl.RG;
                     break;
             }
@@ -17063,17 +17048,27 @@ var BABYLON;
             if (type === Engine.TEXTURETYPE_FLOAT) {
                 if (format !== undefined) {
                     switch (format) {
-                        case Engine.TEXTUREFORMAT_R32F:
+                        case Engine.TEXTUREFORMAT_R:
                             return this._gl.R32F;
-                        case Engine.TEXTUREFORMAT_RG32F:
+                        case Engine.TEXTUREFORMAT_RG:
                             return this._gl.RG32F;
-                        case Engine.TEXTUREFORMAT_RGB32F:
+                        case Engine.TEXTUREFORMAT_RGB:
                             return this._gl.RGB32F;
                     }
                 }
                 return this._gl.RGBA32F;
             }
-            else if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
+            if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
+                if (format) {
+                    switch (format) {
+                        case Engine.TEXTUREFORMAT_R:
+                            return this._gl.R16F;
+                        case Engine.TEXTUREFORMAT_RG:
+                            return this._gl.RG16F;
+                        case Engine.TEXTUREFORMAT_RGB:
+                            return this._gl.RGB16F;
+                    }
+                }
                 return this._gl.RGBA16F;
             }
             if (format !== undefined) {
@@ -17082,6 +17077,10 @@ var BABYLON;
                         return this._gl.LUMINANCE;
                     case Engine.TEXTUREFORMAT_RGB:
                         return this._gl.RGB;
+                    case Engine.TEXTUREFORMAT_R:
+                        return this._gl.R8;
+                    case Engine.TEXTUREFORMAT_RG:
+                        return this._gl.RG8;
                     case Engine.TEXTUREFORMAT_ALPHA:
                         return this._gl.ALPHA;
                 }
@@ -17431,10 +17430,8 @@ var BABYLON;
         Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
         Engine._TEXTUREFORMAT_RGB = 4;
         Engine._TEXTUREFORMAT_RGBA = 5;
-        Engine._TEXTUREFORMAT_R32F = 6;
-        Engine._TEXTUREFORMAT_RG32F = 7;
-        Engine._TEXTUREFORMAT_RGB32F = 8;
-        Engine._TEXTUREFORMAT_RGBA32F = 9;
+        Engine._TEXTUREFORMAT_R = 6;
+        Engine._TEXTUREFORMAT_RG = 7;
         Engine._TEXTURETYPE_UNSIGNED_INT = 0;
         Engine._TEXTURETYPE_FLOAT = 1;
         Engine._TEXTURETYPE_HALF_FLOAT = 2;
@@ -57983,7 +57980,7 @@ var BABYLON;
                 d.push(Math.random());
                 d.push(Math.random());
             }
-            this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA32F, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
+            this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
             this._randomTexture.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE;
             this._randomTexture.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE;
             this._randomTextureSize = maxTextureSize;
@@ -65593,17 +65590,19 @@ var BABYLON;
          * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
          * @param invertY defines if texture must be stored with Y axis inverted
          * @param samplingMode defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)
+         * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
         function RawTexture3D(data, width, height, depth, 
-        /** Gets or sets the texture format to use*/
-        format, scene, generateMipMaps, invertY, samplingMode) {
+        /** Gets or sets the texture format to use */
+        format, scene, generateMipMaps, invertY, samplingMode, textureType) {
             if (generateMipMaps === void 0) { generateMipMaps = true; }
             if (invertY === void 0) { invertY = false; }
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             var _this = _super.call(this, null, scene, !generateMipMaps, invertY) || this;
             _this.format = format;
             _this._engine = scene.getEngine();
-            _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode);
+            _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, undefined, textureType);
             _this.is3D = true;
             return _this;
         }
@@ -65615,7 +65614,7 @@ var BABYLON;
             if (!this._texture) {
                 return;
             }
-            this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY);
+            this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, undefined, this._texture.type);
         };
         return RawTexture3D;
     }(BABYLON.Texture));
@@ -93437,10 +93436,17 @@ var BABYLON;
             var blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;
             blurTextureWidth = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;
             blurTextureHeight = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;
+            var textureType = 0;
+            if (this._engine.getCaps().textureHalfFloatRender) {
+                textureType = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
+            }
+            else {
+                textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
+            }
             this._blurTexture = new BABYLON.RenderTargetTexture("HighlightLayerBlurRTT", {
                 width: blurTextureWidth,
                 height: blurTextureHeight
-            }, this._scene, false, true, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+            }, this._scene, false, true, textureType);
             this._blurTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._blurTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._blurTexture.anisotropicFilteringLevel = 16;
@@ -93467,7 +93473,7 @@ var BABYLON;
                 this._horizontalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerHBP", new BABYLON.Vector2(1.0, 0), this._options.blurHorizontalSize / 2, {
                     width: blurTextureWidth,
                     height: blurTextureHeight
-                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
                 this._horizontalBlurPostprocess.width = blurTextureWidth;
                 this._horizontalBlurPostprocess.height = blurTextureHeight;
                 this._horizontalBlurPostprocess.onApplyObservable.add(function (effect) {
@@ -93476,7 +93482,7 @@ var BABYLON;
                 this._verticalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerVBP", new BABYLON.Vector2(0, 1.0), this._options.blurVerticalSize / 2, {
                     width: blurTextureWidth,
                     height: blurTextureHeight
-                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
                 this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];
             }
             this._mainTexture.onAfterUnbindObservable.add(function () {

文件差异内容过多而无法显示
+ 46 - 46
dist/preview release/babylon.worker.js


+ 56 - 50
dist/preview release/es6.js

@@ -11939,42 +11939,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_R32F", {
+        Object.defineProperty(Engine, "TEXTUREFORMAT_R", {
             /**
-             * R32F
+             * R
              */
             get: function () {
-                return Engine._TEXTUREFORMAT_R32F;
+                return Engine._TEXTUREFORMAT_R;
             },
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RG32F", {
+        Object.defineProperty(Engine, "TEXTUREFORMAT_RG", {
             /**
-             * RG32F
+             * RG
              */
             get: function () {
-                return Engine._TEXTUREFORMAT_RG32F;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGB32F", {
-            /**
-             * RGB32F
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGB32F;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA32F", {
-            /**
-             * RGBA32F
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGBA32F;
+                return Engine._TEXTUREFORMAT_RG;
             },
             enumerable: true,
             configurable: true
@@ -16023,10 +16003,14 @@ var BABYLON;
          * @param format defines the data format
          * @param invertY defines if data must be stored with Y axis inverted
          * @param compression defines the used compression (can be null)
+         * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
-        Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression) {
+        Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression, textureType) {
             if (compression === void 0) { compression = null; }
+            if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
+            var internalType = this._getWebGLTextureType(textureType);
             var internalFormat = this._getInternalFormat(format);
+            var internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);
             this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
             this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
             if (!this._doNotHandleContextLost) {
@@ -16042,7 +16026,7 @@ var BABYLON;
                 this._gl.compressedTexImage3D(this._gl.TEXTURE_3D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data);
             }
             else {
-                this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalFormat, texture.width, texture.height, texture.depth, 0, internalFormat, this._gl.UNSIGNED_BYTE, data);
+                this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);
             }
             if (texture.generateMipMaps) {
                 this._gl.generateMipmap(this._gl.TEXTURE_3D);
@@ -16062,10 +16046,12 @@ var BABYLON;
          * @param invertY defines if data must be stored with Y axis inverted
          * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
          * @param compression defines the compressed used (can be null)
+         * @param textureType defines the compressed used (can be null)
          * @returns a new raw 3D texture (stored in an InternalTexture)
          */
-        Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression) {
+        Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression, textureType) {
             if (compression === void 0) { compression = null; }
+            if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW3D);
             texture.baseWidth = width;
             texture.baseHeight = height;
@@ -16074,13 +16060,14 @@ var BABYLON;
             texture.height = height;
             texture.depth = depth;
             texture.format = format;
+            texture.type = textureType;
             texture.generateMipMaps = generateMipMaps;
             texture.samplingMode = samplingMode;
             texture.is3D = true;
             if (!this._doNotHandleContextLost) {
                 texture._bufferView = data;
             }
-            this.updateRawTexture3D(texture, data, format, invertY, compression);
+            this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);
             this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
             // Filters
             var filters = getSamplingParameters(samplingMode, generateMipMaps, this._gl);
@@ -17031,17 +17018,15 @@ var BABYLON;
                     internalFormat = this._gl.LUMINANCE_ALPHA;
                     break;
                 case Engine.TEXTUREFORMAT_RGB:
-                case Engine.TEXTUREFORMAT_RGB32F:
                     internalFormat = this._gl.RGB;
                     break;
                 case Engine.TEXTUREFORMAT_RGBA:
-                case Engine.TEXTUREFORMAT_RGBA32F:
                     internalFormat = this._gl.RGBA;
                     break;
-                case Engine.TEXTUREFORMAT_R32F:
+                case Engine.TEXTUREFORMAT_R:
                     internalFormat = this._gl.RED;
                     break;
-                case Engine.TEXTUREFORMAT_RG32F:
+                case Engine.TEXTUREFORMAT_RG:
                     internalFormat = this._gl.RG;
                     break;
             }
@@ -17063,17 +17048,27 @@ var BABYLON;
             if (type === Engine.TEXTURETYPE_FLOAT) {
                 if (format !== undefined) {
                     switch (format) {
-                        case Engine.TEXTUREFORMAT_R32F:
+                        case Engine.TEXTUREFORMAT_R:
                             return this._gl.R32F;
-                        case Engine.TEXTUREFORMAT_RG32F:
+                        case Engine.TEXTUREFORMAT_RG:
                             return this._gl.RG32F;
-                        case Engine.TEXTUREFORMAT_RGB32F:
+                        case Engine.TEXTUREFORMAT_RGB:
                             return this._gl.RGB32F;
                     }
                 }
                 return this._gl.RGBA32F;
             }
-            else if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
+            if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
+                if (format) {
+                    switch (format) {
+                        case Engine.TEXTUREFORMAT_R:
+                            return this._gl.R16F;
+                        case Engine.TEXTUREFORMAT_RG:
+                            return this._gl.RG16F;
+                        case Engine.TEXTUREFORMAT_RGB:
+                            return this._gl.RGB16F;
+                    }
+                }
                 return this._gl.RGBA16F;
             }
             if (format !== undefined) {
@@ -17082,6 +17077,10 @@ var BABYLON;
                         return this._gl.LUMINANCE;
                     case Engine.TEXTUREFORMAT_RGB:
                         return this._gl.RGB;
+                    case Engine.TEXTUREFORMAT_R:
+                        return this._gl.R8;
+                    case Engine.TEXTUREFORMAT_RG:
+                        return this._gl.RG8;
                     case Engine.TEXTUREFORMAT_ALPHA:
                         return this._gl.ALPHA;
                 }
@@ -17431,10 +17430,8 @@ var BABYLON;
         Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
         Engine._TEXTUREFORMAT_RGB = 4;
         Engine._TEXTUREFORMAT_RGBA = 5;
-        Engine._TEXTUREFORMAT_R32F = 6;
-        Engine._TEXTUREFORMAT_RG32F = 7;
-        Engine._TEXTUREFORMAT_RGB32F = 8;
-        Engine._TEXTUREFORMAT_RGBA32F = 9;
+        Engine._TEXTUREFORMAT_R = 6;
+        Engine._TEXTUREFORMAT_RG = 7;
         Engine._TEXTURETYPE_UNSIGNED_INT = 0;
         Engine._TEXTURETYPE_FLOAT = 1;
         Engine._TEXTURETYPE_HALF_FLOAT = 2;
@@ -57983,7 +57980,7 @@ var BABYLON;
                 d.push(Math.random());
                 d.push(Math.random());
             }
-            this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA32F, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
+            this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
             this._randomTexture.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE;
             this._randomTexture.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE;
             this._randomTextureSize = maxTextureSize;
@@ -65593,17 +65590,19 @@ var BABYLON;
          * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
          * @param invertY defines if texture must be stored with Y axis inverted
          * @param samplingMode defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)
+         * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
         function RawTexture3D(data, width, height, depth, 
-        /** Gets or sets the texture format to use*/
-        format, scene, generateMipMaps, invertY, samplingMode) {
+        /** Gets or sets the texture format to use */
+        format, scene, generateMipMaps, invertY, samplingMode, textureType) {
             if (generateMipMaps === void 0) { generateMipMaps = true; }
             if (invertY === void 0) { invertY = false; }
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             var _this = _super.call(this, null, scene, !generateMipMaps, invertY) || this;
             _this.format = format;
             _this._engine = scene.getEngine();
-            _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode);
+            _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, undefined, textureType);
             _this.is3D = true;
             return _this;
         }
@@ -65615,7 +65614,7 @@ var BABYLON;
             if (!this._texture) {
                 return;
             }
-            this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY);
+            this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, undefined, this._texture.type);
         };
         return RawTexture3D;
     }(BABYLON.Texture));
@@ -93437,10 +93436,17 @@ var BABYLON;
             var blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;
             blurTextureWidth = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;
             blurTextureHeight = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;
+            var textureType = 0;
+            if (this._engine.getCaps().textureHalfFloatRender) {
+                textureType = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
+            }
+            else {
+                textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
+            }
             this._blurTexture = new BABYLON.RenderTargetTexture("HighlightLayerBlurRTT", {
                 width: blurTextureWidth,
                 height: blurTextureHeight
-            }, this._scene, false, true, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+            }, this._scene, false, true, textureType);
             this._blurTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._blurTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._blurTexture.anisotropicFilteringLevel = 16;
@@ -93467,7 +93473,7 @@ var BABYLON;
                 this._horizontalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerHBP", new BABYLON.Vector2(1.0, 0), this._options.blurHorizontalSize / 2, {
                     width: blurTextureWidth,
                     height: blurTextureHeight
-                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
                 this._horizontalBlurPostprocess.width = blurTextureWidth;
                 this._horizontalBlurPostprocess.height = blurTextureHeight;
                 this._horizontalBlurPostprocess.onApplyObservable.add(function (effect) {
@@ -93476,7 +93482,7 @@ var BABYLON;
                 this._verticalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerVBP", new BABYLON.Vector2(0, 1.0), this._options.blurVerticalSize / 2, {
                     width: blurTextureWidth,
                     height: blurTextureHeight
-                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
                 this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];
             }
             this._mainTexture.onAfterUnbindObservable.add(function () {

+ 223 - 3
dist/preview release/gui/babylon.gui.d.ts

@@ -369,6 +369,7 @@ declare module BABYLON.GUI {
         isEqualsTo(other: Measure): boolean;
         /**
          * Creates an empty measure
+         * @returns a new measure
          */
         static Empty(): Measure;
     }
@@ -380,25 +381,91 @@ declare module BABYLON.GUI {
      * Class used to transport Vector2 information for pointer events
      */
     class Vector2WithInfo extends Vector2 {
+        /** defines the current mouse button index */
         buttonIndex: number;
         /**
          * Creates a new Vector2WithInfo
          * @param source defines the vector2 data to transport
          * @param buttonIndex defines the current mouse button index
          */
-        constructor(source: Vector2, buttonIndex?: number);
+        constructor(source: Vector2, 
+            /** defines the current mouse button index */
+            buttonIndex?: number);
     }
+    /** Class used to provide 2D matrix features */
     class Matrix2D {
+        /** Gets the internal array of 6 floats used to store matrix data */
         m: Float32Array;
+        /**
+         * Creates a new matrix
+         * @param m00 defines value for (0, 0)
+         * @param m01 defines value for (0, 1)
+         * @param m10 defines value for (1, 0)
+         * @param m11 defines value for (1, 1)
+         * @param m20 defines value for (2, 0)
+         * @param m21 defines value for (2, 1)
+         */
         constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
+        /**
+         * Fills the matrix from direct values
+         * @param m00 defines value for (0, 0)
+         * @param m01 defines value for (0, 1)
+         * @param m10 defines value for (1, 0)
+         * @param m11 defines value for (1, 1)
+         * @param m20 defines value for (2, 0)
+         * @param m21 defines value for (2, 1)
+         * @returns the current modified matrix
+         */
         fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D;
+        /**
+         * Gets matrix determinant
+         * @returns the determinant
+         */
         determinant(): number;
+        /**
+         * Inverses the matrix and stores it in a target matrix
+         * @param result defines the target matrix
+         * @returns the current matrix
+         */
         invertToRef(result: Matrix2D): Matrix2D;
+        /**
+         * Multiplies the current matrix with another one
+         * @param other defines the second operand
+         * @param result defines the target matrix
+         * @returns the current matrix
+         */
         multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D;
+        /**
+         * Apply the current matrix to a set of 2 floats and stores the result in a vector2
+         * @param x defines the x coordinate to transform
+         * @param y defines the x coordinate to transform
+         * @param result defines the target vector2
+         * @returns the current matrix
+         */
         transformCoordinates(x: number, y: number, result: Vector2): Matrix2D;
+        /**
+         * Creates an identity matrix
+         */
         static Identity(): Matrix2D;
+        /**
+         * Creates a translation matrix and stores it in a target matrix
+         * @param x defines the x coordinate of the translation
+         * @param y defines the y coordinate of the translation
+         * @param result defines the target matrix
+         */
         static TranslationToRef(x: number, y: number, result: Matrix2D): void;
+        /**
+         * Creates a scaling matrix and stores it in a target matrix
+         * @param x defines the x coordinate of the scaling
+         * @param y defines the y coordinate of the scaling
+         * @param result defines the target matrix
+         */
         static ScalingToRef(x: number, y: number, result: Matrix2D): void;
+        /**
+         * Creates a rotation matrix and stores it in a target matrix
+         * @param angle defines the rotation angle
+         * @param result defines the target matrix
+         */
         static RotationToRef(angle: number, result: Matrix2D): void;
         private static _TempPreTranslationMatrix;
         private static _TempPostTranslationMatrix;
@@ -407,6 +474,16 @@ declare module BABYLON.GUI {
         private static _TempCompose0;
         private static _TempCompose1;
         private static _TempCompose2;
+        /**
+         * Compose a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
+         * @param tx defines the x coordinate of the translation
+         * @param ty defines the y coordinate of the translation
+         * @param angle defines the rotation angle
+         * @param scaleX defines the x coordinate of the scaling
+         * @param scaleY defines the y coordinate of the scaling
+         * @param parentMatrix defines the parent matrix to multiply by (can be null)
+         * @param result defines the target matrix
+         */
         static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void;
     }
 }
@@ -976,6 +1053,9 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create a 2D stack panel container
+     */
     class StackPanel extends Container {
         name: string | undefined;
         private _isVertical;
@@ -983,9 +1063,16 @@ declare module BABYLON.GUI {
         private _manualHeight;
         private _doNotTrackManualChanges;
         private _tempMeasureStore;
+        /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
         isVertical: boolean;
+        /** Gets or sets panel width */
         width: string | number;
+        /** Gets or sets panel height */
         height: string | number;
+        /**
+         * Creates a new StackPanel
+         * @param name defines control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -994,12 +1081,19 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /** Class used to create rectangle container */
     class Rectangle extends Container {
         name: string | undefined;
         private _thickness;
         private _cornerRadius;
+        /** Gets or sets border thickness */
         thickness: number;
+        /** Gets or sets the corner radius angle */
         cornerRadius: number;
+        /**
+         * Creates a new Rectangle
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _localDraw(context: CanvasRenderingContext2D): void;
@@ -1011,7 +1105,7 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
-    /** Class used to render 2D ellipses */
+    /** Class used to create 2D ellipse containers */
     class Ellipse extends Container {
         name: string | undefined;
         private _thickness;
@@ -1044,16 +1138,28 @@ declare module BABYLON.GUI {
         private _connectedControlDirtyObserver;
         /** Gets or sets the dash pattern */
         dash: Array<number>;
+        /** Gets or sets the control connected with the line end */
         connectedControl: Control;
+        /** Gets or sets start coordinates on X axis */
         x1: string | number;
+        /** Gets or sets start coordinates on Y axis */
         y1: string | number;
+        /** Gets or sets end coordinates on X axis */
         x2: string | number;
+        /** Gets or sets end coordinates on Y axis */
         y2: string | number;
+        /** Gets or sets line width */
         lineWidth: number;
+        /** Gets or sets horizontal alignment */
         horizontalAlignment: number;
+        /** Gets or sets vertical alignment */
         verticalAlignment: number;
         private readonly _effectiveX2;
         private readonly _effectiveY2;
+        /**
+         * Creates a new Line
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -1077,6 +1183,9 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create slider controls
+     */
     class Slider extends Control {
         name: string | undefined;
         private _thumbWidth;
@@ -1088,18 +1197,34 @@ declare module BABYLON.GUI {
         private _barOffset;
         private _isThumbCircle;
         private _isThumbClamped;
+        /** Observable raised when the sldier value changes */
         onValueChangedObservable: Observable<number>;
+        /** Gets or sets border color */
         borderColor: string;
+        /** Gets or sets background color */
         background: string;
+        /** Gets or sets main bar offset */
         barOffset: string | number;
+        /** Gets main bar offset in pixels*/
         readonly barOffsetInPixels: number;
+        /** Gets or sets thumb width */
         thumbWidth: string | number;
+        /** Gets thumb width in pixels */
         readonly thumbWidthInPixels: number;
+        /** Gets or sets minimum value */
         minimum: number;
+        /** Gets or sets maximum value */
         maximum: number;
+        /** Gets or sets current value */
         value: number;
+        /** Gets or sets a boolean indicating if the thumb should be round or square */
         isThumbCircle: boolean;
+        /** Gets or sets a value indicating if the thumb can go over main bar extends */
         isThumbClamped: boolean;
+        /**
+         * Creates a new Slider
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -1149,18 +1274,31 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create radio button controls
+     */
     class RadioButton extends Control {
         name: string | undefined;
         private _isChecked;
         private _background;
         private _checkSizeRatio;
         private _thickness;
+        /** Gets or sets border thickness */
         thickness: number;
+        /** Gets or sets group name */
         group: string;
+        /** Observable raised when isChecked is changed */
         onIsCheckedChangedObservable: Observable<boolean>;
+        /** Gets or sets a value indicating the ratio between overall size and check size */
         checkSizeRatio: number;
+        /** Gets or sets background color */
         background: string;
+        /** Gets or sets a boolean indicating if the checkbox is checked or not */
         isChecked: boolean;
+        /**
+         * Creates a new RadioButton
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -1170,6 +1308,9 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create text block control
+     */
     class TextBlock extends Control {
         /**
          * Defines the name of the control
@@ -1572,46 +1713,96 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to store key control properties
+     */
     class KeyPropertySet {
+        /** Width */
         width?: string;
+        /** Height */
         height?: string;
+        /** Left padding */
         paddingLeft?: string;
+        /** Right padding */
         paddingRight?: string;
+        /** Top padding */
         paddingTop?: string;
+        /** Bottom padding */
         paddingBottom?: string;
+        /** Foreground color */
         color?: string;
+        /** Background color */
         background?: string;
     }
+    /**
+     * Class used to create virtual keyboard
+     */
     class VirtualKeyboard extends StackPanel {
+        /** Observable raised when a key is pressed */
         onKeyPressObservable: Observable<string>;
+        /** Gets or sets default key button width */
         defaultButtonWidth: string;
+        /** Gets or sets default key button height */
         defaultButtonHeight: string;
+        /** Gets or sets default key button left padding */
         defaultButtonPaddingLeft: string;
+        /** Gets or sets default key button right padding */
         defaultButtonPaddingRight: string;
+        /** Gets or sets default key button top padding */
         defaultButtonPaddingTop: string;
+        /** Gets or sets default key button bottom padding */
         defaultButtonPaddingBottom: string;
+        /** Gets or sets default key button foreground color */
         defaultButtonColor: string;
+        /** Gets or sets default key button background color */
         defaultButtonBackground: string;
+        /** Gets or sets shift button foreground color */
         shiftButtonColor: string;
+        /** Gets or sets shift button thickness*/
         selectedShiftThickness: number;
+        /** Gets shift key state */
         shiftState: number;
         protected _getTypeName(): string;
         private _createKey(key, propertySet);
+        /**
+         * Adds a new row of keys
+         * @param keys defines the list of keys to add
+         * @param propertySets defines the associated property sets
+         */
         addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
+        /**
+         * Set the shift key to a specific state
+         * @param shiftState defines the new shift state
+         */
         applyShiftState(shiftState: number): void;
         private _connectedInputText;
         private _onFocusObserver;
         private _onBlurObserver;
         private _onKeyPressObserver;
+        /** Gets the input text control attached with the keyboard */
         readonly connectedInputText: Nullable<InputText>;
+        /**
+         * Connects the keyboard with an input text control
+         * @param input defines the target control
+         */
         connect(input: InputText): void;
+        /**
+         * Disconnects the keyboard from an input text control
+         */
         disconnect(): void;
+        /**
+         * Creates a new keyboard using a default layout
+         * @returns a new VirtualKeyboard
+         */
         static CreateDefaultLayout(): VirtualKeyboard;
     }
 }
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create multi line control
+     */
     class MultiLine extends Control {
         name: string | undefined;
         private _lineWidth;
@@ -1621,19 +1812,45 @@ declare module BABYLON.GUI {
         private _minY;
         private _maxX;
         private _maxY;
+        /**
+         * Creates a new MultiLine
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
+        /** Gets or sets dash pattern */
         dash: Array<number>;
+        /**
+         * Gets point stored at specified index
+         * @param index defines the index to look for
+         * @returns the requested point if found
+         */
         getAt(index: number): MultiLinePoint;
+        /** Function called when a point is updated */
         onPointUpdate: () => void;
+        /**
+         * Adds new points to the point collection
+         * @param items defines the list of items (mesh, control or 2d coordiantes) to add
+         * @returns the list of created MultiLinePoint
+         */
         add(...items: (AbstractMesh | Control | {
             x: string | number;
             y: string | number;
         })[]): MultiLinePoint[];
+        /**
+         * Adds a new point to the point collection
+         * @param item defines the item (mesh, control or 2d coordiantes) to add
+         * @returns the created MultiLinePoint
+         */
         push(item?: (AbstractMesh | Control | {
             x: string | number;
             y: string | number;
         })): MultiLinePoint;
+        /**
+         * Remove a specific value or point from the active point collection
+         * @param value defines the value or point to remove
+         */
         remove(value: number | MultiLinePoint): void;
+        /** Gets or sets line width */
         lineWidth: number;
         horizontalAlignment: number;
         verticalAlignment: number;
@@ -1802,13 +2019,16 @@ declare module BABYLON.GUI {
      * Class used to transport Vector3 information for pointer events
      */
     class Vector3WithInfo extends Vector3 {
+        /** defines the current mouse button index */
         buttonIndex: number;
         /**
          * Creates a new Vector3WithInfo
          * @param source defines the vector3 data to transport
          * @param buttonIndex defines the current mouse button index
          */
-        constructor(source: Vector3, buttonIndex?: number);
+        constructor(source: Vector3, 
+            /** defines the current mouse button index */
+            buttonIndex?: number);
     }
 }
 

+ 213 - 3
dist/preview release/gui/babylon.gui.js

@@ -1028,6 +1028,7 @@ var BABYLON;
             };
             /**
              * Creates an empty measure
+             * @returns a new measure
              */
             Measure.Empty = function () {
                 return new Measure(0, 0, 0, 0);
@@ -1056,7 +1057,9 @@ var BABYLON;
              * @param source defines the vector2 data to transport
              * @param buttonIndex defines the current mouse button index
              */
-            function Vector2WithInfo(source, buttonIndex) {
+            function Vector2WithInfo(source, 
+            /** defines the current mouse button index */
+            buttonIndex) {
                 if (buttonIndex === void 0) { buttonIndex = 0; }
                 var _this = _super.call(this, source.x, source.y) || this;
                 _this.buttonIndex = buttonIndex;
@@ -1065,11 +1068,32 @@ var BABYLON;
             return Vector2WithInfo;
         }(BABYLON.Vector2));
         GUI.Vector2WithInfo = Vector2WithInfo;
+        /** Class used to provide 2D matrix features */
         var Matrix2D = /** @class */ (function () {
+            /**
+             * Creates a new matrix
+             * @param m00 defines value for (0, 0)
+             * @param m01 defines value for (0, 1)
+             * @param m10 defines value for (1, 0)
+             * @param m11 defines value for (1, 1)
+             * @param m20 defines value for (2, 0)
+             * @param m21 defines value for (2, 1)
+             */
             function Matrix2D(m00, m01, m10, m11, m20, m21) {
+                /** Gets the internal array of 6 floats used to store matrix data */
                 this.m = new Float32Array(6);
                 this.fromValues(m00, m01, m10, m11, m20, m21);
             }
+            /**
+             * Fills the matrix from direct values
+             * @param m00 defines value for (0, 0)
+             * @param m01 defines value for (0, 1)
+             * @param m10 defines value for (1, 0)
+             * @param m11 defines value for (1, 1)
+             * @param m20 defines value for (2, 0)
+             * @param m21 defines value for (2, 1)
+             * @returns the current modified matrix
+             */
             Matrix2D.prototype.fromValues = function (m00, m01, m10, m11, m20, m21) {
                 this.m[0] = m00;
                 this.m[1] = m01;
@@ -1079,9 +1103,18 @@ var BABYLON;
                 this.m[5] = m21;
                 return this;
             };
+            /**
+             * Gets matrix determinant
+             * @returns the determinant
+             */
             Matrix2D.prototype.determinant = function () {
                 return this.m[0] * this.m[3] - this.m[1] * this.m[2];
             };
+            /**
+             * Inverses the matrix and stores it in a target matrix
+             * @param result defines the target matrix
+             * @returns the current matrix
+             */
             Matrix2D.prototype.invertToRef = function (result) {
                 var l0 = this.m[0];
                 var l1 = this.m[1];
@@ -1110,6 +1143,12 @@ var BABYLON;
                 result.m[5] = det5 * detDiv;
                 return this;
             };
+            /**
+             * Multiplies the current matrix with another one
+             * @param other defines the second operand
+             * @param result defines the target matrix
+             * @returns the current matrix
+             */
             Matrix2D.prototype.multiplyToRef = function (other, result) {
                 var l0 = this.m[0];
                 var l1 = this.m[1];
@@ -1131,26 +1170,63 @@ var BABYLON;
                 result.m[5] = l4 * r1 + l5 * r3 + r5;
                 return this;
             };
+            /**
+             * Apply the current matrix to a set of 2 floats and stores the result in a vector2
+             * @param x defines the x coordinate to transform
+             * @param y defines the x coordinate to transform
+             * @param result defines the target vector2
+             * @returns the current matrix
+             */
             Matrix2D.prototype.transformCoordinates = function (x, y, result) {
                 result.x = x * this.m[0] + y * this.m[2] + this.m[4];
                 result.y = x * this.m[1] + y * this.m[3] + this.m[5];
                 return this;
             };
             // Statics
+            /**
+             * Creates an identity matrix
+             */
             Matrix2D.Identity = function () {
                 return new Matrix2D(1, 0, 0, 1, 0, 0);
             };
+            /**
+             * Creates a translation matrix and stores it in a target matrix
+             * @param x defines the x coordinate of the translation
+             * @param y defines the y coordinate of the translation
+             * @param result defines the target matrix
+             */
             Matrix2D.TranslationToRef = function (x, y, result) {
                 result.fromValues(1, 0, 0, 1, x, y);
             };
+            /**
+             * Creates a scaling matrix and stores it in a target matrix
+             * @param x defines the x coordinate of the scaling
+             * @param y defines the y coordinate of the scaling
+             * @param result defines the target matrix
+             */
             Matrix2D.ScalingToRef = function (x, y, result) {
                 result.fromValues(x, 0, 0, y, 0, 0);
             };
+            /**
+             * Creates a rotation matrix and stores it in a target matrix
+             * @param angle defines the rotation angle
+             * @param result defines the target matrix
+             */
             Matrix2D.RotationToRef = function (angle, result) {
                 var s = Math.sin(angle);
                 var c = Math.cos(angle);
                 result.fromValues(c, s, -s, c, 0, 0);
             };
+            /**
+             * Compose a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
+             * @param tx defines the x coordinate of the translation
+             * @param ty defines the y coordinate of the translation
+             * @param angle defines the rotation angle
+             * @param scaleX defines the x coordinate of the scaling
+             * @param scaleY defines the y coordinate of the scaling
+             * @param parentMatrix defines the parent matrix to multiply by (can be null)
+             * @param result defines the target matrix
+             */
             Matrix2D.ComposeToRef = function (tx, ty, angle, scaleX, scaleY, parentMatrix, result) {
                 Matrix2D.TranslationToRef(tx, ty, Matrix2D._TempPreTranslationMatrix);
                 Matrix2D.ScalingToRef(scaleX, scaleY, Matrix2D._TempScalingMatrix);
@@ -3017,8 +3093,15 @@ var BABYLON;
 (function (BABYLON) {
     var GUI;
     (function (GUI) {
+        /**
+         * Class used to create a 2D stack panel container
+         */
         var StackPanel = /** @class */ (function (_super) {
             __extends(StackPanel, _super);
+            /**
+             * Creates a new StackPanel
+             * @param name defines control name
+             */
             function StackPanel(name) {
                 var _this = _super.call(this, name) || this;
                 _this.name = name;
@@ -3030,6 +3113,7 @@ var BABYLON;
                 return _this;
             }
             Object.defineProperty(StackPanel.prototype, "isVertical", {
+                /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
                 get: function () {
                     return this._isVertical;
                 },
@@ -3047,6 +3131,7 @@ var BABYLON;
                 get: function () {
                     return this._width.toString(this._host);
                 },
+                /** Gets or sets panel width */
                 set: function (value) {
                     if (!this._doNotTrackManualChanges) {
                         this._manualWidth = true;
@@ -3065,6 +3150,7 @@ var BABYLON;
                 get: function () {
                     return this._height.toString(this._host);
                 },
+                /** Gets or sets panel height */
                 set: function (value) {
                     if (!this._doNotTrackManualChanges) {
                         this._manualHeight = true;
@@ -3159,8 +3245,13 @@ var BABYLON;
 (function (BABYLON) {
     var GUI;
     (function (GUI) {
+        /** Class used to create rectangle container */
         var Rectangle = /** @class */ (function (_super) {
             __extends(Rectangle, _super);
+            /**
+             * Creates a new Rectangle
+             * @param name defines the control name
+             */
             function Rectangle(name) {
                 var _this = _super.call(this, name) || this;
                 _this.name = name;
@@ -3169,6 +3260,7 @@ var BABYLON;
                 return _this;
             }
             Object.defineProperty(Rectangle.prototype, "thickness", {
+                /** Gets or sets border thickness */
                 get: function () {
                     return this._thickness;
                 },
@@ -3183,6 +3275,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Rectangle.prototype, "cornerRadius", {
+                /** Gets or sets the corner radius angle */
                 get: function () {
                     return this._cornerRadius;
                 },
@@ -3286,7 +3379,7 @@ var BABYLON;
 (function (BABYLON) {
     var GUI;
     (function (GUI) {
-        /** Class used to render 2D ellipses */
+        /** Class used to create 2D ellipse containers */
         var Ellipse = /** @class */ (function (_super) {
             __extends(Ellipse, _super);
             /**
@@ -3372,6 +3465,10 @@ var BABYLON;
         /** Class used to render 2D lines */
         var Line = /** @class */ (function (_super) {
             __extends(Line, _super);
+            /**
+             * Creates a new Line
+             * @param name defines the control name
+             */
             function Line(name) {
                 var _this = _super.call(this, name) || this;
                 _this.name = name;
@@ -3402,6 +3499,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Line.prototype, "connectedControl", {
+                /** Gets or sets the control connected with the line end */
                 get: function () {
                     return this._connectedControl;
                 },
@@ -3424,6 +3522,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Line.prototype, "x1", {
+                /** Gets or sets start coordinates on X axis */
                 get: function () {
                     return this._x1.toString(this._host);
                 },
@@ -3439,6 +3538,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Line.prototype, "y1", {
+                /** Gets or sets start coordinates on Y axis */
                 get: function () {
                     return this._y1.toString(this._host);
                 },
@@ -3454,6 +3554,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Line.prototype, "x2", {
+                /** Gets or sets end coordinates on X axis */
                 get: function () {
                     return this._x2.toString(this._host);
                 },
@@ -3469,6 +3570,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Line.prototype, "y2", {
+                /** Gets or sets end coordinates on Y axis */
                 get: function () {
                     return this._y2.toString(this._host);
                 },
@@ -3484,6 +3586,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Line.prototype, "lineWidth", {
+                /** Gets or sets line width */
                 get: function () {
                     return this._lineWidth;
                 },
@@ -3498,6 +3601,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Line.prototype, "horizontalAlignment", {
+                /** Gets or sets horizontal alignment */
                 set: function (value) {
                     return;
                 },
@@ -3505,6 +3609,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Line.prototype, "verticalAlignment", {
+                /** Gets or sets vertical alignment */
                 set: function (value) {
                     return;
                 },
@@ -3614,8 +3719,15 @@ var BABYLON;
 (function (BABYLON) {
     var GUI;
     (function (GUI) {
+        /**
+         * Class used to create slider controls
+         */
         var Slider = /** @class */ (function (_super) {
             __extends(Slider, _super);
+            /**
+             * Creates a new Slider
+             * @param name defines the control name
+             */
             function Slider(name) {
                 var _this = _super.call(this, name) || this;
                 _this.name = name;
@@ -3628,6 +3740,7 @@ var BABYLON;
                 _this._barOffset = new GUI.ValueAndUnit(5, GUI.ValueAndUnit.UNITMODE_PIXEL, false);
                 _this._isThumbCircle = false;
                 _this._isThumbClamped = false;
+                /** Observable raised when the sldier value changes */
                 _this.onValueChangedObservable = new BABYLON.Observable();
                 // Events
                 _this._pointerIsDown = false;
@@ -3635,6 +3748,7 @@ var BABYLON;
                 return _this;
             }
             Object.defineProperty(Slider.prototype, "borderColor", {
+                /** Gets or sets border color */
                 get: function () {
                     return this._borderColor;
                 },
@@ -3649,6 +3763,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "background", {
+                /** Gets or sets background color */
                 get: function () {
                     return this._background;
                 },
@@ -3663,6 +3778,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "barOffset", {
+                /** Gets or sets main bar offset */
                 get: function () {
                     return this._barOffset.toString(this._host);
                 },
@@ -3678,6 +3794,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "barOffsetInPixels", {
+                /** Gets main bar offset in pixels*/
                 get: function () {
                     return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
                 },
@@ -3685,6 +3802,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "thumbWidth", {
+                /** Gets or sets thumb width */
                 get: function () {
                     return this._thumbWidth.toString(this._host);
                 },
@@ -3700,6 +3818,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "thumbWidthInPixels", {
+                /** Gets thumb width in pixels */
                 get: function () {
                     return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
                 },
@@ -3707,6 +3826,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "minimum", {
+                /** Gets or sets minimum value */
                 get: function () {
                     return this._minimum;
                 },
@@ -3722,6 +3842,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "maximum", {
+                /** Gets or sets maximum value */
                 get: function () {
                     return this._maximum;
                 },
@@ -3737,6 +3858,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "value", {
+                /** Gets or sets current value */
                 get: function () {
                     return this._value;
                 },
@@ -3753,6 +3875,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "isThumbCircle", {
+                /** Gets or sets a boolean indicating if the thumb should be round or square */
                 get: function () {
                     return this._isThumbCircle;
                 },
@@ -3767,6 +3890,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(Slider.prototype, "isThumbClamped", {
+                /** Gets or sets a value indicating if the thumb can go over main bar extends */
                 get: function () {
                     return this._isThumbClamped;
                 },
@@ -4045,8 +4169,15 @@ var BABYLON;
 (function (BABYLON) {
     var GUI;
     (function (GUI) {
+        /**
+         * Class used to create radio button controls
+         */
         var RadioButton = /** @class */ (function (_super) {
             __extends(RadioButton, _super);
+            /**
+             * Creates a new RadioButton
+             * @param name defines the control name
+             */
             function RadioButton(name) {
                 var _this = _super.call(this, name) || this;
                 _this.name = name;
@@ -4054,12 +4185,15 @@ var BABYLON;
                 _this._background = "black";
                 _this._checkSizeRatio = 0.8;
                 _this._thickness = 1;
+                /** Gets or sets group name */
                 _this.group = "";
+                /** Observable raised when isChecked is changed */
                 _this.onIsCheckedChangedObservable = new BABYLON.Observable();
                 _this.isPointerBlocker = true;
                 return _this;
             }
             Object.defineProperty(RadioButton.prototype, "thickness", {
+                /** Gets or sets border thickness */
                 get: function () {
                     return this._thickness;
                 },
@@ -4074,6 +4208,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(RadioButton.prototype, "checkSizeRatio", {
+                /** Gets or sets a value indicating the ratio between overall size and check size */
                 get: function () {
                     return this._checkSizeRatio;
                 },
@@ -4089,6 +4224,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(RadioButton.prototype, "background", {
+                /** Gets or sets background color */
                 get: function () {
                     return this._background;
                 },
@@ -4103,6 +4239,7 @@ var BABYLON;
                 configurable: true
             });
             Object.defineProperty(RadioButton.prototype, "isChecked", {
+                /** Gets or sets a boolean indicating if the checkbox is checked or not */
                 get: function () {
                     return this._isChecked;
                 },
@@ -4195,6 +4332,9 @@ var BABYLON;
 (function (BABYLON) {
     var GUI;
     (function (GUI) {
+        /**
+         * Class used to create text block control
+         */
         var TextBlock = /** @class */ (function (_super) {
             __extends(TextBlock, _super);
             /**
@@ -5906,27 +6046,45 @@ var BABYLON;
 (function (BABYLON) {
     var GUI;
     (function (GUI) {
+        /**
+         * Class used to store key control properties
+         */
         var KeyPropertySet = /** @class */ (function () {
             function KeyPropertySet() {
             }
             return KeyPropertySet;
         }());
         GUI.KeyPropertySet = KeyPropertySet;
+        /**
+         * Class used to create virtual keyboard
+         */
         var VirtualKeyboard = /** @class */ (function (_super) {
             __extends(VirtualKeyboard, _super);
             function VirtualKeyboard() {
                 var _this = _super !== null && _super.apply(this, arguments) || this;
+                /** Observable raised when a key is pressed */
                 _this.onKeyPressObservable = new BABYLON.Observable();
+                /** Gets or sets default key button width */
                 _this.defaultButtonWidth = "40px";
+                /** Gets or sets default key button height */
                 _this.defaultButtonHeight = "40px";
+                /** Gets or sets default key button left padding */
                 _this.defaultButtonPaddingLeft = "2px";
+                /** Gets or sets default key button right padding */
                 _this.defaultButtonPaddingRight = "2px";
+                /** Gets or sets default key button top padding */
                 _this.defaultButtonPaddingTop = "2px";
+                /** Gets or sets default key button bottom padding */
                 _this.defaultButtonPaddingBottom = "2px";
+                /** Gets or sets default key button foreground color */
                 _this.defaultButtonColor = "#DDD";
+                /** Gets or sets default key button background color */
                 _this.defaultButtonBackground = "#070707";
+                /** Gets or sets shift button foreground color */
                 _this.shiftButtonColor = "#7799FF";
+                /** Gets or sets shift button thickness*/
                 _this.selectedShiftThickness = 1;
+                /** Gets shift key state */
                 _this.shiftState = 0;
                 return _this;
             }
@@ -5955,6 +6113,11 @@ var BABYLON;
                 });
                 return button;
             };
+            /**
+             * Adds a new row of keys
+             * @param keys defines the list of keys to add
+             * @param propertySets defines the associated property sets
+             */
             VirtualKeyboard.prototype.addKeysRow = function (keys, propertySets) {
                 var panel = new GUI.StackPanel();
                 panel.isVertical = false;
@@ -5968,6 +6131,10 @@ var BABYLON;
                 }
                 this.addControl(panel);
             };
+            /**
+             * Set the shift key to a specific state
+             * @param shiftState defines the new shift state
+             */
             VirtualKeyboard.prototype.applyShiftState = function (shiftState) {
                 if (!this.children) {
                     return;
@@ -5993,12 +6160,17 @@ var BABYLON;
                 }
             };
             Object.defineProperty(VirtualKeyboard.prototype, "connectedInputText", {
+                /** Gets the input text control attached with the keyboard */
                 get: function () {
                     return this._connectedInputText;
                 },
                 enumerable: true,
                 configurable: true
             });
+            /**
+             * Connects the keyboard with an input text control
+             * @param input defines the target control
+             */
             VirtualKeyboard.prototype.connect = function (input) {
                 var _this = this;
                 this.isVisible = false;
@@ -6036,6 +6208,9 @@ var BABYLON;
                     }
                 });
             };
+            /**
+             * Disconnects the keyboard from an input text control
+             */
             VirtualKeyboard.prototype.disconnect = function () {
                 if (!this._connectedInputText) {
                     return;
@@ -6046,6 +6221,10 @@ var BABYLON;
                 this._connectedInputText = null;
             };
             // Statics
+            /**
+             * Creates a new keyboard using a default layout
+             * @returns a new VirtualKeyboard
+             */
             VirtualKeyboard.CreateDefaultLayout = function () {
                 var returnValue = new VirtualKeyboard();
                 returnValue.addKeysRow(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "\u2190"]);
@@ -6067,12 +6246,20 @@ var BABYLON;
 (function (BABYLON) {
     var GUI;
     (function (GUI) {
+        /**
+         * Class used to create multi line control
+         */
         var MultiLine = /** @class */ (function (_super) {
             __extends(MultiLine, _super);
+            /**
+             * Creates a new MultiLine
+             * @param name defines the control name
+             */
             function MultiLine(name) {
                 var _this = _super.call(this, name) || this;
                 _this.name = name;
                 _this._lineWidth = 1;
+                /** Function called when a point is updated */
                 _this.onPointUpdate = function () {
                     _this._markAsDirty();
                 };
@@ -6084,6 +6271,7 @@ var BABYLON;
                 return _this;
             }
             Object.defineProperty(MultiLine.prototype, "dash", {
+                /** Gets or sets dash pattern */
                 get: function () {
                     return this._dash;
                 },
@@ -6097,12 +6285,22 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
+            /**
+             * Gets point stored at specified index
+             * @param index defines the index to look for
+             * @returns the requested point if found
+             */
             MultiLine.prototype.getAt = function (index) {
                 if (!this._points[index]) {
                     this._points[index] = new GUI.MultiLinePoint(this);
                 }
                 return this._points[index];
             };
+            /**
+             * Adds new points to the point collection
+             * @param items defines the list of items (mesh, control or 2d coordiantes) to add
+             * @returns the list of created MultiLinePoint
+             */
             MultiLine.prototype.add = function () {
                 var _this = this;
                 var items = [];
@@ -6111,6 +6309,11 @@ var BABYLON;
                 }
                 return items.map(function (item) { return _this.push(item); });
             };
+            /**
+             * Adds a new point to the point collection
+             * @param item defines the item (mesh, control or 2d coordiantes) to add
+             * @returns the created MultiLinePoint
+             */
             MultiLine.prototype.push = function (item) {
                 var point = this.getAt(this._points.length);
                 if (item == null)
@@ -6127,6 +6330,10 @@ var BABYLON;
                 }
                 return point;
             };
+            /**
+             * Remove a specific value or point from the active point collection
+             * @param value defines the value or point to remove
+             */
             MultiLine.prototype.remove = function (value) {
                 var index;
                 if (value instanceof GUI.MultiLinePoint) {
@@ -6146,6 +6353,7 @@ var BABYLON;
                 this._points.splice(index, 1);
             };
             Object.defineProperty(MultiLine.prototype, "lineWidth", {
+                /** Gets or sets line width */
                 get: function () {
                     return this._lineWidth;
                 },
@@ -6726,7 +6934,9 @@ var BABYLON;
              * @param source defines the vector3 data to transport
              * @param buttonIndex defines the current mouse button index
              */
-            function Vector3WithInfo(source, buttonIndex) {
+            function Vector3WithInfo(source, 
+            /** defines the current mouse button index */
+            buttonIndex) {
                 if (buttonIndex === void 0) { buttonIndex = 0; }
                 var _this = _super.call(this, source.x, source.y, source.z) || this;
                 _this.buttonIndex = buttonIndex;

+ 223 - 3
dist/preview release/gui/babylon.gui.module.d.ts

@@ -374,6 +374,7 @@ declare module BABYLON.GUI {
         isEqualsTo(other: Measure): boolean;
         /**
          * Creates an empty measure
+         * @returns a new measure
          */
         static Empty(): Measure;
     }
@@ -385,25 +386,91 @@ declare module BABYLON.GUI {
      * Class used to transport Vector2 information for pointer events
      */
     class Vector2WithInfo extends Vector2 {
+        /** defines the current mouse button index */
         buttonIndex: number;
         /**
          * Creates a new Vector2WithInfo
          * @param source defines the vector2 data to transport
          * @param buttonIndex defines the current mouse button index
          */
-        constructor(source: Vector2, buttonIndex?: number);
+        constructor(source: Vector2, 
+            /** defines the current mouse button index */
+            buttonIndex?: number);
     }
+    /** Class used to provide 2D matrix features */
     class Matrix2D {
+        /** Gets the internal array of 6 floats used to store matrix data */
         m: Float32Array;
+        /**
+         * Creates a new matrix
+         * @param m00 defines value for (0, 0)
+         * @param m01 defines value for (0, 1)
+         * @param m10 defines value for (1, 0)
+         * @param m11 defines value for (1, 1)
+         * @param m20 defines value for (2, 0)
+         * @param m21 defines value for (2, 1)
+         */
         constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number);
+        /**
+         * Fills the matrix from direct values
+         * @param m00 defines value for (0, 0)
+         * @param m01 defines value for (0, 1)
+         * @param m10 defines value for (1, 0)
+         * @param m11 defines value for (1, 1)
+         * @param m20 defines value for (2, 0)
+         * @param m21 defines value for (2, 1)
+         * @returns the current modified matrix
+         */
         fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D;
+        /**
+         * Gets matrix determinant
+         * @returns the determinant
+         */
         determinant(): number;
+        /**
+         * Inverses the matrix and stores it in a target matrix
+         * @param result defines the target matrix
+         * @returns the current matrix
+         */
         invertToRef(result: Matrix2D): Matrix2D;
+        /**
+         * Multiplies the current matrix with another one
+         * @param other defines the second operand
+         * @param result defines the target matrix
+         * @returns the current matrix
+         */
         multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D;
+        /**
+         * Apply the current matrix to a set of 2 floats and stores the result in a vector2
+         * @param x defines the x coordinate to transform
+         * @param y defines the x coordinate to transform
+         * @param result defines the target vector2
+         * @returns the current matrix
+         */
         transformCoordinates(x: number, y: number, result: Vector2): Matrix2D;
+        /**
+         * Creates an identity matrix
+         */
         static Identity(): Matrix2D;
+        /**
+         * Creates a translation matrix and stores it in a target matrix
+         * @param x defines the x coordinate of the translation
+         * @param y defines the y coordinate of the translation
+         * @param result defines the target matrix
+         */
         static TranslationToRef(x: number, y: number, result: Matrix2D): void;
+        /**
+         * Creates a scaling matrix and stores it in a target matrix
+         * @param x defines the x coordinate of the scaling
+         * @param y defines the y coordinate of the scaling
+         * @param result defines the target matrix
+         */
         static ScalingToRef(x: number, y: number, result: Matrix2D): void;
+        /**
+         * Creates a rotation matrix and stores it in a target matrix
+         * @param angle defines the rotation angle
+         * @param result defines the target matrix
+         */
         static RotationToRef(angle: number, result: Matrix2D): void;
         private static _TempPreTranslationMatrix;
         private static _TempPostTranslationMatrix;
@@ -412,6 +479,16 @@ declare module BABYLON.GUI {
         private static _TempCompose0;
         private static _TempCompose1;
         private static _TempCompose2;
+        /**
+         * Compose a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix
+         * @param tx defines the x coordinate of the translation
+         * @param ty defines the y coordinate of the translation
+         * @param angle defines the rotation angle
+         * @param scaleX defines the x coordinate of the scaling
+         * @param scaleY defines the y coordinate of the scaling
+         * @param parentMatrix defines the parent matrix to multiply by (can be null)
+         * @param result defines the target matrix
+         */
         static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>, result: Matrix2D): void;
     }
 }
@@ -981,6 +1058,9 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create a 2D stack panel container
+     */
     class StackPanel extends Container {
         name: string | undefined;
         private _isVertical;
@@ -988,9 +1068,16 @@ declare module BABYLON.GUI {
         private _manualHeight;
         private _doNotTrackManualChanges;
         private _tempMeasureStore;
+        /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
         isVertical: boolean;
+        /** Gets or sets panel width */
         width: string | number;
+        /** Gets or sets panel height */
         height: string | number;
+        /**
+         * Creates a new StackPanel
+         * @param name defines control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _preMeasure(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -999,12 +1086,19 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /** Class used to create rectangle container */
     class Rectangle extends Container {
         name: string | undefined;
         private _thickness;
         private _cornerRadius;
+        /** Gets or sets border thickness */
         thickness: number;
+        /** Gets or sets the corner radius angle */
         cornerRadius: number;
+        /**
+         * Creates a new Rectangle
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         protected _localDraw(context: CanvasRenderingContext2D): void;
@@ -1016,7 +1110,7 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
-    /** Class used to render 2D ellipses */
+    /** Class used to create 2D ellipse containers */
     class Ellipse extends Container {
         name: string | undefined;
         private _thickness;
@@ -1049,16 +1143,28 @@ declare module BABYLON.GUI {
         private _connectedControlDirtyObserver;
         /** Gets or sets the dash pattern */
         dash: Array<number>;
+        /** Gets or sets the control connected with the line end */
         connectedControl: Control;
+        /** Gets or sets start coordinates on X axis */
         x1: string | number;
+        /** Gets or sets start coordinates on Y axis */
         y1: string | number;
+        /** Gets or sets end coordinates on X axis */
         x2: string | number;
+        /** Gets or sets end coordinates on Y axis */
         y2: string | number;
+        /** Gets or sets line width */
         lineWidth: number;
+        /** Gets or sets horizontal alignment */
         horizontalAlignment: number;
+        /** Gets or sets vertical alignment */
         verticalAlignment: number;
         private readonly _effectiveX2;
         private readonly _effectiveY2;
+        /**
+         * Creates a new Line
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -1082,6 +1188,9 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create slider controls
+     */
     class Slider extends Control {
         name: string | undefined;
         private _thumbWidth;
@@ -1093,18 +1202,34 @@ declare module BABYLON.GUI {
         private _barOffset;
         private _isThumbCircle;
         private _isThumbClamped;
+        /** Observable raised when the sldier value changes */
         onValueChangedObservable: Observable<number>;
+        /** Gets or sets border color */
         borderColor: string;
+        /** Gets or sets background color */
         background: string;
+        /** Gets or sets main bar offset */
         barOffset: string | number;
+        /** Gets main bar offset in pixels*/
         readonly barOffsetInPixels: number;
+        /** Gets or sets thumb width */
         thumbWidth: string | number;
+        /** Gets thumb width in pixels */
         readonly thumbWidthInPixels: number;
+        /** Gets or sets minimum value */
         minimum: number;
+        /** Gets or sets maximum value */
         maximum: number;
+        /** Gets or sets current value */
         value: number;
+        /** Gets or sets a boolean indicating if the thumb should be round or square */
         isThumbCircle: boolean;
+        /** Gets or sets a value indicating if the thumb can go over main bar extends */
         isThumbClamped: boolean;
+        /**
+         * Creates a new Slider
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -1154,18 +1279,31 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create radio button controls
+     */
     class RadioButton extends Control {
         name: string | undefined;
         private _isChecked;
         private _background;
         private _checkSizeRatio;
         private _thickness;
+        /** Gets or sets border thickness */
         thickness: number;
+        /** Gets or sets group name */
         group: string;
+        /** Observable raised when isChecked is changed */
         onIsCheckedChangedObservable: Observable<boolean>;
+        /** Gets or sets a value indicating the ratio between overall size and check size */
         checkSizeRatio: number;
+        /** Gets or sets background color */
         background: string;
+        /** Gets or sets a boolean indicating if the checkbox is checked or not */
         isChecked: boolean;
+        /**
+         * Creates a new RadioButton
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
         protected _getTypeName(): string;
         _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void;
@@ -1175,6 +1313,9 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create text block control
+     */
     class TextBlock extends Control {
         /**
          * Defines the name of the control
@@ -1577,46 +1718,96 @@ declare module BABYLON.GUI {
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to store key control properties
+     */
     class KeyPropertySet {
+        /** Width */
         width?: string;
+        /** Height */
         height?: string;
+        /** Left padding */
         paddingLeft?: string;
+        /** Right padding */
         paddingRight?: string;
+        /** Top padding */
         paddingTop?: string;
+        /** Bottom padding */
         paddingBottom?: string;
+        /** Foreground color */
         color?: string;
+        /** Background color */
         background?: string;
     }
+    /**
+     * Class used to create virtual keyboard
+     */
     class VirtualKeyboard extends StackPanel {
+        /** Observable raised when a key is pressed */
         onKeyPressObservable: Observable<string>;
+        /** Gets or sets default key button width */
         defaultButtonWidth: string;
+        /** Gets or sets default key button height */
         defaultButtonHeight: string;
+        /** Gets or sets default key button left padding */
         defaultButtonPaddingLeft: string;
+        /** Gets or sets default key button right padding */
         defaultButtonPaddingRight: string;
+        /** Gets or sets default key button top padding */
         defaultButtonPaddingTop: string;
+        /** Gets or sets default key button bottom padding */
         defaultButtonPaddingBottom: string;
+        /** Gets or sets default key button foreground color */
         defaultButtonColor: string;
+        /** Gets or sets default key button background color */
         defaultButtonBackground: string;
+        /** Gets or sets shift button foreground color */
         shiftButtonColor: string;
+        /** Gets or sets shift button thickness*/
         selectedShiftThickness: number;
+        /** Gets shift key state */
         shiftState: number;
         protected _getTypeName(): string;
         private _createKey(key, propertySet);
+        /**
+         * Adds a new row of keys
+         * @param keys defines the list of keys to add
+         * @param propertySets defines the associated property sets
+         */
         addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void;
+        /**
+         * Set the shift key to a specific state
+         * @param shiftState defines the new shift state
+         */
         applyShiftState(shiftState: number): void;
         private _connectedInputText;
         private _onFocusObserver;
         private _onBlurObserver;
         private _onKeyPressObserver;
+        /** Gets the input text control attached with the keyboard */
         readonly connectedInputText: Nullable<InputText>;
+        /**
+         * Connects the keyboard with an input text control
+         * @param input defines the target control
+         */
         connect(input: InputText): void;
+        /**
+         * Disconnects the keyboard from an input text control
+         */
         disconnect(): void;
+        /**
+         * Creates a new keyboard using a default layout
+         * @returns a new VirtualKeyboard
+         */
         static CreateDefaultLayout(): VirtualKeyboard;
     }
 }
 
 
 declare module BABYLON.GUI {
+    /**
+     * Class used to create multi line control
+     */
     class MultiLine extends Control {
         name: string | undefined;
         private _lineWidth;
@@ -1626,19 +1817,45 @@ declare module BABYLON.GUI {
         private _minY;
         private _maxX;
         private _maxY;
+        /**
+         * Creates a new MultiLine
+         * @param name defines the control name
+         */
         constructor(name?: string | undefined);
+        /** Gets or sets dash pattern */
         dash: Array<number>;
+        /**
+         * Gets point stored at specified index
+         * @param index defines the index to look for
+         * @returns the requested point if found
+         */
         getAt(index: number): MultiLinePoint;
+        /** Function called when a point is updated */
         onPointUpdate: () => void;
+        /**
+         * Adds new points to the point collection
+         * @param items defines the list of items (mesh, control or 2d coordiantes) to add
+         * @returns the list of created MultiLinePoint
+         */
         add(...items: (AbstractMesh | Control | {
             x: string | number;
             y: string | number;
         })[]): MultiLinePoint[];
+        /**
+         * Adds a new point to the point collection
+         * @param item defines the item (mesh, control or 2d coordiantes) to add
+         * @returns the created MultiLinePoint
+         */
         push(item?: (AbstractMesh | Control | {
             x: string | number;
             y: string | number;
         })): MultiLinePoint;
+        /**
+         * Remove a specific value or point from the active point collection
+         * @param value defines the value or point to remove
+         */
         remove(value: number | MultiLinePoint): void;
+        /** Gets or sets line width */
         lineWidth: number;
         horizontalAlignment: number;
         verticalAlignment: number;
@@ -1807,13 +2024,16 @@ declare module BABYLON.GUI {
      * Class used to transport Vector3 information for pointer events
      */
     class Vector3WithInfo extends Vector3 {
+        /** defines the current mouse button index */
         buttonIndex: number;
         /**
          * Creates a new Vector3WithInfo
          * @param source defines the vector3 data to transport
          * @param buttonIndex defines the current mouse button index
          */
-        constructor(source: Vector3, buttonIndex?: number);
+        constructor(source: Vector3, 
+            /** defines the current mouse button index */
+            buttonIndex?: number);
     }
 }
 

文件差异内容过多而无法显示
+ 15 - 15
dist/preview release/viewer/babylon.viewer.js


+ 56 - 50
dist/preview release/viewer/babylon.viewer.max.js

@@ -12060,42 +12060,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_R32F", {
+        Object.defineProperty(Engine, "TEXTUREFORMAT_R", {
             /**
-             * R32F
+             * R
              */
             get: function () {
-                return Engine._TEXTUREFORMAT_R32F;
+                return Engine._TEXTUREFORMAT_R;
             },
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RG32F", {
+        Object.defineProperty(Engine, "TEXTUREFORMAT_RG", {
             /**
-             * RG32F
+             * RG
              */
             get: function () {
-                return Engine._TEXTUREFORMAT_RG32F;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGB32F", {
-            /**
-             * RGB32F
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGB32F;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA32F", {
-            /**
-             * RGBA32F
-             */
-            get: function () {
-                return Engine._TEXTUREFORMAT_RGBA32F;
+                return Engine._TEXTUREFORMAT_RG;
             },
             enumerable: true,
             configurable: true
@@ -16144,10 +16124,14 @@ var BABYLON;
          * @param format defines the data format
          * @param invertY defines if data must be stored with Y axis inverted
          * @param compression defines the used compression (can be null)
+         * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
-        Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression) {
+        Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression, textureType) {
             if (compression === void 0) { compression = null; }
+            if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
+            var internalType = this._getWebGLTextureType(textureType);
             var internalFormat = this._getInternalFormat(format);
+            var internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);
             this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
             this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
             if (!this._doNotHandleContextLost) {
@@ -16163,7 +16147,7 @@ var BABYLON;
                 this._gl.compressedTexImage3D(this._gl.TEXTURE_3D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data);
             }
             else {
-                this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalFormat, texture.width, texture.height, texture.depth, 0, internalFormat, this._gl.UNSIGNED_BYTE, data);
+                this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);
             }
             if (texture.generateMipMaps) {
                 this._gl.generateMipmap(this._gl.TEXTURE_3D);
@@ -16183,10 +16167,12 @@ var BABYLON;
          * @param invertY defines if data must be stored with Y axis inverted
          * @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
          * @param compression defines the compressed used (can be null)
+         * @param textureType defines the compressed used (can be null)
          * @returns a new raw 3D texture (stored in an InternalTexture)
          */
-        Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression) {
+        Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression, textureType) {
             if (compression === void 0) { compression = null; }
+            if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
             var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW3D);
             texture.baseWidth = width;
             texture.baseHeight = height;
@@ -16195,13 +16181,14 @@ var BABYLON;
             texture.height = height;
             texture.depth = depth;
             texture.format = format;
+            texture.type = textureType;
             texture.generateMipMaps = generateMipMaps;
             texture.samplingMode = samplingMode;
             texture.is3D = true;
             if (!this._doNotHandleContextLost) {
                 texture._bufferView = data;
             }
-            this.updateRawTexture3D(texture, data, format, invertY, compression);
+            this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);
             this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
             // Filters
             var filters = getSamplingParameters(samplingMode, generateMipMaps, this._gl);
@@ -17152,17 +17139,15 @@ var BABYLON;
                     internalFormat = this._gl.LUMINANCE_ALPHA;
                     break;
                 case Engine.TEXTUREFORMAT_RGB:
-                case Engine.TEXTUREFORMAT_RGB32F:
                     internalFormat = this._gl.RGB;
                     break;
                 case Engine.TEXTUREFORMAT_RGBA:
-                case Engine.TEXTUREFORMAT_RGBA32F:
                     internalFormat = this._gl.RGBA;
                     break;
-                case Engine.TEXTUREFORMAT_R32F:
+                case Engine.TEXTUREFORMAT_R:
                     internalFormat = this._gl.RED;
                     break;
-                case Engine.TEXTUREFORMAT_RG32F:
+                case Engine.TEXTUREFORMAT_RG:
                     internalFormat = this._gl.RG;
                     break;
             }
@@ -17184,17 +17169,27 @@ var BABYLON;
             if (type === Engine.TEXTURETYPE_FLOAT) {
                 if (format !== undefined) {
                     switch (format) {
-                        case Engine.TEXTUREFORMAT_R32F:
+                        case Engine.TEXTUREFORMAT_R:
                             return this._gl.R32F;
-                        case Engine.TEXTUREFORMAT_RG32F:
+                        case Engine.TEXTUREFORMAT_RG:
                             return this._gl.RG32F;
-                        case Engine.TEXTUREFORMAT_RGB32F:
+                        case Engine.TEXTUREFORMAT_RGB:
                             return this._gl.RGB32F;
                     }
                 }
                 return this._gl.RGBA32F;
             }
-            else if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
+            if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
+                if (format) {
+                    switch (format) {
+                        case Engine.TEXTUREFORMAT_R:
+                            return this._gl.R16F;
+                        case Engine.TEXTUREFORMAT_RG:
+                            return this._gl.RG16F;
+                        case Engine.TEXTUREFORMAT_RGB:
+                            return this._gl.RGB16F;
+                    }
+                }
                 return this._gl.RGBA16F;
             }
             if (format !== undefined) {
@@ -17203,6 +17198,10 @@ var BABYLON;
                         return this._gl.LUMINANCE;
                     case Engine.TEXTUREFORMAT_RGB:
                         return this._gl.RGB;
+                    case Engine.TEXTUREFORMAT_R:
+                        return this._gl.R8;
+                    case Engine.TEXTUREFORMAT_RG:
+                        return this._gl.RG8;
                     case Engine.TEXTUREFORMAT_ALPHA:
                         return this._gl.ALPHA;
                 }
@@ -17552,10 +17551,8 @@ var BABYLON;
         Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
         Engine._TEXTUREFORMAT_RGB = 4;
         Engine._TEXTUREFORMAT_RGBA = 5;
-        Engine._TEXTUREFORMAT_R32F = 6;
-        Engine._TEXTUREFORMAT_RG32F = 7;
-        Engine._TEXTUREFORMAT_RGB32F = 8;
-        Engine._TEXTUREFORMAT_RGBA32F = 9;
+        Engine._TEXTUREFORMAT_R = 6;
+        Engine._TEXTUREFORMAT_RG = 7;
         Engine._TEXTURETYPE_UNSIGNED_INT = 0;
         Engine._TEXTURETYPE_FLOAT = 1;
         Engine._TEXTURETYPE_HALF_FLOAT = 2;
@@ -58104,7 +58101,7 @@ var BABYLON;
                 d.push(Math.random());
                 d.push(Math.random());
             }
-            this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA32F, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
+            this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
             this._randomTexture.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE;
             this._randomTexture.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE;
             this._randomTextureSize = maxTextureSize;
@@ -65714,17 +65711,19 @@ var BABYLON;
          * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
          * @param invertY defines if texture must be stored with Y axis inverted
          * @param samplingMode defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)
+         * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
          */
         function RawTexture3D(data, width, height, depth, 
-        /** Gets or sets the texture format to use*/
-        format, scene, generateMipMaps, invertY, samplingMode) {
+        /** Gets or sets the texture format to use */
+        format, scene, generateMipMaps, invertY, samplingMode, textureType) {
             if (generateMipMaps === void 0) { generateMipMaps = true; }
             if (invertY === void 0) { invertY = false; }
             if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
+            if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             var _this = _super.call(this, null, scene, !generateMipMaps, invertY) || this;
             _this.format = format;
             _this._engine = scene.getEngine();
-            _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode);
+            _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, undefined, textureType);
             _this.is3D = true;
             return _this;
         }
@@ -65736,7 +65735,7 @@ var BABYLON;
             if (!this._texture) {
                 return;
             }
-            this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY);
+            this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, undefined, this._texture.type);
         };
         return RawTexture3D;
     }(BABYLON.Texture));
@@ -93558,10 +93557,17 @@ var BABYLON;
             var blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;
             blurTextureWidth = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;
             blurTextureHeight = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;
+            var textureType = 0;
+            if (this._engine.getCaps().textureHalfFloatRender) {
+                textureType = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
+            }
+            else {
+                textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
+            }
             this._blurTexture = new BABYLON.RenderTargetTexture("HighlightLayerBlurRTT", {
                 width: blurTextureWidth,
                 height: blurTextureHeight
-            }, this._scene, false, true, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+            }, this._scene, false, true, textureType);
             this._blurTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._blurTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
             this._blurTexture.anisotropicFilteringLevel = 16;
@@ -93588,7 +93594,7 @@ var BABYLON;
                 this._horizontalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerHBP", new BABYLON.Vector2(1.0, 0), this._options.blurHorizontalSize / 2, {
                     width: blurTextureWidth,
                     height: blurTextureHeight
-                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
                 this._horizontalBlurPostprocess.width = blurTextureWidth;
                 this._horizontalBlurPostprocess.height = blurTextureHeight;
                 this._horizontalBlurPostprocess.onApplyObservable.add(function (effect) {
@@ -93597,7 +93603,7 @@ var BABYLON;
                 this._verticalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerVBP", new BABYLON.Vector2(0, 1.0), this._options.blurVerticalSize / 2, {
                     width: blurTextureWidth,
                     height: blurTextureHeight
-                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
+                }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
                 this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];
             }
             this._mainTexture.onAfterUnbindObservable.add(function () {

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

@@ -39,6 +39,10 @@
 - Support for model drag and drop onto the canvas ([RaananW](https://github.com/RaananW))
 - New lab feature - global light rotation [#4347](https://github.com/BabylonJS/Babylon.js/issues/4347) ([RaananW](https://github.com/RaananW))
 
+### Documentation
+
+- Added all code comments for GUI
+
 ## Bug fixes
 - VR experience helper will now fire pointer events even when no mesh is currently hit ([TrevorDev](https://github.com/TrevorDev))
 - RawTexture.CreateAlphaTexture no longer fails to create a usable texture ([TrevorDev](https://github.com/TrevorDev))

+ 1 - 1
gui/src/2D/controls/ellipse.ts

@@ -1,7 +1,7 @@
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GUI {
-    /** Class used to render 2D ellipses */
+    /** Class used to create 2D ellipse containers */
     export class Ellipse extends Container {
         private _thickness = 1;       
         

+ 7 - 0
gui/src/2D/controls/line.ts

@@ -109,6 +109,7 @@ module BABYLON.GUI {
             }
         }                       
         
+        /** Gets or sets line width */
         public get lineWidth(): number {
             return this._lineWidth;
         }
@@ -122,10 +123,12 @@ module BABYLON.GUI {
             this._markAsDirty();
         }   
 
+        /** Gets or sets horizontal alignment */
         public set horizontalAlignment(value: number) {
             return;
         } 
 
+        /** Gets or sets vertical alignment */
         public set verticalAlignment(value: number) {
             return;
         }    
@@ -138,6 +141,10 @@ module BABYLON.GUI {
             return (this._connectedControl ? this._connectedControl.centerY : 0) + this._y2.getValue(this._host);
         }           
 
+        /**
+         * Creates a new Line
+         * @param name defines the control name
+         */
         constructor(public name?: string) {
             super(name);
 

+ 29 - 0
gui/src/2D/controls/multiLine.ts

@@ -2,6 +2,9 @@
 
 module BABYLON.GUI {
 
+    /**
+     * Class used to create multi line control
+     */
     export class MultiLine extends Control {
 
         private _lineWidth: number = 1;
@@ -13,6 +16,10 @@ module BABYLON.GUI {
         private _maxX: Nullable<number>;
         private _maxY: Nullable<number>;
 
+        /**
+         * Creates a new MultiLine
+         * @param name defines the control name
+         */
         constructor(public name?: string) {
             super(name);
 
@@ -24,6 +31,7 @@ module BABYLON.GUI {
             this._points = [];
         }
 
+        /** Gets or sets dash pattern */
         public get dash(): Array<number> {
             return this._dash;
         }
@@ -37,6 +45,11 @@ module BABYLON.GUI {
             this._markAsDirty();
         }
 
+        /**
+         * Gets point stored at specified index
+         * @param index defines the index to look for
+         * @returns the requested point if found
+         */
         public getAt(index: number): MultiLinePoint {
             if (!this._points[index]) {
                 this._points[index] = new MultiLinePoint(this);
@@ -45,14 +58,25 @@ module BABYLON.GUI {
             return this._points[index] as MultiLinePoint;
         }
 
+        /** Function called when a point is updated */
         public onPointUpdate = (): void => {
             this._markAsDirty();
         }
 
+        /**
+         * Adds new points to the point collection
+         * @param items defines the list of items (mesh, control or 2d coordiantes) to add 
+         * @returns the list of created MultiLinePoint
+         */
         public add(...items: (AbstractMesh | Control | { x: string | number, y: string | number })[]): MultiLinePoint[] {
             return items.map(item => this.push(item));
         }
 
+        /**
+         * Adds a new point to the point collection
+         * @param item defines the item (mesh, control or 2d coordiantes) to add 
+         * @returns the created MultiLinePoint
+         */
         public push(item?: (AbstractMesh | Control | { x: string | number, y: string | number })): MultiLinePoint {
             var point: MultiLinePoint = this.getAt(this._points.length);
 
@@ -72,6 +96,10 @@ module BABYLON.GUI {
             return point;
         }
 
+        /**
+         * Remove a specific value or point from the active point collection
+         * @param value defines the value or point to remove
+         */
         public remove(value: number | MultiLinePoint): void {
             var index: number;
             
@@ -97,6 +125,7 @@ module BABYLON.GUI {
             this._points.splice(index, 1);
         }
         
+        /** Gets or sets line width */
         public get lineWidth(): number {
             return this._lineWidth;
         }

+ 13 - 0
gui/src/2D/controls/radioButton.ts

@@ -1,12 +1,16 @@
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GUI {
+    /**
+     * Class used to create radio button controls
+     */
     export class RadioButton extends Control {
         private _isChecked = false;
         private _background = "black";   
         private _checkSizeRatio = 0.8;
         private _thickness = 1;
         
+        /** Gets or sets border thickness */
         public get thickness(): number {
             return this._thickness;
         }
@@ -20,10 +24,13 @@ module BABYLON.GUI {
             this._markAsDirty();
         }           
 
+        /** Gets or sets group name */
         public group = "";        
 
+        /** Observable raised when isChecked is changed */
         public onIsCheckedChangedObservable = new Observable<boolean>();
 
+        /** Gets or sets a value indicating the ratio between overall size and check size */
         public get checkSizeRatio(): number {
             return this._checkSizeRatio;
         }
@@ -39,6 +46,7 @@ module BABYLON.GUI {
             this._markAsDirty();
         }             
 
+        /** Gets or sets background color */
         public get background(): string {
             return this._background;
         }
@@ -52,6 +60,7 @@ module BABYLON.GUI {
             this._markAsDirty();
         }     
 
+        /** Gets or sets a boolean indicating if the checkbox is checked or not */
         public get isChecked(): boolean {
             return this._isChecked;
         }
@@ -84,6 +93,10 @@ module BABYLON.GUI {
             }
         }                             
 
+        /**
+         * Creates a new RadioButton
+         * @param name defines the control name
+         */        
         constructor(public name?: string) {
             super(name);
 

+ 8 - 1
gui/src/2D/controls/rectangle.ts

@@ -1,10 +1,12 @@
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GUI {
+    /** Class used to create rectangle container */
     export class Rectangle extends Container {
         private _thickness = 1;
         private _cornerRadius = 0;
         
+        /** Gets or sets border thickness */        
         public get thickness(): number {
             return this._thickness;
         }
@@ -18,6 +20,7 @@ module BABYLON.GUI {
             this._markAsDirty();
         }   
         
+        /** Gets or sets the corner radius angle */
         public get cornerRadius(): number {
             return this._cornerRadius;
         }
@@ -34,7 +37,11 @@ module BABYLON.GUI {
             this._cornerRadius = value;
             this._markAsDirty();
         }   
-       
+     
+        /**
+         * Creates a new Rectangle
+         * @param name defines the control name
+         */       
         constructor(public name?: string) {
             super(name);
         }

+ 19 - 3
gui/src/2D/controls/slider.ts

@@ -1,6 +1,9 @@
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GUI {
+    /**
+     * Class used to create slider controls
+     */
     export class Slider extends Control {
         private _thumbWidth = new ValueAndUnit(30, ValueAndUnit.UNITMODE_PIXEL, false);
         private _minimum = 0;
@@ -12,8 +15,10 @@ module BABYLON.GUI {
         private _isThumbCircle = false;
         private _isThumbClamped = false;
 
+        /** Observable raised when the sldier value changes */
         public onValueChangedObservable = new Observable<number>();
 
+        /** Gets or sets border color */
         public get borderColor(): string {
             return this._borderColor;
         }
@@ -27,6 +32,7 @@ module BABYLON.GUI {
             this._markAsDirty();
         }
 
+        /** Gets or sets background color */
         public get background(): string {
             return this._background;
         }
@@ -40,10 +46,12 @@ module BABYLON.GUI {
             this._markAsDirty();
         }
 
+        /** Gets or sets main bar offset */
         public get barOffset(): string | number {
             return this._barOffset.toString(this._host);
         }
 
+        /** Gets main bar offset in pixels*/
         public get barOffsetInPixels(): number {
             return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
         }
@@ -58,10 +66,12 @@ module BABYLON.GUI {
             }
         }
 
+        /** Gets or sets thumb width */
         public get thumbWidth(): string | number {
             return this._thumbWidth.toString(this._host);
         }
 
+        /** Gets thumb width in pixels */       
         public get thumbWidthInPixels(): number {
             return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
         }
@@ -76,6 +86,7 @@ module BABYLON.GUI {
             }
         }
 
+        /** Gets or sets minimum value */
         public get minimum(): number {
             return this._minimum;
         }
@@ -91,6 +102,7 @@ module BABYLON.GUI {
             this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
         }
 
+        /** Gets or sets maximum value */        
         public get maximum(): number {
             return this._maximum;
         }
@@ -106,6 +118,7 @@ module BABYLON.GUI {
             this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
         }
 
+        /** Gets or sets current value */
         public get value(): number {
             return this._value;
         }
@@ -122,6 +135,7 @@ module BABYLON.GUI {
             this.onValueChangedObservable.notifyObservers(this._value);
         }
 
+        /** Gets or sets a boolean indicating if the thumb should be round or square */
         public get isThumbCircle(): boolean {
             return this._isThumbCircle;
         }
@@ -135,12 +149,11 @@ module BABYLON.GUI {
             this._markAsDirty();
         }
 
-
+        /** Gets or sets a value indicating if the thumb can go over main bar extends */
         public get isThumbClamped(): boolean {
             return this._isThumbClamped;
         }
 
-
         public set isThumbClamped(value: boolean) {
             if (this._isThumbClamped === value) {
                 return;
@@ -150,7 +163,10 @@ module BABYLON.GUI {
             this._markAsDirty();
         }
 
-
+       /**
+        * Creates a new Slider
+        * @param name defines the control name
+        */
         constructor(public name?: string) {
             super(name);
 

+ 10 - 0
gui/src/2D/controls/stackPanel.ts

@@ -1,6 +1,9 @@
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GUI {
+    /**
+     * Class used to create a 2D stack panel container
+     */
     export class StackPanel extends Container {
         private _isVertical = true;
         private _manualWidth = false;
@@ -8,6 +11,7 @@ module BABYLON.GUI {
         private _doNotTrackManualChanges = false;
         private _tempMeasureStore = Measure.Empty();
 
+        /** Gets or sets a boolean indicating if the stack panel is vertical or horizontal*/
         public get isVertical(): boolean {
             return this._isVertical;
         }
@@ -21,6 +25,7 @@ module BABYLON.GUI {
             this._markAsDirty();
         }
        
+        /** Gets or sets panel width */
         public set width(value: string | number ) {
             if (!this._doNotTrackManualChanges) {
                 this._manualWidth = true;
@@ -39,6 +44,7 @@ module BABYLON.GUI {
             return this._width.toString(this._host);
         }        
 
+        /** Gets or sets panel height */
         public set height(value: string | number ) {
             if (!this._doNotTrackManualChanges) {
                 this._manualHeight = true;
@@ -57,6 +63,10 @@ module BABYLON.GUI {
             return this._height.toString(this._host);
         }
     
+        /**
+         * Creates a new StackPanel
+         * @param name defines control name
+         */
         constructor(public name?: string) {
             super(name);
         }

+ 3 - 0
gui/src/2D/controls/textBlock.ts

@@ -1,6 +1,9 @@
 /// <reference path="../../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON.GUI {
+    /**
+     * Class used to create text block control
+     */
     export class TextBlock extends Control {
         private _text = "";
         private _textWrapping = false;

+ 48 - 0
gui/src/2D/controls/virtualKeyboard.ts

@@ -2,34 +2,60 @@
 
 module BABYLON.GUI {
 
+    /**
+     * Class used to store key control properties
+     */
     export class KeyPropertySet {
+        /** Width */
         width?: string;
+        /** Height */
         height?: string;
+        /** Left padding */
         paddingLeft?: string;
+        /** Right padding */
         paddingRight?: string;
+        /** Top padding */
         paddingTop?: string;
+        /** Bottom padding */
         paddingBottom?: string;
+        /** Foreground color */
         color?: string;
+        /** Background color */
         background?: string;
     }
 
+    /**
+     * Class used to create virtual keyboard
+     */
     export class VirtualKeyboard extends StackPanel {
+        /** Observable raised when a key is pressed */
         public onKeyPressObservable = new Observable<string>();
 
+        /** Gets or sets default key button width */
         public defaultButtonWidth = "40px";
+        /** Gets or sets default key button height */
         public defaultButtonHeight = "40px";
 
+        /** Gets or sets default key button left padding */
         public defaultButtonPaddingLeft = "2px";
+        /** Gets or sets default key button right padding */
         public defaultButtonPaddingRight = "2px";
+        /** Gets or sets default key button top padding */
         public defaultButtonPaddingTop = "2px";
+        /** Gets or sets default key button bottom padding */
         public defaultButtonPaddingBottom = "2px";
 
+        /** Gets or sets default key button foreground color */
         public defaultButtonColor = "#DDD";
+        /** Gets or sets default key button background color */
         public defaultButtonBackground = "#070707";
 
+        /** Gets or sets shift button foreground color */
         public shiftButtonColor = "#7799FF";
+        /** Gets or sets shift button thickness*/
         public selectedShiftThickness = 1;
 
+        /** Gets shift key state */
         public shiftState = 0;
 
         protected _getTypeName(): string {
@@ -63,6 +89,11 @@ module BABYLON.GUI {
             return button;
         }
 
+        /**
+         * Adds a new row of keys
+         * @param keys defines the list of keys to add
+         * @param propertySets defines the associated property sets
+         */
         public addKeysRow(keys: Array<string>, propertySets?: Array<KeyPropertySet>): void {
             let panel = new StackPanel();
             panel.isVertical = false;
@@ -81,6 +112,10 @@ module BABYLON.GUI {
             this.addControl(panel);
         }
 
+        /**
+         * Set the shift key to a specific state
+         * @param shiftState defines the new shift state
+         */
         public applyShiftState(shiftState: number): void {
             if (!this.children) {
                 return;
@@ -117,10 +152,15 @@ module BABYLON.GUI {
         private _onBlurObserver: Nullable<Observer<InputText>>;
         private _onKeyPressObserver: Nullable<Observer<string>>;
 
+        /** Gets the input text control attached with the keyboard */
         public get connectedInputText(): Nullable<InputText> {
             return this._connectedInputText;
         }
 
+        /**
+         * Connects the keyboard with an input text control
+         * @param input defines the target control
+         */
         public connect(input: InputText): void {
             this.isVisible = false;
             this._connectedInputText = input;
@@ -162,6 +202,9 @@ module BABYLON.GUI {
             });
         }
 
+        /**
+         * Disconnects the keyboard from an input text control
+         */
         public disconnect(): void {
             if (!this._connectedInputText) {
                 return;
@@ -175,6 +218,11 @@ module BABYLON.GUI {
         }
 
         // Statics
+
+        /**
+         * Creates a new keyboard using a default layout
+         * @returns a new VirtualKeyboard
+         */
         public static CreateDefaultLayout(): VirtualKeyboard {
             let returnValue = new VirtualKeyboard();
 

+ 77 - 1
gui/src/2D/math2D.ts

@@ -10,18 +10,41 @@ module BABYLON.GUI {
          * @param source defines the vector2 data to transport
          * @param buttonIndex defines the current mouse button index
          */    
-        public constructor(source: Vector2, public buttonIndex: number = 0) {
+        public constructor(source: Vector2, 
+            /** defines the current mouse button index */
+            public buttonIndex: number = 0) {
             super(source.x, source.y);
         }
     }
 
+    /** Class used to provide 2D matrix features */
     export class Matrix2D {
+        /** Gets the internal array of 6 floats used to store matrix data */
         public m = new Float32Array(6);
 
+        /**
+         * Creates a new matrix
+         * @param m00 defines value for (0, 0)
+         * @param m01 defines value for (0, 1) 
+         * @param m10 defines value for (1, 0) 
+         * @param m11 defines value for (1, 1) 
+         * @param m20 defines value for (2, 0) 
+         * @param m21 defines value for (2, 1) 
+         */
         constructor(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number) {
             this.fromValues(m00, m01, m10, m11, m20, m21);
         }
 
+        /**
+         * Fills the matrix from direct values
+         * @param m00 defines value for (0, 0)
+         * @param m01 defines value for (0, 1)
+         * @param m10 defines value for (1, 0)
+         * @param m11 defines value for (1, 1)
+         * @param m20 defines value for (2, 0)
+         * @param m21 defines value for (2, 1)
+         * @returns the current modified matrix
+         */
         public fromValues(m00: number, m01: number, m10: number, m11: number, m20: number, m21: number): Matrix2D {
             this.m[0] = m00; this.m[1] = m01; 
             this.m[2] = m10; this.m[3] = m11;
@@ -29,10 +52,19 @@ module BABYLON.GUI {
             return this;
         }
 
+        /** 
+         * Gets matrix determinant
+         * @returns the determinant
+         */
         public determinant(): number {
             return this.m[0] * this.m[3] - this.m[1] * this.m[2];
         }
 
+        /**
+         * Inverses the matrix and stores it in a target matrix
+         * @param result defines the target matrix
+         * @returns the current matrix
+         */
         public invertToRef(result: Matrix2D): Matrix2D {
             let l0 = this.m[0]; let l1 = this.m[1];
             let l2 = this.m[2]; let l3 = this.m[3];
@@ -58,6 +90,12 @@ module BABYLON.GUI {
             return this;
         }
 
+        /**
+         * Multiplies the current matrix with another one
+         * @param other defines the second operand
+         * @param result defines the target matrix 
+         * @returns the current matrix
+         */
         public multiplyToRef(other: Matrix2D, result: Matrix2D): Matrix2D {
             let l0 = this.m[0];     let l1 = this.m[1];
             let l2 = this.m[2];     let l3 = this.m[3];
@@ -74,6 +112,13 @@ module BABYLON.GUI {
             return this;
         }
 
+        /**
+         * Apply the current matrix to a set of 2 floats and stores the result in a vector2
+         * @param x defines the x coordinate to transform
+         * @param y defines the x coordinate to transform 
+         * @param result defines the target vector2 
+         * @returns the current matrix
+         */
         public transformCoordinates(x: number, y: number, result: Vector2): Matrix2D {
             result.x = x * this.m[0] + y * this.m[2] + this.m[4];
             result.y = x * this.m[1] + y * this.m[3] + this.m[5];
@@ -82,18 +127,39 @@ module BABYLON.GUI {
         }
 
         // Statics
+        /**
+         * Creates an identity matrix
+         * @returns a new matrix
+         */
         public static Identity(): Matrix2D {
             return new Matrix2D(1, 0, 0, 1, 0, 0);
         }
 
+        /**
+         * Creates a translation matrix and stores it in a target matrix
+         * @param x defines the x coordinate of the translation
+         * @param y defines the y coordinate of the translation 
+         * @param result defines the target matrix
+         */
         public static TranslationToRef(x: number, y: number, result: Matrix2D): void {
             result.fromValues(1, 0, 0, 1, x, y);
         }
 
+        /**
+         * Creates a scaling matrix and stores it in a target matrix
+         * @param x defines the x coordinate of the scaling
+         * @param y defines the y coordinate of the scaling 
+         * @param result defines the target matrix
+         */
         public static ScalingToRef(x: number, y: number, result: Matrix2D): void {
             result.fromValues(x, 0, 0, y,  0, 0);
         }
 
+        /**
+         * Creates a rotation matrix and stores it in a target matrix
+         * @param angle defines the rotation angle
+         * @param result defines the target matrix
+         */        
         public static RotationToRef(angle: number, result: Matrix2D): void {
             var s = Math.sin(angle);
             var c = Math.cos(angle);
@@ -109,6 +175,16 @@ module BABYLON.GUI {
         private static _TempCompose1 = Matrix2D.Identity();
         private static _TempCompose2 = Matrix2D.Identity();
 
+        /**
+         * Compose a matrix from translation, rotation, scaling and parent matrix and stores it in a target matrix 
+         * @param tx defines the x coordinate of the translation
+         * @param ty defines the y coordinate of the translation 
+         * @param angle defines the rotation angle 
+         * @param scaleX defines the x coordinate of the scaling
+         * @param scaleY defines the y coordinate of the scaling 
+         * @param parentMatrix defines the parent matrix to multiply by (can be null)
+         * @param result defines the target matrix 
+         */
         public static ComposeToRef(tx: number, ty: number, angle: number, scaleX: number, scaleY: number, parentMatrix: Nullable<Matrix2D>,  result: Matrix2D): void {
             Matrix2D.TranslationToRef(tx, ty, Matrix2D._TempPreTranslationMatrix);
 

+ 1 - 0
gui/src/2D/measure.ts

@@ -63,6 +63,7 @@ module BABYLON.GUI {
 
         /**
          * Creates an empty measure
+         * @returns a new measure
          */
         public static Empty(): Measure {
             return new Measure(0, 0, 0, 0);

+ 3 - 1
gui/src/3D/vector3WithInfo.ts

@@ -10,7 +10,9 @@ module BABYLON.GUI {
          * @param source defines the vector3 data to transport
          * @param buttonIndex defines the current mouse button index
          */
-        public constructor(source: Vector3, public buttonIndex: number = 0) {
+        public constructor(source: Vector3, 
+            /** defines the current mouse button index */
+            public buttonIndex: number = 0) {
             super(source.x, source.y, source.z);
         }
     }