Pārlūkot izejas kodu

Merge pull request #2729 from BabylonJS/master

Nightly
David Catuhe 8 gadi atpakaļ
vecāks
revīzija
77965d9bda
44 mainītis faili ar 15272 papildinājumiem un 14459 dzēšanām
  1. 5292 5241
      dist/preview release/babylon.d.ts
  2. 43 43
      dist/preview release/babylon.js
  3. 260 77
      dist/preview release/babylon.max.js
  4. 5292 5241
      dist/preview release/babylon.module.d.ts
  5. 44 44
      dist/preview release/babylon.worker.js
  6. 1731 1680
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  7. 32 32
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  8. 216 56
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  9. 1731 1680
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts
  10. 1 1
      dist/preview release/gui/babylon.gui.min.js
  11. 263 263
      dist/preview release/inspector/babylon.inspector.bundle.js
  12. 3 3
      dist/preview release/inspector/babylon.inspector.min.js
  13. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  14. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  15. 3 3
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  16. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  17. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  18. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  19. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  20. 1 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  21. 1 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  22. 39 0
      src/Cameras/babylon.arcRotateCamera.ts
  23. 26 0
      src/Cameras/babylon.camera.ts
  24. 1 1
      src/Cameras/babylon.freeCamera.ts
  25. 40 0
      src/Cameras/babylon.targetCamera.ts
  26. 23 10
      src/Layer/babylon.highlightlayer.ts
  27. 18 12
      src/Layer/babylon.layer.ts
  28. 9 1
      src/Materials/Textures/babylon.internalTexture.ts
  29. 19 3
      src/Materials/Textures/babylon.multiRenderTarget.ts
  30. 4 0
      src/Materials/Textures/babylon.renderTargetTexture.ts
  31. 4 0
      src/Particles/babylon.gpuParticleSystem.ts
  32. 25 13
      src/Particles/babylon.particleSystem.ts
  33. 6 0
      src/PostProcess/RenderPipeline/Pipelines/babylon.ssao2RenderingPipeline.ts
  34. 5 0
      src/PostProcess/RenderPipeline/Pipelines/babylon.ssaoRenderingPipeline.ts
  35. 28 10
      src/PostProcess/RenderPipeline/babylon.postProcessRenderPipeline.ts
  36. 25 5
      src/PostProcess/RenderPipeline/babylon.postProcessRenderPipelineManager.ts
  37. 0 4
      src/PostProcess/babylon.postProcess.ts
  38. 13 1
      src/PostProcess/babylon.postProcessManager.ts
  39. 10 0
      src/Rendering/babylon.boundingBoxRenderer.ts
  40. 25 22
      src/babylon.engine.ts
  41. 23 3
      src/babylon.scene.ts
  42. BIN
      tests/validation/ReferenceImages/DefaultRenderingPipeline.png
  43. 7 1
      tests/validation/config.json
  44. 2 0
      tests/validation/validation.js

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 5292 - 5241
dist/preview release/babylon.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 43 - 43
dist/preview release/babylon.js


+ 260 - 77
dist/preview release/babylon.max.js

@@ -8117,13 +8117,9 @@ var BABYLON;
                 scene._rebuildGeometries();
                 scene._rebuildTextures();
             }
-            for (var _b = 0, _c = this.postProcesses; _b < _c.length; _b++) {
-                var postprocess = _c[_b];
-                postprocess._rebuild();
-            }
             // Uniforms
-            for (var _d = 0, _e = this._uniformBuffers; _d < _e.length; _d++) {
-                var uniformBuffer = _e[_d];
+            for (var _b = 0, _c = this._uniformBuffers; _b < _c.length; _b++) {
+                var uniformBuffer = _c[_b];
                 uniformBuffer._rebuild();
             }
         };
