David Catuhe 7 år sedan
förälder
incheckning
791d4de9ee
30 ändrade filer med 11761 tillägg och 11595 borttagningar
  1. 3700 3697
      Playground/babylon.d.txt
  2. 2494 2481
      dist/preview release/babylon.d.ts
  3. 45 45
      dist/preview release/babylon.js
  4. 217 136
      dist/preview release/babylon.max.js
  5. 48 48
      dist/preview release/babylon.worker.js
  6. 4912 4919
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  7. 34 34
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  8. 176 128
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  9. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  10. 1 5
      dist/preview release/inspector/babylon.inspector.d.ts
  11. 50 44
      dist/preview release/inspector/babylon.inspector.js
  12. 4 4
      dist/preview release/inspector/babylon.inspector.min.js
  13. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  14. 1 1
      dist/preview release/loaders/babylonjs.loaders.min.js
  15. 1 1
      dist/preview release/materialsLibrary/babylon.skyMaterial.js
  16. 1 1
      dist/preview release/materialsLibrary/babylon.skyMaterial.min.js
  17. 1 1
      dist/preview release/materialsLibrary/babylonjs.materials.js
  18. 1 1
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  19. 3 0
      inspector/src/Inspector.ts
  20. 1 1
      inspector/src/helpers/Helpers.ts
  21. 3 5
      inspector/src/scheduler/Scheduler.ts
  22. 2 4
      inspector/src/treetools/Info.ts
  23. 0 2
      inspector/src/treetools/SoundInteractions.ts
  24. 32 25
      src/Cameras/VR/babylon.vrExperienceHelper.ts
  25. 0 1
      src/Engine/babylon.engine.ts
  26. 22 2
      src/Materials/babylon.imageProcessingConfiguration.ts
  27. 3 1
      src/Materials/babylon.standardMaterial.ts
  28. 1 1
      src/PostProcess/babylon.passPostProcess.ts
  29. 2 1
      src/PostProcess/babylon.postProcess.ts
  30. 1 1
      src/Tools/babylon.dds.ts

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3700 - 3697
Playground/babylon.d.txt


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2494 - 2481
dist/preview release/babylon.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 45 - 45
dist/preview release/babylon.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 217 - 136
dist/preview release/babylon.max.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 48 - 48
dist/preview release/babylon.worker.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4912 - 4919
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 34 - 34
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


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

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

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


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

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

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

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

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 4 - 4
dist/preview release/inspector/babylon.inspector.min.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.skyMaterial.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylon.skyMaterial.min.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylonjs.materials.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
dist/preview release/materialsLibrary/babylonjs.materials.min.js


+ 3 - 0
inspector/src/Inspector.ts

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

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

@@ -202,7 +202,7 @@ module INSPECTOR {
          * Returns an array of string corresponding to tjhe list of properties of the object to be displayed
          * @param obj 
          */
-        public static GetAllLinesPropertiesAsString(obj: any, dontTakeThis: Array<string>): Array<string> {
+        public static GetAllLinesPropertiesAsString(obj: any, dontTakeThis: Array<string> = []): Array<string> {
             let props: Array<string> = [];
 
             for (let prop in obj) {

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

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

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

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

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

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

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

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

+ 0 - 1
src/Engine/babylon.engine.ts

@@ -2489,7 +2489,6 @@
                 }
                 return compiledEffect;
             }
-
             var effect = new Effect(baseName, attributesNamesOrOptions, uniformsNamesOrEngine, samplers, this, defines, fallbacks, onCompiled, onError, indexParameters);
             effect._key = name;
             this._compiledEffects[name] = effect;

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

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

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

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

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

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

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

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

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

@@ -517,7 +517,7 @@
                             engine._uploadCompressedDataToTexture(sampler, i, internalFormat, width, height, byteArray);
                         }
                     }
-                    dataOffset += dataLength;
+                    dataOffset += bpp ? (width * height * (bpp / 8)) : dataLength;
                     width *= 0.5;
                     height *= 0.5;