David Catuhe 7 years ago
parent
commit
655304e44d

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


File diff suppressed because it is too large
+ 11952 - 11947
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 10 - 10
dist/preview release/babylon.js


File diff suppressed because it is too large
+ 80904 - 80334
dist/preview release/babylon.max.js


File diff suppressed because it is too large
+ 10 - 10
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 9 - 9
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


File diff suppressed because it is too large
+ 80574 - 80004
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js


File diff suppressed because it is too large
+ 2 - 2
dist/preview release/inspector/babylon.inspector.bundle.js


+ 6 - 0
dist/preview release/inspector/babylon.inspector.js

@@ -3567,6 +3567,12 @@ var INSPECTOR;
                     elem: elemValue,
                     updateFct: function () { return _this._sceneInstrumentation.drawCallsCounter.current.toString(); }
                 });
+                _this._createStatLabel("Texture collisions", _this._panel);
+                elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
+                _this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: function () { return _this._sceneInstrumentation.textureCollisionsCounter.current.toString(); }
+                });
                 _this._createStatLabel("Total lights", _this._panel);
                 elemValue = INSPECTOR.Helpers.CreateDiv('stat-value', _this._panel);
                 _this._updatableProperties.push({

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


File diff suppressed because it is too large
+ 11 - 11
dist/preview release/viewer/babylon.viewer.js


+ 7 - 0
inspector/src/tabs/StatsTab.ts

@@ -86,6 +86,13 @@ module INSPECTOR {
                     updateFct: () => { return this._sceneInstrumentation!.drawCallsCounter.current.toString() }
                 });
 
+                this._createStatLabel("Texture collisions", this._panel);
+                elemValue = Helpers.CreateDiv('stat-value', this._panel);
+                this._updatableProperties.push({
+                    elem: elemValue,
+                    updateFct: () => { return this._sceneInstrumentation!.textureCollisionsCounter.current.toString() }
+                });
+
                 this._createStatLabel("Total lights", this._panel);
                 elemValue = Helpers.CreateDiv('stat-value', this._panel);
                 this._updatableProperties.push({

+ 13 - 10
src/Engine/babylon.engine.ts

@@ -708,6 +708,7 @@
         private _loadingScreen: ILoadingScreen;
 
         public _drawCalls = new PerfCounter();
+        public _textureCollisions = new PerfCounter();
 
         private _glVersion: string;
         private _glRenderer: string;
@@ -753,7 +754,7 @@
         private _internalTexturesCache = new Array<InternalTexture>();
         protected _activeChannel: number;
         protected _boundTexturesCache: { [key: string]: Nullable<InternalTexture> } = {};
-        protected _boundTexturesOrder = new Array<InternalTexture>();
+        protected _boundTexturesStack = new Array<InternalTexture>();
         protected _currentEffect: Nullable<Effect>;
         protected _currentProgram: Nullable<WebGLProgram>;
         private _compiledEffects: { [key: string]: Effect } = {}
@@ -2963,12 +2964,12 @@
             if (this.preventCacheWipeBetweenFrames && !bruteForce) {
                 return;
             }
-            this.resetTextureCache();
             this._currentEffect = null;
 
             // 6/8/2017: deltakosh: Should not be required anymore.
             // This message is then mostly for the future myself which will scream out loud when seeing that actually it was required :)
             if (bruteForce) {
+                this.resetTextureCache();
                 this._currentProgram = null;
 
                 this._stencilState.reset();
@@ -4602,21 +4603,22 @@
         }
 
         private _moveBoundTextureOnTop(internalTexture: InternalTexture): void {
-            let index = this._boundTexturesOrder.indexOf(internalTexture);
+            let index = this._boundTexturesStack.indexOf(internalTexture);
 
-            if (index > -1 && index !== this._boundTexturesOrder.length - 1) {
-                this._boundTexturesOrder.splice(index, 1);
-                this._boundTexturesOrder.push(internalTexture);
+            if (index > -1 && index !== this._boundTexturesStack.length - 1) {
+                this._boundTexturesStack.splice(index, 1);
+                this._boundTexturesStack.push(internalTexture);
             }
         }
 
         private _removeDesignatedSlot(internalTexture: InternalTexture): number {
             let currentSlot = internalTexture._designatedSlot;
             internalTexture._designatedSlot = -1;
-            let index = this._boundTexturesOrder.indexOf(internalTexture);
+            let index = this._boundTexturesStack.indexOf(internalTexture);
 
             if (index > -1) {
-                this._boundTexturesOrder.splice(index, 1);
+                this._boundTexturesStack.splice(index, 1);
+                this._boundTexturesCache[currentSlot] = null;
             }
 
             return currentSlot;
@@ -4637,7 +4639,7 @@
                     this._boundTexturesCache[this._activeChannel] = texture;
 
                     if (isTextureForRendering) {
-                        this._boundTexturesOrder.push(texture!);
+                        this._boundTexturesStack.push(texture!);
                     }
                 }
             }
@@ -4708,7 +4710,8 @@
                             this._nextFreeTextureSlot = -1; // No more free slots, we will recycle
                         }
                     } else { // We need to recycle the oldest bound texture, sorry.
-                        channel = this._removeDesignatedSlot(this._boundTexturesOrder[0]);
+                        channel = this._removeDesignatedSlot(this._boundTexturesStack[0]);
+                        this._textureCollisions.addCount(1, false);
                     }
                 }
             }