@@ -8423,22 +8419,21 @@ var BABYLON;
             }
         };
         Engine.prototype._renderLoop = function () {
-            if (this._contextWasLost) {
-                return;
-            }
-            var shouldRender = true;
-            if (!this.renderEvenInBackground && this._windowIsBackground) {
-                shouldRender = false;
-            }
-            if (shouldRender) {
-                // Start new frame
-                this.beginFrame();
-                for (var index = 0; index < this._activeRenderLoops.length; index++) {
-                    var renderFunction = this._activeRenderLoops[index];
-                    renderFunction();
+            if (!this._contextWasLost) {
+                var shouldRender = true;
+                if (!this.renderEvenInBackground && this._windowIsBackground) {
+                    shouldRender = false;
+                }
+                if (shouldRender) {
+                    // Start new frame
+                    this.beginFrame();
+                    for (var index = 0; index < this._activeRenderLoops.length; index++) {
+                        var renderFunction = this._activeRenderLoops[index];
+                        renderFunction();
+                    }
+                    // Present
+                    this.endFrame();
                 }
-                // Present
-                this.endFrame();
             }
             if (this._activeRenderLoops.length > 0) {
                 // Register new frame
@@ -10363,6 +10358,11 @@ var BABYLON;
         Engine.prototype.updateRawCubeTexture = function (texture, data, format, type, invertY, compression, level) {
             if (compression === void 0) { compression = null; }
             if (level === void 0) { level = 0; }
+            texture._bufferViewArray = data;
+            texture.format = format;
+            texture.type = type;
+            texture.invertY = invertY;
+            texture._compression = compression;
             var gl = this._gl;
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
@@ -10406,6 +10406,9 @@ var BABYLON;
             texture.generateMipMaps = generateMipMaps;
             texture.format = format;
             texture.type = type;
+            if (!this._doNotHandleContextLost) {
+                texture._bufferViewArray = data;
+            }
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
             var internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
@@ -10423,7 +10426,7 @@ var BABYLON;
             if (!isPot) {
                 generateMipMaps = false;
             }
-            // Upload data if needed. The texture won t be ready until then.
+            // Upload data if needed. The texture won't be ready until then.
             if (data) {
                 this.updateRawCubeTexture(texture, data, format, type, invertY, compression);
             }
@@ -14890,6 +14893,24 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Store current camera state (fov, position, etc..)
+         */
+        Camera.prototype.storeState = function () {
+            this._stateStored = true;
+            this._storedFov = this.fov;
+            return this;
+        };
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        Camera.prototype.restoreState = function () {
+            if (!this._stateStored) {
+                return false;
+            }
+            this.fov = this._storedFov;
+            return true;
+        };
         Camera.prototype.getClassName = function () {
             return "Camera";
         };
@@ -19091,6 +19112,9 @@ var BABYLON;
             this._sceneUbo.dispose();
             // Post-processes
             this.postProcessManager.dispose();
+            if (this._postProcessRenderPipelineManager) {
+                this._postProcessRenderPipelineManager.dispose();
+            }
             // Physics
             if (this._physicsEngine) {
                 this.disablePhysicsEngine();
@@ -19401,14 +19425,27 @@ var BABYLON;
                 var mesh = _c[_b];
                 mesh._rebuild();
             }
-            for (var _d = 0, _e = this.postProcesses; _d < _e.length; _d++) {
-                var postprocess = _e[_d];
-                postprocess._rebuild();
+            if (this.postProcessManager) {
+                this.postProcessManager._rebuild();
             }
-            for (var _f = 0, _g = this.layers; _f < _g.length; _f++) {
-                var layer = _g[_f];
+            for (var _d = 0, _e = this.layers; _d < _e.length; _d++) {
+                var layer = _e[_d];
                 layer._rebuild();
             }
+            for (var _f = 0, _g = this.highlightLayers; _f < _g.length; _f++) {
+                var highlightLayer = _g[_f];
+                highlightLayer._rebuild();
+            }
+            if (this._boundingBoxRenderer) {
+                this._boundingBoxRenderer._rebuild();
+            }
+            for (var _h = 0, _j = this.particleSystems; _h < _j.length; _h++) {
+                var system = _j[_h];
+                system.rebuild();
+            }
+            if (this._postProcessRenderPipelineManager) {
+                this._postProcessRenderPipelineManager._rebuild();
+            }
         };
         Scene.prototype._rebuildTextures = function () {
             for (var _i = 0, _a = this.textures; _i < _a.length; _i++) {
@@ -20044,6 +20081,11 @@ var BABYLON;
                     }, null, this.format, this._extension);
                     proxy._swapAndDie(this);
                     return;
+                case InternalTexture.DATASOURCE_CUBERAW:
+                    proxy = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression);
+                    proxy._swapAndDie(this);
+                    this.isReady = true;
+                    return;
                 case InternalTexture.DATASOURCE_CUBEPREFILTERED:
                     proxy = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, function (proxy) {
                         proxy._swapAndDie(_this);
@@ -29776,6 +29818,9 @@ var BABYLON;
             vertices.push(-1, -1);
             vertices.push(1, -1);
             this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(this._scene.getEngine(), vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
+            this._buildIndexBuffer();
+        };
+        PostProcessManager.prototype._buildIndexBuffer = function () {
             // Indices
             var indices = [];
             indices.push(0);
@@ -29786,6 +29831,13 @@ var BABYLON;
             indices.push(3);
             this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
         };
+        PostProcessManager.prototype._rebuild = function () {
+            if (!this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]) {
+                return;
+            }
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]._rebuild();
+            this._buildIndexBuffer();
+        };
         // Methods
         PostProcessManager.prototype._prepareFrame = function (sourceTexture, postProcesses) {
             var postProcesses = postProcesses || this._scene.activeCamera._postProcesses;
@@ -34246,6 +34298,30 @@ var BABYLON;
             }
             return this.lockedTarget.absolutePosition || this.lockedTarget;
         };
+        TargetCamera.prototype.storeState = function () {
+            this._storedPosition = this.position.clone();
+            this._storedRotation = this.rotation.clone();
+            if (this.rotationQuaternion) {
+                this._storedRotationQuaternion = this.rotationQuaternion.clone();
+            }
+            return _super.prototype.storeState.call(this);
+        };
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        TargetCamera.prototype.restoreState = function () {
+            if (!_super.prototype.restoreState.call(this)) {
+                return false;
+            }
+            this.position = this._storedPosition.clone();
+            this.rotation = this._storedRotation.clone();
+            if (this.rotationQuaternion) {
+                this.rotationQuaternion = this._storedRotationQuaternion.clone();
+            }
+            this.cameraDirection.copyFromFloats(0, 0, 0);
+            this.cameraRotation.copyFromFloats(0, 0);
+            return true;
+        };
         // Cache
         TargetCamera.prototype._initCache = function () {
             _super.prototype._initCache.call(this);
@@ -35426,6 +35502,29 @@ var BABYLON;
             }
             return this._target;
         };
+        ArcRotateCamera.prototype.storeState = function () {
+            this._storedAlpha = this.alpha;
+            this._storedBeta = this.beta;
+            this._storedRadius = this.radius;
+            this._storedTarget = this._getTargetPosition().clone();
+            return _super.prototype.storeState.call(this);
+        };
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        ArcRotateCamera.prototype.restoreState = function () {
+            if (!_super.prototype.restoreState.call(this)) {
+                return false;
+            }
+            this.alpha = this._storedAlpha;
+            this.beta = this._storedBeta;
+            this.radius = this._storedRadius;
+            this.setTarget(this._storedTarget);
+            this.inertialAlphaOffset = 0;
+            this.inertialBetaOffset = 0;
+            this.inertialRadiusOffset = 0;
+            return true;
+        };
         // Synchronized
         ArcRotateCamera.prototype._isSynchronizedViewMatrix = function () {
             if (!_super.prototype._isSynchronizedViewMatrix.call(this))
@@ -40463,18 +40562,7 @@ var BABYLON;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._customEffect = customEffect;
             scene.particleSystems.push(this);
-            var indices = [];
-            var index = 0;
-            for (var count = 0; count < capacity; count++) {
-                indices.push(index);
-                indices.push(index + 1);
-                indices.push(index + 2);
-                indices.push(index);
-                indices.push(index + 2);
-                indices.push(index + 3);
-                index += 4;
-            }
-            this._indexBuffer = scene.getEngine().createIndexBuffer(indices);
+            this._createIndexBuffer();
             // 11 floats per particle (x, y, z, r, g, b, a, angle, size, offsetX, offsetY) + 1 filler
             this._vertexData = new Float32Array(capacity * 11 * 4);
             this._vertexBuffer = new BABYLON.Buffer(scene.getEngine(), this._vertexData, true, 11);
@@ -40530,6 +40618,20 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        ParticleSystem.prototype._createIndexBuffer = function () {
+            var indices = [];
+            var index = 0;
+            for (var count = 0; count < this._capacity; count++) {
+                indices.push(index);
+                indices.push(index + 1);
+                indices.push(index + 2);
+                indices.push(index);
+                indices.push(index + 2);
+                indices.push(index + 3);
+                index += 4;
+            }
+            this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
+        };
         ParticleSystem.prototype.recycleParticle = function (particle) {
             var lastParticle = this.particles.pop();
             if (lastParticle !== particle) {
@@ -40684,6 +40786,10 @@ var BABYLON;
             }
             this._vertexBuffer.update(this._vertexData);
         };
+        ParticleSystem.prototype.rebuild = function () {
+            this._createIndexBuffer();
+            this._vertexBuffer._rebuild();
+        };
         ParticleSystem.prototype.render = function () {
             var effect = this._getEffect();
             // Check
@@ -45906,6 +46012,9 @@ var BABYLON;
             if (this.refreshRate === RenderTargetTexture.REFRESHRATE_RENDER_ONCE) {
                 this.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE;
             }
+            if (this._postProcessManager) {
+                this._postProcessManager._rebuild();
+            }
         };
         RenderTargetTexture._REFRESHRATE_RENDER_ONCE = 0;
         RenderTargetTexture._REFRESHRATE_RENDER_ONEVERYFRAME = 1;
@@ -45963,8 +46072,8 @@ var BABYLON;
                 types: types,
                 textureCount: count
             };
-            _this._internalTextures = scene.getEngine().createMultipleRenderTarget(size, _this._multiRenderTargetOptions);
             _this._createInternalTextures();
+            _this._createTextures();
             return _this;
         }
         Object.defineProperty(MultiRenderTarget.prototype, "isSupported", {
@@ -45989,7 +46098,20 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        MultiRenderTarget.prototype._rebuild = function () {
+            this.releaseInternalTextures();
+            this._createInternalTextures();
+            for (var i = 0; i < this._internalTextures.length; i++) {
+                var texture = this._textures[i];
+                texture._texture = this._internalTextures[i];
+            }
+            // Keeps references to frame buffer and stencil/depth buffer
+            this._texture = this._internalTextures[0];
+        };
         MultiRenderTarget.prototype._createInternalTextures = function () {
+            this._internalTextures = this.getScene().getEngine().createMultipleRenderTarget(this._size, this._multiRenderTargetOptions);
+        };
+        MultiRenderTarget.prototype._createTextures = function () {
             this._textures = [];
             for (var i = 0; i < this._internalTextures.length; i++) {
                 var texture = new BABYLON.Texture(null, this.getScene());
@@ -46837,8 +46959,6 @@ var BABYLON;
             }
             this._textures.dispose();
         };
-        PostProcess.prototype._rebuild = function () {
-        };
         PostProcess.prototype.dispose = function (camera) {
             camera = camera || this._camera;
             this._disposeTextures();
@@ -52038,13 +52158,31 @@ var BABYLON;
         };
         PostProcessRenderPipelineManager.prototype.update = function () {
             for (var renderPipelineName in this._renderPipelines) {
-                var pipeline = this._renderPipelines[renderPipelineName];
-                if (!pipeline.isSupported) {
-                    pipeline.dispose();
-                    delete this._renderPipelines[renderPipelineName];
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
+                    if (!pipeline.isSupported) {
+                        pipeline.dispose();
+                        delete this._renderPipelines[renderPipelineName];
+                    }
+                    else {
+                        pipeline._update();
+                    }
                 }
-                else {
-                    pipeline._update();
+            }
+        };
+        PostProcessRenderPipelineManager.prototype._rebuild = function () {
+            for (var renderPipelineName in this._renderPipelines) {
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
+                    pipeline._rebuild();
+                }
+            }
+        };
+        PostProcessRenderPipelineManager.prototype.dispose = function () {
+            for (var renderPipelineName in this._renderPipelines) {
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
+                    pipeline.dispose();
                 }
             }
         };
@@ -52272,8 +52410,10 @@ var BABYLON;
         Object.defineProperty(PostProcessRenderPipeline.prototype, "isSupported", {
             get: function () {
                 for (var renderEffectName in this._renderEffects) {
-                    if (!this._renderEffects[renderEffectName].isSupported) {
-                        return false;
+                    if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                        if (!this._renderEffects[renderEffectName].isSupported) {
+                            return false;
+                        }
                     }
                 }
                 return true;
@@ -52284,6 +52424,9 @@ var BABYLON;
         PostProcessRenderPipeline.prototype.addEffect = function (renderEffect) {
             this._renderEffects[renderEffect._name] = renderEffect;
         };
+        // private
+        PostProcessRenderPipeline.prototype._rebuild = function () {
+        };
         PostProcessRenderPipeline.prototype._enableEffect = function (renderEffectName, cameras) {
             var renderEffects = this._renderEffects[renderEffectName];
             if (!renderEffects) {
@@ -52316,13 +52459,17 @@ var BABYLON;
                 cameras.splice(indicesToDelete[i], 1);
             }
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._attachCameras(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._attachCameras(_cam);
+                }
             }
         };
         PostProcessRenderPipeline.prototype._detachCameras = function (cameras) {
             var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras);
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._detachCameras(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._detachCameras(_cam);
+                }
             }
             for (var i = 0; i < _cam.length; i++) {
                 this._cameras.splice(this._cameras.indexOf(_cam[i]), 1);
@@ -52334,16 +52481,20 @@ var BABYLON;
             var pass = null;
             var renderEffectName;
             for (renderEffectName in this._renderEffects) {
-                pass = this._renderEffects[renderEffectName].getPass(passName);
-                if (pass != null) {
-                    break;
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    pass = this._renderEffects[renderEffectName].getPass(passName);
+                    if (pass != null) {
+                        break;
+                    }
                 }
             }
             if (pass === null) {
                 return;
             }
             for (renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._disable(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._disable(_cam);
+                }
             }
             pass._name = PostProcessRenderPipeline.PASS_SAMPLER_NAME;
             for (var i = 0; i < _cam.length; i++) {
@@ -52365,12 +52516,16 @@ var BABYLON;
                 this._renderEffectsForIsolatedPass[cameraName]._disable(camera);
             }
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._enable(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._enable(_cam);
+                }
             }
         };
         PostProcessRenderPipeline.prototype._update = function () {
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._update();
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._update();
+                }
             }
             for (var i = 0; i < this._cameras.length; i++) {
                 var cameraName = this._cameras[i].name;
@@ -52684,6 +52839,10 @@ var BABYLON;
                 }
             };
         };
+        SSAORenderingPipeline.prototype._rebuild = function () {
+            this._firstUpdate = true;
+            _super.prototype._rebuild.call(this);
+        };
         SSAORenderingPipeline.prototype._createSSAOPostProcess = function (ratio) {
             var _this = this;
             var numSamples = 16;
@@ -52983,6 +53142,10 @@ var BABYLON;
                 }
             };
         };
+        SSAO2RenderingPipeline.prototype._rebuild = function () {
+            this._firstUpdate = true;
+            _super.prototype._rebuild.call(this);
+        };
         SSAO2RenderingPipeline.prototype._generateHemisphere = function () {
             var numSamples = this.samples;
             var result = [];
@@ -63715,8 +63878,16 @@ var BABYLON;
             var engine = this._scene.getEngine();
             var boxdata = BABYLON.VertexData.CreateBox({ size: 1.0 });
             this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(engine, boxdata.positions, BABYLON.VertexBuffer.PositionKind, false);
+            this._createIndexBuffer();
+        };
+        BoundingBoxRenderer.prototype._createIndexBuffer = function () {
+            var engine = this._scene.getEngine();
             this._indexBuffer = engine.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]);
         };
+        BoundingBoxRenderer.prototype._rebuild = function () {
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]._rebuild();
+            this._createIndexBuffer();
+        };
         BoundingBoxRenderer.prototype.reset = function () {
             this.renderList.reset();
         };
@@ -68136,15 +68307,7 @@ var BABYLON;
             vertices.push(1, -1);
             var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
             this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer;
-            // Indices
-            var indices = [];
-            indices.push(0);
-            indices.push(1);
-            indices.push(2);
-            indices.push(0);
-            indices.push(2);
-            indices.push(3);
-            this._indexBuffer = engine.createIndexBuffer(indices);
+            this._createIndexBuffer();
             // Effect
             this._glowMapMergeEffect = engine.createEffect("glowMapMerge", [BABYLON.VertexBuffer.PositionKind], ["offset"], ["textureSampler"], "");
             // Render target
@@ -68194,6 +68357,22 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        HighlightLayer.prototype._createIndexBuffer = function () {
+            var engine = this._scene.getEngine();
+            // Indices
+            var indices = [];
+            indices.push(0);
+            indices.push(1);
+            indices.push(2);
+            indices.push(0);
+            indices.push(2);
+            indices.push(3);
+            this._indexBuffer = engine.createIndexBuffer(indices);
+        };
+        HighlightLayer.prototype._rebuild = function () {
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]._rebuild();
+            this._createIndexBuffer();
+        };
         /**
          * Creates the render target textures and post processes used in the highlight layer.
          */
@@ -70242,7 +70421,15 @@ var BABYLON;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._scene.layers.push(this);
             var engine = this._scene.getEngine();
-            this._rebuild();
+            // VBO
+            var vertices = [];
+            vertices.push(1, 1);
+            vertices.push(-1, 1);
+            vertices.push(-1, -1);
+            vertices.push(1, -1);
+            var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer;
+            this._createIndexBuffer();
             // Effects
             this._effect = engine.createEffect("layer", [BABYLON.VertexBuffer.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], "");
             this._alphaTestEffect = engine.createEffect("layer", [BABYLON.VertexBuffer.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], "#define ALPHATEST");
@@ -70277,16 +70464,8 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Layer.prototype._rebuild = function () {
+        Layer.prototype._createIndexBuffer = function () {
             var engine = this._scene.getEngine();
-            // VBO
-            var vertices = [];
-            vertices.push(1, 1);
-            vertices.push(-1, 1);
-            vertices.push(-1, -1);
-            vertices.push(1, -1);
-            var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
-            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer;
             // Indices
             var indices = [];
             indices.push(0);
@@ -70297,6 +70476,10 @@ var BABYLON;
             indices.push(3);
             this._indexBuffer = engine.createIndexBuffer(indices);
         };
+        Layer.prototype._rebuild = function () {
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]._rebuild();
+            this._createIndexBuffer();
+        };
         Layer.prototype.render = function () {
             var currentEffect = this.alphaTest ? this._alphaTestEffect : this._effect;
             // Check

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 5292 - 5241
dist/preview release/babylon.module.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 44 - 44
dist/preview release/babylon.worker.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1731 - 1680
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 32 - 32
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 216 - 56
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -8117,13 +8117,9 @@ var BABYLON;
                 scene._rebuildGeometries();
                 scene._rebuildTextures();
             }
-            for (var _b = 0, _c = this.postProcesses; _b < _c.length; _b++) {
-                var postprocess = _c[_b];
-                postprocess._rebuild();
-            }
             // Uniforms
-            for (var _d = 0, _e = this._uniformBuffers; _d < _e.length; _d++) {
-                var uniformBuffer = _e[_d];
+            for (var _b = 0, _c = this._uniformBuffers; _b < _c.length; _b++) {
+                var uniformBuffer = _c[_b];
                 uniformBuffer._rebuild();
             }
         };