+ 109 - 101
src/Instrumentation/babylon.sceneInstrumentation.ts

@@ -4,31 +4,31 @@ module BABYLON {
      */
     export class SceneInstrumentation implements IDisposable {
         private _captureActiveMeshesEvaluationTime = false;
-        private _activeMeshesEvaluationTime = new PerfCounter();  
+        private _activeMeshesEvaluationTime = new PerfCounter();
 
         private _captureRenderTargetsRenderTime = false;
-        private _renderTargetsRenderTime = new PerfCounter();    
-        
+        private _renderTargetsRenderTime = new PerfCounter();
+
         private _captureFrameTime = false;
-        private _frameTime = new PerfCounter();        
+        private _frameTime = new PerfCounter();
 
         private _captureRenderTime = false;
-        private _renderTime = new PerfCounter();           
+        private _renderTime = new PerfCounter();
 
         private _captureInterFrameTime = false;
-        private _interFrameTime = new PerfCounter();    
-        
+        private _interFrameTime = new PerfCounter();
+
         private _captureParticlesRenderTime = false;
-        private _particlesRenderTime = new PerfCounter();       
-          
+        private _particlesRenderTime = new PerfCounter();
+
         private _captureSpritesRenderTime = false;
-        private _spritesRenderTime = new PerfCounter();   
+        private _spritesRenderTime = new PerfCounter();
 
         private _capturePhysicsTime = false;
-        private _physicsTime = new PerfCounter();     
-        
+        private _physicsTime = new PerfCounter();
+
         private _captureAnimationsTime = false;
-        private _animationsTime = new PerfCounter();            
+        private _animationsTime = new PerfCounter();
 
         // Observers
         private _onBeforeActiveMeshesEvaluationObserver: Nullable<Observer<Scene>> = null;
@@ -39,21 +39,21 @@ module BABYLON {
         private _onAfterRenderObserver: Nullable<Observer<Scene>> = null;
 
         private _onBeforeDrawPhaseObserver: Nullable<Observer<Scene>> = null;
-        private _onAfterDrawPhaseObserver: Nullable<Observer<Scene>> = null;        
-        
+        private _onAfterDrawPhaseObserver: Nullable<Observer<Scene>> = null;
+
         private _onBeforeAnimationsObserver: Nullable<Observer<Scene>> = null;
 
         private _onBeforeParticlesRenderingObserver: Nullable<Observer<Scene>> = null;
         private _onAfterParticlesRenderingObserver: Nullable<Observer<Scene>> = null;
 
         private _onBeforeSpritesRenderingObserver: Nullable<Observer<Scene>> = null;
-        private _onAfterSpritesRenderingObserver: Nullable<Observer<Scene>> = null;      
-        
+        private _onAfterSpritesRenderingObserver: Nullable<Observer<Scene>> = null;
+
         private _onBeforePhysicsObserver: Nullable<Observer<Scene>> = null;
-        private _onAfterPhysicsObserver: Nullable<Observer<Scene>> = null;     
-        
-        private _onAfterAnimationsObserver: Nullable<Observer<Scene>> = null;    
-                
+        private _onAfterPhysicsObserver: Nullable<Observer<Scene>> = null;
+
+        private _onAfterAnimationsObserver: Nullable<Observer<Scene>> = null;
+
         // Properties
         /**
          * Gets the perf counter used for active meshes evaluation time
@@ -64,28 +64,28 @@ module BABYLON {
 
         /**
          * Gets the active meshes evaluation time capture status
-         */        
+         */
         public get captureActiveMeshesEvaluationTime(): boolean {
             return this._captureActiveMeshesEvaluationTime;
-        }        
+        }
 
         /**
          * Enable or disable the active meshes evaluation time capture
-         */        
+         */
         public set captureActiveMeshesEvaluationTime(value: boolean) {
             if (value === this._captureActiveMeshesEvaluationTime) {
                 return;
             }
 
-            this._captureActiveMeshesEvaluationTime = value;            
+            this._captureActiveMeshesEvaluationTime = value;
 
             if (value) {
-                this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(()=>{
+                this._onBeforeActiveMeshesEvaluationObserver = this.scene.onBeforeActiveMeshesEvaluationObservable.add(() => {
                     Tools.StartPerformanceCounter("Active meshes evaluation");
                     this._activeMeshesEvaluationTime.beginMonitoring();
                 });
 
-                this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(()=>{                    
+                this._onAfterActiveMeshesEvaluationObserver = this.scene.onAfterActiveMeshesEvaluationObservable.add(() => {
                     Tools.EndPerformanceCounter("Active meshes evaluation");
                     this._activeMeshesEvaluationTime.endMonitoring();
                 });
@@ -110,11 +110,11 @@ module BABYLON {
          */
         public get captureRenderTargetsRenderTime(): boolean {
             return this._captureRenderTargetsRenderTime;
-        }        
+        }
 
         /**
          * Enable or disable the render targets render time capture
-         */        
+         */
         public set captureRenderTargetsRenderTime(value: boolean) {
             if (value === this._captureRenderTargetsRenderTime) {
                 return;
@@ -123,12 +123,12 @@ module BABYLON {
             this._captureRenderTargetsRenderTime = value;
 
             if (value) {
-                this._onBeforeRenderTargetsRenderObserver = this.scene.OnBeforeRenderTargetsRenderObservable.add(()=>{
+                this._onBeforeRenderTargetsRenderObserver = this.scene.OnBeforeRenderTargetsRenderObservable.add(() => {
                     Tools.StartPerformanceCounter("Render targets rendering");
                     this._renderTargetsRenderTime.beginMonitoring();
                 });
 
-                this._onAfterRenderTargetsRenderObserver = this.scene.OnAfterRenderTargetsRenderObservable.add(()=>{                    
+                this._onAfterRenderTargetsRenderObserver = this.scene.OnAfterRenderTargetsRenderObservable.add(() => {
                     Tools.EndPerformanceCounter("Render targets rendering");
                     this._renderTargetsRenderTime.endMonitoring(false);
                 });
@@ -139,7 +139,7 @@ module BABYLON {
                 this.scene.OnAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver);
                 this._onAfterRenderTargetsRenderObserver = null;
             }
-        }        
+        }
 
         /**
          * Gets the perf counter used for particles render time
@@ -153,11 +153,11 @@ module BABYLON {
          */
         public get captureParticlesRenderTime(): boolean {
             return this._captureParticlesRenderTime;
-        }        
+        }
 
         /**
          * Enable or disable the particles render time capture
-         */        
+         */
         public set captureParticlesRenderTime(value: boolean) {
             if (value === this._captureParticlesRenderTime) {
                 return;
@@ -166,12 +166,12 @@ module BABYLON {
             this._captureParticlesRenderTime = value;
 
             if (value) {
-                this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(()=>{                    
+                this._onBeforeParticlesRenderingObserver = this.scene.onBeforeParticlesRenderingObservable.add(() => {
                     Tools.StartPerformanceCounter("Particles");
                     this._particlesRenderTime.beginMonitoring();
                 });
 
-                this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(()=>{                                        
+                this._onAfterParticlesRenderingObserver = this.scene.onAfterParticlesRenderingObservable.add(() => {
                     Tools.EndPerformanceCounter("Particles");
                     this._particlesRenderTime.endMonitoring(false);
                 });
@@ -182,7 +182,7 @@ module BABYLON {
                 this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver);
                 this._onAfterParticlesRenderingObserver = null;
             }
-        }        
+        }
 
         /**
          * Gets the perf counter used for sprites render time
@@ -196,11 +196,11 @@ module BABYLON {
          */
         public get captureSpritesRenderTime(): boolean {
             return this._captureSpritesRenderTime;
-        }        
+        }
 
         /**
          * Enable or disable the sprites render time capture
-         */        
+         */
         public set captureSpritesRenderTime(value: boolean) {
             if (value === this._captureSpritesRenderTime) {
                 return;
@@ -209,12 +209,12 @@ module BABYLON {
             this._captureSpritesRenderTime = value;
 
             if (value) {
-                this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(()=>{                    
+                this._onBeforeSpritesRenderingObserver = this.scene.onBeforeSpritesRenderingObservable.add(() => {
                     Tools.StartPerformanceCounter("Sprites");
                     this._spritesRenderTime.beginMonitoring();
                 });
 
-                this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(()=>{                                        
+                this._onAfterSpritesRenderingObserver = this.scene.onAfterSpritesRenderingObservable.add(() => {
                     Tools.EndPerformanceCounter("Sprites");
                     this._spritesRenderTime.endMonitoring(false);
                 });
@@ -225,7 +225,7 @@ module BABYLON {
                 this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver);
                 this._onAfterSpritesRenderingObserver = null;
             }
-        }      
+        }
 
         /**
          * Gets the perf counter used for physics time
@@ -239,11 +239,11 @@ module BABYLON {
          */
         public get capturePhysicsTime(): boolean {
             return this._capturePhysicsTime;
-        }        
+        }
 
         /**
          * Enable or disable the physics time capture
-         */        
+         */
         public set capturePhysicsTime(value: boolean) {
             if (value === this._capturePhysicsTime) {
                 return;
@@ -252,12 +252,12 @@ module BABYLON {
             this._capturePhysicsTime = value;
 
             if (value) {
-                this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(()=>{                    
+                this._onBeforePhysicsObserver = this.scene.onBeforePhysicsObservable.add(() => {
                     Tools.StartPerformanceCounter("Physics");
                     this._physicsTime.beginMonitoring();
                 });
 
-                this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(()=>{                                        
+                this._onAfterPhysicsObserver = this.scene.onAfterPhysicsObservable.add(() => {
                     Tools.EndPerformanceCounter("Physics");
                     this._physicsTime.endMonitoring();
                 });
@@ -268,7 +268,7 @@ module BABYLON {
                 this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver);
                 this._onAfterPhysicsObserver = null;
             }
-        }      
+        }
 
 
         /**
@@ -283,11 +283,11 @@ module BABYLON {
          */
         public get captureAnimationsTime(): boolean {
             return this._captureAnimationsTime;
-        }        
+        }
 
         /**
          * Enable or disable the animations time capture
-         */        
+         */
         public set captureAnimationsTime(value: boolean) {
             if (value === this._captureAnimationsTime) {
                 return;
@@ -296,74 +296,74 @@ module BABYLON {
             this._captureAnimationsTime = value;
 
             if (value) {
-                this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(()=>{                    
+                this._onAfterAnimationsObserver = this.scene.onAfterAnimationsObservable.add(() => {
                     this._animationsTime.endMonitoring();
                 });
             } else {
                 this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver);
                 this._onAfterAnimationsObserver = null;
             }
-        }              
-        
+        }
+
         /**
          * Gets the perf counter used for frame time capture
          */
         public get frameTimeCounter(): PerfCounter {
             return this._frameTime;
-        }               
-       
+        }
+
         /**
          * Gets the frame time capture status
-         */        
+         */
         public get captureFrameTime(): boolean {
             return this._captureFrameTime;
-        }        
+        }
 
         /**
          * Enable or disable the frame time capture
-         */        
+         */
         public set captureFrameTime(value: boolean) {
             this._captureFrameTime = value;
-        }       
-     
+        }
+
         /**
          * Gets the perf counter used for inter-frames time capture
          */
         public get interFrameTimeCounter(): PerfCounter {
             return this._interFrameTime;
-        }               
-       
+        }
+
         /**
          * Gets the inter-frames time capture status
-         */        
+         */
         public get captureInterFrameTime(): boolean {
             return this._captureInterFrameTime;
-        }        
+        }
 
         /**
          * Enable or disable the inter-frames time capture
-         */        
+         */
         public set captureInterFrameTime(value: boolean) {
             this._captureInterFrameTime = value;
-        }     
+        }
 
         /**
          * Gets the perf counter used for render time capture
          */
         public get renderTimeCounter(): PerfCounter {
             return this._renderTime;
-        }               
-       
+        }
+
         /**
          * Gets the render time capture status
-         */        
+         */
         public get captureRenderTime(): boolean {
             return this._captureRenderTime;
-        }        
+        }
 
         /**
          * Enable or disable the render time capture
-         */        
+         */
         public set captureRenderTime(value: boolean) {
             if (value === this._captureRenderTime) {
                 return;
@@ -372,30 +372,37 @@ module BABYLON {
             this._captureRenderTime = value;
 
             if (value) {
-                this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(()=>{
-                    this._renderTime.beginMonitoring(); 
+                this._onBeforeDrawPhaseObserver = this.scene.onBeforeDrawPhaseObservable.add(() => {
+                    this._renderTime.beginMonitoring();
                     Tools.StartPerformanceCounter("Main render");
                 });
 
-                this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(()=>{
-                    this._renderTime.endMonitoring(false); 
+                this._onAfterDrawPhaseObserver = this.scene.onAfterDrawPhaseObservable.add(() => {
+                    this._renderTime.endMonitoring(false);
                     Tools.EndPerformanceCounter("Main render");
-                });                
+                });
             } else {
                 this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver);
                 this._onBeforeDrawPhaseObserver = null;
                 this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver);
                 this._onAfterDrawPhaseObserver = null;
             }
-        }            
+        }
 
         /**
-         * Gets the perf counter used for frame time capture
+         * Gets the perf counter used for draw calls
          */
         public get drawCallsCounter(): PerfCounter {
             return this.scene.getEngine()._drawCalls;
-        }            
-    
+        }
+
+        /**
+         * Gets the perf counter used for texture collisions 
+         */
+        public get textureCollisionsCounter(): PerfCounter {
+            return this.scene.getEngine()._textureCollisions;
+        }
+
         public constructor(public scene: Scene) {
             // Before render
             this._onBeforeAnimationsObserver = scene.onBeforeAnimationsObservable.add(() => {
@@ -410,11 +417,11 @@ module BABYLON {
                 if (this._captureFrameTime) {
                     Tools.StartPerformanceCounter("Scene rendering");
                     this._frameTime.beginMonitoring();
-                }   
+                }
 
                 if (this._captureInterFrameTime) {
-                    this._interFrameTime.endMonitoring(); 
-                }                   
+                    this._interFrameTime.endMonitoring();
+                }
 
                 if (this._captureParticlesRenderTime) {
                     this._particlesRenderTime.fetchNewFrame();
@@ -429,22 +436,23 @@ module BABYLON {
                 }
 
                 this.scene.getEngine()._drawCalls.fetchNewFrame();
+                this.scene.getEngine()._textureCollisions.fetchNewFrame();
             });
 
             // After render
             this._onAfterRenderObserver = scene.onAfterRenderObservable.add(() => {
                 if (this._captureFrameTime) {
                     Tools.EndPerformanceCounter("Scene rendering");
-                    this._frameTime.endMonitoring();                    
+                    this._frameTime.endMonitoring();
                 }
 
                 if (this._captureRenderTime) {
-                    this._renderTime.endMonitoring(false);                    
-                }                
+                    this._renderTime.endMonitoring(false);
+                }
 
                 if (this._captureInterFrameTime) {
-                    this._interFrameTime.beginMonitoring();  
-                }                
+                    this._interFrameTime.beginMonitoring();
+                }
             });
         }
 
@@ -459,11 +467,11 @@ module BABYLON {
             this._onAfterActiveMeshesEvaluationObserver = null;
 
             this.scene.OnBeforeRenderTargetsRenderObservable.remove(this._onBeforeRenderTargetsRenderObserver);
-            this._onBeforeRenderTargetsRenderObserver = null;   
-            
+            this._onBeforeRenderTargetsRenderObserver = null;
+
             this.scene.OnAfterRenderTargetsRenderObservable.remove(this._onAfterRenderTargetsRenderObserver);
-            this._onAfterRenderTargetsRenderObserver = null;      
-            
+            this._onAfterRenderTargetsRenderObserver = null;
+
             this.scene.onBeforeAnimationsObservable.remove(this._onBeforeAnimationsObserver);
             this._onBeforeAnimationsObserver = null;
 
@@ -471,29 +479,29 @@ module BABYLON {
             this._onBeforeParticlesRenderingObserver = null;
 
             this.scene.onAfterParticlesRenderingObservable.remove(this._onAfterParticlesRenderingObserver);
-            this._onAfterParticlesRenderingObserver = null;         
-            
+            this._onAfterParticlesRenderingObserver = null;
+
             this.scene.onBeforeSpritesRenderingObservable.remove(this._onBeforeSpritesRenderingObserver);
             this._onBeforeSpritesRenderingObserver = null;
 
             this.scene.onAfterSpritesRenderingObservable.remove(this._onAfterSpritesRenderingObserver);
-            this._onAfterSpritesRenderingObserver = null;       
-            
+            this._onAfterSpritesRenderingObserver = null;
+
             this.scene.onBeforeDrawPhaseObservable.remove(this._onBeforeDrawPhaseObserver);
             this._onBeforeDrawPhaseObserver = null;
 
             this.scene.onAfterDrawPhaseObservable.remove(this._onAfterDrawPhaseObserver);
-            this._onAfterDrawPhaseObserver = null;    
-            
+            this._onAfterDrawPhaseObserver = null;
+
             this.scene.onBeforePhysicsObservable.remove(this._onBeforePhysicsObserver);
             this._onBeforePhysicsObserver = null;
 
             this.scene.onAfterPhysicsObservable.remove(this._onAfterPhysicsObserver);
-            this._onAfterPhysicsObserver = null;    
-            
+            this._onAfterPhysicsObserver = null;
+
             this.scene.onAfterAnimationsObservable.remove(this._onAfterAnimationsObserver);
-            this._onAfterAnimationsObserver = null;            
-                
+            this._onAfterAnimationsObserver = null;
+
             (<any>this.scene) = null;
         }
     }

+ 1 - 1
src/babylon.scene.ts

@@ -2035,7 +2035,7 @@
             return null;
         }
 
-        public get Animatables(): Animatable[] {
+        public get animatables(): Animatable[] {
             return this._activeAnimatables;
         }