@@ -8423,22 +8419,21 @@ var BABYLON;
             }
         };
         Engine.prototype._renderLoop = function () {
-            if (this._contextWasLost) {
-                return;
-            }
-            var shouldRender = true;
-            if (!this.renderEvenInBackground && this._windowIsBackground) {
-                shouldRender = false;
-            }
-            if (shouldRender) {
-                // Start new frame
-                this.beginFrame();
-                for (var index = 0; index < this._activeRenderLoops.length; index++) {
-                    var renderFunction = this._activeRenderLoops[index];
-                    renderFunction();
+            if (!this._contextWasLost) {
+                var shouldRender = true;
+                if (!this.renderEvenInBackground && this._windowIsBackground) {
+                    shouldRender = false;
+                }
+                if (shouldRender) {
+                    // Start new frame
+                    this.beginFrame();
+                    for (var index = 0; index < this._activeRenderLoops.length; index++) {
+                        var renderFunction = this._activeRenderLoops[index];
+                        renderFunction();
+                    }
+                    // Present
+                    this.endFrame();
                 }
-                // Present
-                this.endFrame();
             }
             if (this._activeRenderLoops.length > 0) {
                 // Register new frame
@@ -10363,6 +10358,11 @@ var BABYLON;
         Engine.prototype.updateRawCubeTexture = function (texture, data, format, type, invertY, compression, level) {
             if (compression === void 0) { compression = null; }
             if (level === void 0) { level = 0; }
+            texture._bufferViewArray = data;
+            texture.format = format;
+            texture.type = type;
+            texture.invertY = invertY;
+            texture._compression = compression;
             var gl = this._gl;
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
@@ -10406,6 +10406,9 @@ var BABYLON;
             texture.generateMipMaps = generateMipMaps;
             texture.format = format;
             texture.type = type;
+            if (!this._doNotHandleContextLost) {
+                texture._bufferViewArray = data;
+            }
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
             var internalSizedFomat = this._getRGBABufferInternalSizedFormat(type);
@@ -10423,7 +10426,7 @@ var BABYLON;
             if (!isPot) {
                 generateMipMaps = false;
             }
-            // Upload data if needed. The texture won t be ready until then.
+            // Upload data if needed. The texture won't be ready until then.
             if (data) {
                 this.updateRawCubeTexture(texture, data, format, type, invertY, compression);
             }
@@ -14890,6 +14893,24 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Store current camera state (fov, position, etc..)
+         */
+        Camera.prototype.storeState = function () {
+            this._stateStored = true;
+            this._storedFov = this.fov;
+            return this;
+        };
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        Camera.prototype.restoreState = function () {
+            if (!this._stateStored) {
+                return false;
+            }
+            this.fov = this._storedFov;
+            return true;
+        };
         Camera.prototype.getClassName = function () {
             return "Camera";
         };
@@ -19091,6 +19112,9 @@ var BABYLON;
             this._sceneUbo.dispose();
             // Post-processes
             this.postProcessManager.dispose();
+            if (this._postProcessRenderPipelineManager) {
+                this._postProcessRenderPipelineManager.dispose();
+            }
             // Physics
             if (this._physicsEngine) {
                 this.disablePhysicsEngine();
@@ -19401,14 +19425,27 @@ var BABYLON;
                 var mesh = _c[_b];
                 mesh._rebuild();
             }
-            for (var _d = 0, _e = this.postProcesses; _d < _e.length; _d++) {
-                var postprocess = _e[_d];
-                postprocess._rebuild();
+            if (this.postProcessManager) {
+                this.postProcessManager._rebuild();
             }
-            for (var _f = 0, _g = this.layers; _f < _g.length; _f++) {
-                var layer = _g[_f];
+            for (var _d = 0, _e = this.layers; _d < _e.length; _d++) {
+                var layer = _e[_d];
                 layer._rebuild();
             }
+            for (var _f = 0, _g = this.highlightLayers; _f < _g.length; _f++) {
+                var highlightLayer = _g[_f];
+                highlightLayer._rebuild();
+            }
+            if (this._boundingBoxRenderer) {
+                this._boundingBoxRenderer._rebuild();
+            }
+            for (var _h = 0, _j = this.particleSystems; _h < _j.length; _h++) {
+                var system = _j[_h];
+                system.rebuild();
+            }
+            if (this._postProcessRenderPipelineManager) {
+                this._postProcessRenderPipelineManager._rebuild();
+            }
         };
         Scene.prototype._rebuildTextures = function () {
             for (var _i = 0, _a = this.textures; _i < _a.length; _i++) {
@@ -20044,6 +20081,11 @@ var BABYLON;
                     }, null, this.format, this._extension);
                     proxy._swapAndDie(this);
                     return;
+                case InternalTexture.DATASOURCE_CUBERAW:
+                    proxy = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression);
+                    proxy._swapAndDie(this);
+                    this.isReady = true;
+                    return;
                 case InternalTexture.DATASOURCE_CUBEPREFILTERED:
                     proxy = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, function (proxy) {
                         proxy._swapAndDie(_this);
@@ -29776,6 +29818,9 @@ var BABYLON;
             vertices.push(-1, -1);
             vertices.push(1, -1);
             this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(this._scene.getEngine(), vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
+            this._buildIndexBuffer();
+        };
+        PostProcessManager.prototype._buildIndexBuffer = function () {
             // Indices
             var indices = [];
             indices.push(0);
@@ -29786,6 +29831,13 @@ var BABYLON;
             indices.push(3);
             this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
         };
+        PostProcessManager.prototype._rebuild = function () {
+            if (!this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]) {
+                return;
+            }
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]._rebuild();
+            this._buildIndexBuffer();
+        };
         // Methods
         PostProcessManager.prototype._prepareFrame = function (sourceTexture, postProcesses) {
             var postProcesses = postProcesses || this._scene.activeCamera._postProcesses;
@@ -31536,6 +31588,30 @@ var BABYLON;
             }
             return this.lockedTarget.absolutePosition || this.lockedTarget;
         };
+        TargetCamera.prototype.storeState = function () {
+            this._storedPosition = this.position.clone();
+            this._storedRotation = this.rotation.clone();
+            if (this.rotationQuaternion) {
+                this._storedRotationQuaternion = this.rotationQuaternion.clone();
+            }
+            return _super.prototype.storeState.call(this);
+        };
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        TargetCamera.prototype.restoreState = function () {
+            if (!_super.prototype.restoreState.call(this)) {
+                return false;
+            }
+            this.position = this._storedPosition.clone();
+            this.rotation = this._storedRotation.clone();
+            if (this.rotationQuaternion) {
+                this.rotationQuaternion = this._storedRotationQuaternion.clone();
+            }
+            this.cameraDirection.copyFromFloats(0, 0, 0);
+            this.cameraRotation.copyFromFloats(0, 0);
+            return true;
+        };
         // Cache
         TargetCamera.prototype._initCache = function () {
             _super.prototype._initCache.call(this);
@@ -32518,6 +32594,29 @@ var BABYLON;
             }
             return this._target;
         };
+        ArcRotateCamera.prototype.storeState = function () {
+            this._storedAlpha = this.alpha;
+            this._storedBeta = this.beta;
+            this._storedRadius = this.radius;
+            this._storedTarget = this._getTargetPosition().clone();
+            return _super.prototype.storeState.call(this);
+        };
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        ArcRotateCamera.prototype.restoreState = function () {
+            if (!_super.prototype.restoreState.call(this)) {
+                return false;
+            }
+            this.alpha = this._storedAlpha;
+            this.beta = this._storedBeta;
+            this.radius = this._storedRadius;
+            this.setTarget(this._storedTarget);
+            this.inertialAlphaOffset = 0;
+            this.inertialBetaOffset = 0;
+            this.inertialRadiusOffset = 0;
+            return true;
+        };
         // Synchronized
         ArcRotateCamera.prototype._isSynchronizedViewMatrix = function () {
             if (!_super.prototype._isSynchronizedViewMatrix.call(this))
@@ -33501,6 +33600,9 @@ var BABYLON;
             if (this.refreshRate === RenderTargetTexture.REFRESHRATE_RENDER_ONCE) {
                 this.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE;
             }
+            if (this._postProcessManager) {
+                this._postProcessManager._rebuild();
+            }
         };
         RenderTargetTexture._REFRESHRATE_RENDER_ONCE = 0;
         RenderTargetTexture._REFRESHRATE_RENDER_ONEVERYFRAME = 1;
@@ -33558,8 +33660,8 @@ var BABYLON;
                 types: types,
                 textureCount: count
             };
-            _this._internalTextures = scene.getEngine().createMultipleRenderTarget(size, _this._multiRenderTargetOptions);
             _this._createInternalTextures();
+            _this._createTextures();
             return _this;
         }
         Object.defineProperty(MultiRenderTarget.prototype, "isSupported", {
@@ -33584,7 +33686,20 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        MultiRenderTarget.prototype._rebuild = function () {
+            this.releaseInternalTextures();
+            this._createInternalTextures();
+            for (var i = 0; i < this._internalTextures.length; i++) {
+                var texture = this._textures[i];
+                texture._texture = this._internalTextures[i];
+            }
+            // Keeps references to frame buffer and stencil/depth buffer
+            this._texture = this._internalTextures[0];
+        };
         MultiRenderTarget.prototype._createInternalTextures = function () {
+            this._internalTextures = this.getScene().getEngine().createMultipleRenderTarget(this._size, this._multiRenderTargetOptions);
+        };
+        MultiRenderTarget.prototype._createTextures = function () {
             this._textures = [];
             for (var i = 0; i < this._internalTextures.length; i++) {
                 var texture = new BABYLON.Texture(null, this.getScene());
@@ -35255,8 +35370,6 @@ var BABYLON;
             }
             this._textures.dispose();
         };
-        PostProcess.prototype._rebuild = function () {
-        };
         PostProcess.prototype.dispose = function (camera) {
             camera = camera || this._camera;
             this._disposeTextures();
@@ -40846,7 +40959,15 @@ var BABYLON;
             this._scene = scene || BABYLON.Engine.LastCreatedScene;
             this._scene.layers.push(this);
             var engine = this._scene.getEngine();
-            this._rebuild();
+            // VBO
+            var vertices = [];
+            vertices.push(1, 1);
+            vertices.push(-1, 1);
+            vertices.push(-1, -1);
+            vertices.push(1, -1);
+            var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer;
+            this._createIndexBuffer();
             // Effects
             this._effect = engine.createEffect("layer", [BABYLON.VertexBuffer.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], "");
             this._alphaTestEffect = engine.createEffect("layer", [BABYLON.VertexBuffer.PositionKind], ["textureMatrix", "color", "scale", "offset"], ["textureSampler"], "#define ALPHATEST");
@@ -40881,16 +41002,8 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Layer.prototype._rebuild = function () {
+        Layer.prototype._createIndexBuffer = function () {
             var engine = this._scene.getEngine();
-            // VBO
-            var vertices = [];
-            vertices.push(1, 1);
-            vertices.push(-1, 1);
-            vertices.push(-1, -1);
-            vertices.push(1, -1);
-            var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
-            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer;
             // Indices
             var indices = [];
             indices.push(0);
@@ -40901,6 +41014,10 @@ var BABYLON;
             indices.push(3);
             this._indexBuffer = engine.createIndexBuffer(indices);
         };
+        Layer.prototype._rebuild = function () {
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]._rebuild();
+            this._createIndexBuffer();
+        };
         Layer.prototype.render = function () {
             var currentEffect = this.alphaTest ? this._alphaTestEffect : this._effect;
             // Check
@@ -42366,13 +42483,31 @@ var BABYLON;
         };
         PostProcessRenderPipelineManager.prototype.update = function () {
             for (var renderPipelineName in this._renderPipelines) {
-                var pipeline = this._renderPipelines[renderPipelineName];
-                if (!pipeline.isSupported) {
-                    pipeline.dispose();
-                    delete this._renderPipelines[renderPipelineName];
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
+                    if (!pipeline.isSupported) {
+                        pipeline.dispose();
+                        delete this._renderPipelines[renderPipelineName];
+                    }
+                    else {
+                        pipeline._update();
+                    }
                 }
-                else {
-                    pipeline._update();
+            }
+        };
+        PostProcessRenderPipelineManager.prototype._rebuild = function () {
+            for (var renderPipelineName in this._renderPipelines) {
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
+                    pipeline._rebuild();
+                }
+            }
+        };
+        PostProcessRenderPipelineManager.prototype.dispose = function () {
+            for (var renderPipelineName in this._renderPipelines) {
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
+                    pipeline.dispose();
                 }
             }
         };
@@ -42600,8 +42735,10 @@ var BABYLON;
         Object.defineProperty(PostProcessRenderPipeline.prototype, "isSupported", {
             get: function () {
                 for (var renderEffectName in this._renderEffects) {
-                    if (!this._renderEffects[renderEffectName].isSupported) {
-                        return false;
+                    if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                        if (!this._renderEffects[renderEffectName].isSupported) {
+                            return false;
+                        }
                     }
                 }
                 return true;
@@ -42612,6 +42749,9 @@ var BABYLON;
         PostProcessRenderPipeline.prototype.addEffect = function (renderEffect) {
             this._renderEffects[renderEffect._name] = renderEffect;
         };
+        // private
+        PostProcessRenderPipeline.prototype._rebuild = function () {
+        };
         PostProcessRenderPipeline.prototype._enableEffect = function (renderEffectName, cameras) {
             var renderEffects = this._renderEffects[renderEffectName];
             if (!renderEffects) {
@@ -42644,13 +42784,17 @@ var BABYLON;
                 cameras.splice(indicesToDelete[i], 1);
             }
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._attachCameras(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._attachCameras(_cam);
+                }
             }
         };
         PostProcessRenderPipeline.prototype._detachCameras = function (cameras) {
             var _cam = BABYLON.Tools.MakeArray(cameras || this._cameras);
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._detachCameras(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._detachCameras(_cam);
+                }
             }
             for (var i = 0; i < _cam.length; i++) {
                 this._cameras.splice(this._cameras.indexOf(_cam[i]), 1);
@@ -42662,16 +42806,20 @@ var BABYLON;
             var pass = null;
             var renderEffectName;
             for (renderEffectName in this._renderEffects) {
-                pass = this._renderEffects[renderEffectName].getPass(passName);
-                if (pass != null) {
-                    break;
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    pass = this._renderEffects[renderEffectName].getPass(passName);
+                    if (pass != null) {
+                        break;
+                    }
                 }
             }
             if (pass === null) {
                 return;
             }
             for (renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._disable(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._disable(_cam);
+                }
             }
             pass._name = PostProcessRenderPipeline.PASS_SAMPLER_NAME;
             for (var i = 0; i < _cam.length; i++) {
@@ -42693,12 +42841,16 @@ var BABYLON;
                 this._renderEffectsForIsolatedPass[cameraName]._disable(camera);
             }
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._enable(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._enable(_cam);
+                }
             }
         };
         PostProcessRenderPipeline.prototype._update = function () {
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._update();
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._update();
+                }
             }
             for (var i = 0; i < this._cameras.length; i++) {
                 var cameraName = this._cameras[i].name;
@@ -47920,8 +48072,16 @@ var BABYLON;
             var engine = this._scene.getEngine();
             var boxdata = BABYLON.VertexData.CreateBox({ size: 1.0 });
             this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = new BABYLON.VertexBuffer(engine, boxdata.positions, BABYLON.VertexBuffer.PositionKind, false);
+            this._createIndexBuffer();
+        };
+        BoundingBoxRenderer.prototype._createIndexBuffer = function () {
+            var engine = this._scene.getEngine();
             this._indexBuffer = engine.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]);
         };
+        BoundingBoxRenderer.prototype._rebuild = function () {
+            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind]._rebuild();
+            this._createIndexBuffer();
+        };
         BoundingBoxRenderer.prototype.reset = function () {
             this.renderList.reset();
         };

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1731 - 1680
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 263 - 263
dist/preview release/inspector/babylon.inspector.bundle.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 3
dist/preview release/inspector/babylon.inspector.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


+ 39 - 0
src/Cameras/babylon.arcRotateCamera.ts

@@ -343,6 +343,45 @@ module BABYLON {
             return this._target;
         }
 
+       // State
+
+        /**
+         * Store current camera state (fov, position, etc..)
+         */
+        private _storedAlpha: number;
+        private _storedBeta: number;
+        private _storedRadius: number;
+        private _storedTarget: Vector3;     
+
+        public storeState(): Camera {
+            this._storedAlpha = this.alpha;
+            this._storedBeta = this.beta;
+            this._storedRadius = this.radius;
+            this._storedTarget = this._getTargetPosition().clone();
+
+            return super.storeState();
+        }
+
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        public restoreState(): boolean {
+            if (!super.restoreState()) {
+                return false;
+            }
+
+            this.alpha = this._storedAlpha;
+            this.beta = this._storedBeta;
+            this.radius = this._storedRadius;
+            this.setTarget(this._storedTarget);
+
+            this.inertialAlphaOffset = 0;
+            this.inertialBetaOffset = 0;
+            this.inertialRadiusOffset = 0;
+
+            return true;
+        }             
+
         // Synchronized
         public _isSynchronizedViewMatrix(): boolean {
             if (!super._isSynchronizedViewMatrix())

+ 26 - 0
src/Cameras/babylon.camera.ts

@@ -154,6 +154,32 @@
             this.position = position;
         }
 
+        private _storedFov: number;
+        private _stateStored: boolean;
+
+        /**
+         * Store current camera state (fov, position, etc..)
+         */
+        public storeState(): Camera {
+            this._stateStored = true;
+            this._storedFov = this.fov;
+
+            return this;
+        }
+
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        public restoreState(): boolean {
+            if (!this._stateStored) {
+                return false;
+            }
+
+            this.fov = this._storedFov;
+
+            return true;
+        }
+
         public getClassName(): string {
             return "Camera";
         }

+ 1 - 1
src/Cameras/babylon.freeCamera.ts

@@ -89,7 +89,7 @@
             super(name, position, scene);
             this.inputs = new FreeCameraInputsManager(this);
             this.inputs.addKeyboard().addMouse();
-        }
+        }     
 
         // Controls
         public attachControl(element: HTMLElement, noPreventDefault?: boolean): void {

+ 40 - 0
src/Cameras/babylon.targetCamera.ts

@@ -57,6 +57,46 @@ module BABYLON {
             return this.lockedTarget.absolutePosition || this.lockedTarget;
         }
 
+        // State
+
+        /**
+         * Store current camera state (fov, position, etc..)
+         */
+        private _storedPosition: Vector3;
+        private _storedRotation: Vector3;
+        private _storedRotationQuaternion: Quaternion;
+
+        public storeState(): Camera {
+            this._storedPosition = this.position.clone();
+            this._storedRotation = this.rotation.clone();
+            if (this.rotationQuaternion) {
+                this._storedRotationQuaternion = this.rotationQuaternion.clone();
+            }
+
+            return super.storeState();
+        }
+
+        /**
+         * Restored camera state. You must call storeState() first
+         */
+        public restoreState(): boolean {
+            if (!super.restoreState()) {
+                return false;
+            }
+
+            this.position = this._storedPosition.clone();
+            this.rotation = this._storedRotation.clone();
+
+            if (this.rotationQuaternion) {
+                this.rotationQuaternion = this._storedRotationQuaternion.clone();
+            }
+
+            this.cameraDirection.copyFromFloats(0, 0, 0);
+            this.cameraRotation.copyFromFloats(0, 0);
+
+            return true;
+        }           
+
         // Cache
         public _initCache() {
             super._initCache();

+ 23 - 10
src/Layer/babylon.highlightlayer.ts

@@ -285,16 +285,7 @@ module BABYLON {
             var vertexBuffer = new VertexBuffer(engine, vertices, VertexBuffer.PositionKind, false, false, 2);
             this._vertexBuffers[VertexBuffer.PositionKind] = vertexBuffer;
 
-            // Indices
-            var indices = [];
-            indices.push(0);
-            indices.push(1);
-            indices.push(2);
-            indices.push(0);
-            indices.push(2);
-            indices.push(3);
-
-            this._indexBuffer = engine.createIndexBuffer(indices);
+            this._createIndexBuffer();
 
             // Effect
             this._glowMapMergeEffect = engine.createEffect("glowMapMerge",
@@ -308,6 +299,28 @@ module BABYLON {
             // Create Textures and post processes
             this.createTextureAndPostProcesses();
         }
+       
+        private _createIndexBuffer(): void {
+            var engine = this._scene.getEngine();
+
+            // Indices
+            var indices = [];
+            indices.push(0);
+            indices.push(1);
+            indices.push(2);
+
+            indices.push(0);
+            indices.push(2);
+            indices.push(3);
+
+            this._indexBuffer = engine.createIndexBuffer(indices);
+        }
+
+        public _rebuild(): void {
+            this._vertexBuffers[VertexBuffer.PositionKind]._rebuild();
+
+            this._createIndexBuffer();
+        }        
 
         /**
          * Creates the render target textures and post processes used in the highlight layer.

+ 18 - 12
src/Layer/babylon.layer.ts

@@ -70,7 +70,17 @@
 
             var engine = this._scene.getEngine();
 
-            this._rebuild();
+            // VBO
+            var vertices = [];
+            vertices.push(1, 1);
+            vertices.push(-1, 1);
+            vertices.push(-1, -1);
+            vertices.push(1, -1);
+
+            var vertexBuffer = new VertexBuffer(engine, vertices, VertexBuffer.PositionKind, false, false, 2);
+            this._vertexBuffers[VertexBuffer.PositionKind] = vertexBuffer;
+
+            this._createIndexBuffer();
 
             // Effects
             this._effect = engine.createEffect("layer",
@@ -84,19 +94,9 @@
                 ["textureSampler"], "#define ALPHATEST");
         }
 
-        public _rebuild(): void {
+        private _createIndexBuffer(): void {
             var engine = this._scene.getEngine();
 
-            // VBO
-            var vertices = [];
-            vertices.push(1, 1);
-            vertices.push(-1, 1);
-            vertices.push(-1, -1);
-            vertices.push(1, -1);
-
-            var vertexBuffer = new VertexBuffer(engine, vertices, VertexBuffer.PositionKind, false, false, 2);
-            this._vertexBuffers[VertexBuffer.PositionKind] = vertexBuffer;
-
             // Indices
             var indices = [];
             indices.push(0);
@@ -110,6 +110,12 @@
             this._indexBuffer = engine.createIndexBuffer(indices);
         }
 
+        public _rebuild(): void {
+            this._vertexBuffers[VertexBuffer.PositionKind]._rebuild();
+
+            this._createIndexBuffer();
+        }
+
         public render(): void {
             var currentEffect = this.alphaTest ? this._alphaTestEffect : this._effect;
 

+ 9 - 1
src/Materials/Textures/babylon.internalTexture.ts

@@ -31,6 +31,7 @@ module BABYLON {
         public _dataSource = InternalTexture.DATASOURCE_UNKNOWN;
         public _buffer: ArrayBuffer | HTMLImageElement;
         public _bufferView: ArrayBufferView;
+        public _bufferViewArray: ArrayBufferView[];
         public _size: number;
         public _extension: string;
         public _files: string[];
@@ -140,7 +141,7 @@ module BABYLON {
                     proxy._swapAndDie(this);
 
                     this.isReady = true;
-                return;                
+                return;                                      
 
                 case InternalTexture.DATASOURCE_CUBE:
                     proxy = this._engine.createCubeTexture(this.url, null, this._files, !this.generateMipMaps, () => {
@@ -149,6 +150,13 @@ module BABYLON {
                     proxy._swapAndDie(this);
                     return;
 
+                case InternalTexture.DATASOURCE_CUBERAW:
+                    proxy = this._engine.createRawCubeTexture(this._bufferViewArray, this.width, this.format, this.type, this.generateMipMaps, this.invertY, this.samplingMode, this._compression);
+                    proxy._swapAndDie(this);
+
+                    this.isReady = true;
+                    return;                    
+
                 case InternalTexture.DATASOURCE_CUBEPREFILTERED:
                     proxy = this._engine.createPrefilteredCubeTexture(this.url, null, this._lodGenerationScale, this._lodGenerationOffset, (proxy) => {
                         proxy._swapAndDie(this);

+ 19 - 3
src/Materials/Textures/babylon.multiRenderTarget.ts

@@ -73,14 +73,30 @@ module BABYLON {
                 generateDepthTexture: generateDepthTexture,
                 types: types,
                 textureCount: count
-            };
-
-            this._internalTextures = scene.getEngine().createMultipleRenderTarget(size, this._multiRenderTargetOptions);
+            };            
+            
+            this._createInternalTextures();
+            this._createTextures();
+        }
 
+        public _rebuild(): void {
+            this.releaseInternalTextures();
             this._createInternalTextures();
+
+            for (var i = 0; i < this._internalTextures.length; i++) {
+                var texture = this._textures[i];
+                texture._texture = this._internalTextures[i];
+            }
+
+            // Keeps references to frame buffer and stencil/depth buffer
+            this._texture = this._internalTextures[0];
         }
 
         private _createInternalTextures(): void {
+            this._internalTextures = this.getScene().getEngine().createMultipleRenderTarget(this._size , this._multiRenderTargetOptions);
+        }
+
+        private _createTextures(): void {
             this._textures = [];
             for (var i = 0; i < this._internalTextures.length; i++) {
                 var texture = new BABYLON.Texture(null, this.getScene());

+ 4 - 0
src/Materials/Textures/babylon.renderTargetTexture.ts

@@ -567,6 +567,10 @@
             if (this.refreshRate === RenderTargetTexture.REFRESHRATE_RENDER_ONCE) {
                 this.refreshRate = RenderTargetTexture.REFRESHRATE_RENDER_ONCE;
             }
+
+            if (this._postProcessManager) {
+                this._postProcessManager._rebuild();
+            }
         }
     }
 }

+ 4 - 0
src/Particles/babylon.gpuParticleSystem.ts

@@ -34,6 +34,10 @@
 
         }
 
+        public rebuild(): void {
+            
+        }
+
         public dispose(): void {
             var index = this._scene.particleSystems.indexOf(this);
             if (index > -1) {

+ 25 - 13
src/Particles/babylon.particleSystem.ts

@@ -21,6 +21,8 @@
         dispose(): void; 
         clone(name: string, newEmitter: any): IParticleSystem;
         serialize(): any;
+
+        rebuild(): void
     }
 
     export class ParticleSystem implements IDisposable, IAnimatable, IParticleSystem {
@@ -127,19 +129,7 @@
 
             scene.particleSystems.push(this);
 
-            var indices = [];
-            var index = 0;
-            for (var count = 0; count < capacity; count++) {
-                indices.push(index);
-                indices.push(index + 1);
-                indices.push(index + 2);
-                indices.push(index);
-                indices.push(index + 2);
-                indices.push(index + 3);
-                index += 4;
-            }
-
-            this._indexBuffer = scene.getEngine().createIndexBuffer(indices);
+            this._createIndexBuffer();
 
             // 11 floats per particle (x, y, z, r, g, b, a, angle, size, offsetX, offsetY) + 1 filler
             this._vertexData = new Float32Array(capacity * 11 * 4);
@@ -199,6 +189,22 @@
             }
         }
 
+        private _createIndexBuffer() {
+            var indices = [];
+            var index = 0;
+            for (var count = 0; count < this._capacity ; count++) {
+                indices.push(index);
+                indices.push(index + 1);
+                indices.push(index + 2);
+                indices.push(index);
+                indices.push(index + 2);
+                indices.push(index + 3);
+                index += 4;
+            }
+
+            this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
+        }
+
         public recycleParticle(particle: Particle): void {
             var lastParticle = this.particles.pop();
 
@@ -396,6 +402,12 @@
             this._vertexBuffer.update(this._vertexData);
         }
 
+        public rebuild(): void {
+            this._createIndexBuffer();
+
+            this._vertexBuffer._rebuild();
+        }
+
         public render(): number {
             var effect = this._getEffect();
 

+ 6 - 0
src/PostProcess/RenderPipeline/Pipelines/babylon.ssao2RenderingPipeline.ts

@@ -250,6 +250,12 @@
                 }
             };
         }
+        
+        public _rebuild() {
+            this._firstUpdate = true;
+
+            super._rebuild();
+        }
 
         private _generateHemisphere(): number[] {
             var numSamples = this.samples;

+ 5 - 0
src/PostProcess/RenderPipeline/Pipelines/babylon.ssaoRenderingPipeline.ts

@@ -189,6 +189,11 @@
             };
         }
 
+        public _rebuild() {
+            this._firstUpdate = true;
+            super._rebuild();            
+        }
+
         private _createSSAOPostProcess(ratio: number): void {
             var numSamples = 16;
             var sampleSphere = [

+ 28 - 10
src/PostProcess/RenderPipeline/babylon.postProcessRenderPipeline.ts

@@ -30,8 +30,10 @@ module BABYLON {
 
         public get isSupported(): boolean {
             for (var renderEffectName in this._renderEffects) {
-                if (!this._renderEffects[renderEffectName].isSupported) {
-                    return false;
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    if (!this._renderEffects[renderEffectName].isSupported) {
+                        return false;
+                    }
                 }
             }
 
@@ -44,6 +46,10 @@ module BABYLON {
 
         // private
 
+        public _rebuild() {
+            
+        }
+
         public _enableEffect(renderEffectName: string, cameras: Camera);
         public _enableEffect(renderEffectName: string, cameras: Camera[]);
         public _enableEffect(renderEffectName: string, cameras: any): void {
@@ -92,7 +98,9 @@ module BABYLON {
             }
 
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._attachCameras(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._attachCameras(_cam);
+                }
             }
         }
 
@@ -102,7 +110,9 @@ module BABYLON {
             var _cam = Tools.MakeArray(cameras || this._cameras);
 
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._detachCameras(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._detachCameras(_cam);
+                }
             }
 
             for (var i = 0; i < _cam.length; i++) {
@@ -118,10 +128,12 @@ module BABYLON {
             var pass = null;
             var renderEffectName;
             for (renderEffectName in this._renderEffects) {
-                pass = this._renderEffects[renderEffectName].getPass(passName);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    pass = this._renderEffects[renderEffectName].getPass(passName);
 
-                if (pass != null) {
-                    break;
+                    if (pass != null) {
+                        break;
+                    }
                 }
             }
 
@@ -130,7 +142,9 @@ module BABYLON {
             }
 
             for (renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._disable(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._disable(_cam);
+                }
             }
 
             pass._name = PostProcessRenderPipeline.PASS_SAMPLER_NAME;
@@ -162,13 +176,17 @@ module BABYLON {
             }
 
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._enable(_cam);
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._enable(_cam);
+                }
             }
         }
 
         public _update(): void {
             for (var renderEffectName in this._renderEffects) {
-                this._renderEffects[renderEffectName]._update();
+                if (this._renderEffects.hasOwnProperty(renderEffectName)) {
+                    this._renderEffects[renderEffectName]._update();
+                }
             }
 
             for (var i = 0; i < this._cameras.length; i++) {

+ 25 - 5
src/PostProcess/RenderPipeline/babylon.postProcessRenderPipelineManager.ts

@@ -84,12 +84,32 @@ module BABYLON {
 
         public update(): void {
             for (var renderPipelineName in this._renderPipelines) {
-                var pipeline = this._renderPipelines[renderPipelineName];
-                if (!pipeline.isSupported) {
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
+                    if (!pipeline.isSupported) {
+                        pipeline.dispose();
+                        delete this._renderPipelines[renderPipelineName];
+                    } else {
+                        pipeline._update();
+                    }
+                }
+            }
+        }
+
+        public _rebuild(): void {
+            for (var renderPipelineName in this._renderPipelines) {
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
+                    pipeline._rebuild();
+                }
+            }
+        }
+
+        public dispose(): void {
+            for (var renderPipelineName in this._renderPipelines) {
+                if (this._renderPipelines.hasOwnProperty(renderPipelineName)) {
+                    var pipeline = this._renderPipelines[renderPipelineName];
                     pipeline.dispose();
-                    delete this._renderPipelines[renderPipelineName];
-                } else {
-                    pipeline._update();
                 }
             }
         }

+ 0 - 4
src/PostProcess/babylon.postProcess.ts

@@ -369,10 +369,6 @@
             this._textures.dispose();
         }
 
-        public _rebuild(): void {
-            
-        }
-
         public dispose(camera?: Camera): void {
             camera = camera || this._camera;            
 

+ 13 - 1
src/PostProcess/babylon.postProcessManager.ts

@@ -22,6 +22,10 @@
 
             this._vertexBuffers[VertexBuffer.PositionKind] = new VertexBuffer(this._scene.getEngine(), vertices, VertexBuffer.PositionKind, false, false, 2);
 
+            this._buildIndexBuffer();
+        }
+
+        private _buildIndexBuffer(): void {
             // Indices
             var indices = [];
             indices.push(0);
@@ -34,7 +38,15 @@
 
             this._indexBuffer = this._scene.getEngine().createIndexBuffer(indices);
         }
-
+        
+        public _rebuild(): void {
+            if (!this._vertexBuffers[VertexBuffer.PositionKind]) {
+                return;
+            }
+            this._vertexBuffers[VertexBuffer.PositionKind]._rebuild();
+            this._buildIndexBuffer();
+        }
+        
         // Methods
         public _prepareFrame(sourceTexture?: InternalTexture, postProcesses?: PostProcess[]): boolean {
             var postProcesses = postProcesses || this._scene.activeCamera._postProcesses;

+ 10 - 0
src/Rendering/babylon.boundingBoxRenderer.ts

@@ -29,9 +29,19 @@
             var engine = this._scene.getEngine();
             var boxdata = VertexData.CreateBox({ size: 1.0 });
             this._vertexBuffers[VertexBuffer.PositionKind] = new VertexBuffer(engine, boxdata.positions, VertexBuffer.PositionKind, false);
+            this._createIndexBuffer();
+        }
+
+        private _createIndexBuffer(): void {
+            var engine = this._scene.getEngine();
             this._indexBuffer = engine.createIndexBuffer([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 7, 1, 6, 2, 5, 3, 4]);
         }
 
+        public _rebuild(): void {
+            this._vertexBuffers[VertexBuffer.PositionKind]._rebuild();
+            this._createIndexBuffer();
+        }
+
         public reset(): void {
             this.renderList.reset();
         }

+ 25 - 22
src/babylon.engine.ts

@@ -957,10 +957,6 @@
                 scene._rebuildTextures();
             }
 
-            for (var postprocess of this.postProcesses) {
-                postprocess._rebuild();
-            }
-
             // Uniforms
             for (var uniformBuffer of this._uniformBuffers) {
                 uniformBuffer._rebuild();
@@ -1300,27 +1296,25 @@
         }
 
         public _renderLoop(): void {
-            if (this._contextWasLost) {
-                return;
-            }
-
-            var shouldRender = true;
-            if (!this.renderEvenInBackground && this._windowIsBackground) {
-                shouldRender = false;
-            }
+            if (!this._contextWasLost) {
+                var shouldRender = true;
+                if (!this.renderEvenInBackground && this._windowIsBackground) {
+                    shouldRender = false;
+                }
 
-            if (shouldRender) {
-                // Start new frame
-                this.beginFrame();
+                if (shouldRender) {
+                    // Start new frame
+                    this.beginFrame();
 
-                for (var index = 0; index < this._activeRenderLoops.length; index++) {
-                    var renderFunction = this._activeRenderLoops[index];
+                    for (var index = 0; index < this._activeRenderLoops.length; index++) {
+                        var renderFunction = this._activeRenderLoops[index];
 
-                    renderFunction();
-                }
+                        renderFunction();
+                    }
 
-                // Present
-                this.endFrame();
+                    // Present
+                    this.endFrame();
+                }  
             }
 
             if (this._activeRenderLoops.length > 0) {
@@ -3656,6 +3650,12 @@
         }
 
         public updateRawCubeTexture(texture: InternalTexture, data: ArrayBufferView[], format: number, type: number, invertY: boolean, compression: string = null, level = 0): void {
+            texture._bufferViewArray = data;
+            texture.format = format;
+            texture.type = type;
+            texture.invertY = invertY;
+            texture._compression = compression;
+
             var gl = this._gl;
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
@@ -3705,6 +3705,9 @@
             texture.generateMipMaps = generateMipMaps;
             texture.format = format;
             texture.type = type;
+            if (!this._doNotHandleContextLost) {
+                texture._bufferViewArray = data;
+            }
 
             var textureType = this._getWebGLTextureType(type);
             var internalFormat = this._getInternalFormat(format);
@@ -3728,7 +3731,7 @@
                 generateMipMaps = false;
             }
 
-            // Upload data if needed. The texture won t be ready until then.
+            // Upload data if needed. The texture won't be ready until then.
             if (data) {
                 this.updateRawCubeTexture(texture, data, format, type, invertY, compression);
             }

+ 23 - 3
src/babylon.scene.ts

@@ -3474,6 +3474,10 @@
             // Post-processes
             this.postProcessManager.dispose();
 
+            if (this._postProcessRenderPipelineManager) {
+                this._postProcessRenderPipelineManager.dispose();
+            }
+
             // Physics
             if (this._physicsEngine) {
                 this.disablePhysicsEngine();
@@ -3846,13 +3850,29 @@
                 mesh._rebuild();
             }
 
-            for (var postprocess of this.postProcesses) {
-                postprocess._rebuild();
-            }            
+            if (this.postProcessManager) {
+                this.postProcessManager._rebuild();
+            }         
 
             for (var layer of this.layers) {
                 layer._rebuild();
             }
+
+            for (var highlightLayer of this.highlightLayers) {
+                highlightLayer._rebuild();
+            }
+
+            if (this._boundingBoxRenderer) {
+                this._boundingBoxRenderer._rebuild();
+            }
+
+            for (var system of this.particleSystems) {
+                system.rebuild();
+            }
+
+            if (this._postProcessRenderPipelineManager) {
+                this._postProcessRenderPipelineManager._rebuild();
+            }            
         }
 
         public _rebuildTextures(): void {

BIN
tests/validation/ReferenceImages/DefaultRenderingPipeline.png


+ 7 - 1
tests/validation/config.json

@@ -214,7 +214,13 @@
       "renderCount": 10,
       "playgroundId": "#12MKMN#0",
       "referenceImage": "MultiSample render targets.png"
-    },            
+    },      
+    {
+      "title": "Default rendering pipeline",
+      "renderCount": 20,
+      "playgroundId": "#5XB8YT#2",
+      "referenceImage": "DefaultRenderingPipeline.png"
+    },             
     {
       "title": "Water material (only visual check)",
       "renderCount": 10,

+ 2 - 0
tests/validation/validation.js

@@ -189,6 +189,8 @@ runTest(index) {
                     var code = JSON.parse(snippet.jsonPayload).code.toString();
                     code = code.replace(/\/textures\//g, pgRoot + "/textures/");
                     code = code.replace(/"textures\//g, "\"" + pgRoot + "/textures/");
+                    code = code.replace(/\/scenes\//g, pgRoot + "/scenes/");
+                    code = code.replace(/"scenes\//g, "\"" + pgRoot + "/scenes/");
 
                     currentScene = eval(code + "\r\ncreateScene(engine)");
                     processCurrentScene(test, resultCanvas, result, renderImage, index, waitRing);