Browse Source

Merge remote-tracking branch 'BabylonJS/master' into gui-module

# Conflicts:
#	Tools/Gulp/config.json
Raanan Weber 7 years ago
parent
commit
c87112d0be

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


+ 14 - 1
Tools/Gulp/config.json

@@ -122,7 +122,8 @@
             "behaviors",
             "behaviors",
             "imageProcessing",
             "imageProcessing",
             "occlusionQuery",
             "occlusionQuery",
-            "transformFeedback"
+            "transformFeedback",
+            "noise"
         ],
         ],
         "minimal": [
         "minimal": [
             "meshBuilder",
             "meshBuilder",
@@ -272,6 +273,18 @@
                 "core"
                 "core"
             ]
             ]
         },
         },
+        "noise": {
+            "files": [
+                "../../src/Materials/Textures/Procedurals/babylon.noiseProceduralTexture.js"
+            ],
+            "dependUpon": [
+                "core",
+                "procedural"
+            ],
+            "shaders": [
+                "noise.fragment"
+            ]
+        },
         "particles": {
         "particles": {
             "files": [
             "files": [
                 "../../src/Particles/babylon.particle.js",
                 "../../src/Particles/babylon.particle.js",

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


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


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


File diff suppressed because it is too large
+ 128 - 14
dist/preview release/babylon.no-module.max.js


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


File diff suppressed because it is too large
+ 130 - 16
dist/preview release/es6.js


+ 2 - 11
dist/preview release/typedocValidationBaseline.json

@@ -1,7 +1,7 @@
 {
 {
-  "errors": 4240,
+  "errors": 4239,
   "babylon.typedoc.json": {
   "babylon.typedoc.json": {
-    "errors": 4240,
+    "errors": 4239,
     "AbstractMesh": {
     "AbstractMesh": {
       "Property": {
       "Property": {
         "showBoundingBox": {
         "showBoundingBox": {
@@ -20639,15 +20639,6 @@
         }
         }
       }
       }
     },
     },
-    "UtilityLayerRenderer": {
-      "Property": {
-        "DefaultUtilityLayer": {
-          "Comments": {
-            "MissingText": true
-          }
-        }
-      }
-    },
     "VRCameraMetrics": {
     "VRCameraMetrics": {
       "Class": {
       "Class": {
         "Comments": {
         "Comments": {

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


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


+ 2 - 2
src/Behaviors/Mesh/babylon.pointerDragBehavior.ts

@@ -163,7 +163,7 @@ module BABYLON {
                             targetPosition.copyFrom((<Mesh>this._attachedNode).absolutePosition)
                             targetPosition.copyFrom((<Mesh>this._attachedNode).absolutePosition)
 
 
                             // Detatch camera controls
                             // Detatch camera controls
-                            if(this.detachCameraControls && this._scene.activeCamera){
+                            if(this.detachCameraControls && this._scene.activeCamera && !this._scene.activeCamera.leftCamera){
                                 if(this._scene.activeCamera.inputs.attachedElement){
                                 if(this._scene.activeCamera.inputs.attachedElement){
                                     attachedElement = this._scene.activeCamera.inputs.attachedElement;
                                     attachedElement = this._scene.activeCamera.inputs.attachedElement;
                                     this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement);
                                     this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement);
@@ -178,7 +178,7 @@ module BABYLON {
                         this.releaseDrag();
                         this.releaseDrag();
 
 
                         // Reattach camera controls
                         // Reattach camera controls
-                        if(this.detachCameraControls && attachedElement && this._scene.activeCamera){
+                        if(this.detachCameraControls && attachedElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera){
                             this._scene.activeCamera.attachControl(attachedElement, true);
                             this._scene.activeCamera.attachControl(attachedElement, true);
                         }
                         }
                     }
                     }

+ 2 - 2
src/Behaviors/Mesh/babylon.sixDofDragBehavior.ts

@@ -107,7 +107,7 @@ module BABYLON {
                         this.currentDraggingPointerID = (<PointerEvent>pointerInfo.event).pointerId;
                         this.currentDraggingPointerID = (<PointerEvent>pointerInfo.event).pointerId;
 
 
                         // Detatch camera controls
                         // Detatch camera controls
-                        if(this.detachCameraControls && this._scene.activeCamera){
+                        if(this.detachCameraControls && this._scene.activeCamera && !this._scene.activeCamera.leftCamera){
                             if(this._scene.activeCamera.inputs.attachedElement){
                             if(this._scene.activeCamera.inputs.attachedElement){
                                 attachedElement = this._scene.activeCamera.inputs.attachedElement;
                                 attachedElement = this._scene.activeCamera.inputs.attachedElement;
                                 this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement);
                                 this._scene.activeCamera.detachControl(this._scene.activeCamera.inputs.attachedElement);
@@ -125,7 +125,7 @@ module BABYLON {
                         this._virtualOriginMesh.removeChild(this._virtualDragMesh);
                         this._virtualOriginMesh.removeChild(this._virtualDragMesh);
                         
                         
                         // Reattach camera controls
                         // Reattach camera controls
-                        if(this.detachCameraControls && attachedElement && this._scene.activeCamera){
+                        if(this.detachCameraControls && attachedElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera){
                             this._scene.activeCamera.attachControl(attachedElement, true);
                             this._scene.activeCamera.attachControl(attachedElement, true);
                         }
                         }
                     }
                     }

+ 14 - 6
src/Gizmos/babylon.boundingBoxGizmo.ts

@@ -44,12 +44,13 @@ module BABYLON {
          */
          */
         public onDragEndObservable = new Observable<{}>();
         public onDragEndObservable = new Observable<{}>();
         private _anchorMesh:AbstractMesh;
         private _anchorMesh:AbstractMesh;
+        private _existingMeshScale = new Vector3();
         /**
         /**
          * Creates an BoundingBoxGizmo
          * Creates an BoundingBoxGizmo
          * @param gizmoLayer The utility layer the gizmo will be added to
          * @param gizmoLayer The utility layer the gizmo will be added to
          * @param color The color of the gizmo
          * @param color The color of the gizmo
          */
          */
-        constructor(color:Color3 = Color3.Gray(), gizmoLayer:UtilityLayerRenderer = UtilityLayerRenderer.DefaultUtilityLayer){
+        constructor(color:Color3 = Color3.Gray(), gizmoLayer:UtilityLayerRenderer = UtilityLayerRenderer.DefaultKeepDepthUtilityLayer){
             super(gizmoLayer);
             super(gizmoLayer);
 
 
             // Do not update the gizmo's scale so it has a fixed size to the object its attached to
             // Do not update the gizmo's scale so it has a fixed size to the object its attached to
@@ -143,6 +144,7 @@ module BABYLON {
                             this._anchorMesh.rotationQuaternion!.multiplyToRef(this._tmpQuaternion,this._anchorMesh.rotationQuaternion!);
                             this._anchorMesh.rotationQuaternion!.multiplyToRef(this._tmpQuaternion,this._anchorMesh.rotationQuaternion!);
                             this._anchorMesh.removeChild(this.attachedMesh);
                             this._anchorMesh.removeChild(this.attachedMesh);
                         }
                         }
+                        this.updateBoundingBox(); 
                     }
                     }
                 });
                 });
 
 
@@ -179,7 +181,7 @@ module BABYLON {
                             if(this.attachedMesh){
                             if(this.attachedMesh){
                                 var deltaScale = new Vector3(event.dragDistance,event.dragDistance,event.dragDistance);
                                 var deltaScale = new Vector3(event.dragDistance,event.dragDistance,event.dragDistance);
                                 deltaScale.scaleInPlace(this._scaleDragSpeed);
                                 deltaScale.scaleInPlace(this._scaleDragSpeed);
-                                this._updateBoundingBox(); 
+                                this.updateBoundingBox(); 
 
 
                                  // Scale from the position of the opposite corner                   
                                  // Scale from the position of the opposite corner                   
                                 box.absolutePosition.subtractToRef(this._anchorMesh.position, this._tmpVector);
                                 box.absolutePosition.subtractToRef(this._anchorMesh.position, this._tmpVector);
@@ -229,9 +231,12 @@ module BABYLON {
 
 
             // Update bounding box positions
             // Update bounding box positions
             this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(()=>{
             this._renderObserver = this.gizmoLayer.originalScene.onBeforeRenderObservable.add(()=>{
-                this._updateBoundingBox();
+                // Only update the bouding box if scaling has changed
+                if(this.attachedMesh && !this._existingMeshScale.equals(this.attachedMesh.scaling)){
+                    this.updateBoundingBox();
+                }
             })
             })
-            this._updateBoundingBox();
+            this.updateBoundingBox();
         }
         }
         
         
         protected _attachedMeshChanged(value:Nullable<AbstractMesh>){
         protected _attachedMeshChanged(value:Nullable<AbstractMesh>){
@@ -240,7 +245,7 @@ module BABYLON {
                 // This is needed to avoid invalid box/sphere position on first drag
                 // This is needed to avoid invalid box/sphere position on first drag
                 this._anchorMesh.addChild(value);
                 this._anchorMesh.addChild(value);
                 this._anchorMesh.removeChild(value);
                 this._anchorMesh.removeChild(value);
-                this._updateBoundingBox();
+                this.updateBoundingBox();
             }
             }
         }
         }
 
 
@@ -258,7 +263,7 @@ module BABYLON {
             });
             });
         }
         }
 
 
-        private _updateBoundingBox(){
+        public updateBoundingBox(){
             if(this.attachedMesh){             
             if(this.attachedMesh){             
                 // Rotate based on axis
                 // Rotate based on axis
                 if(!this.attachedMesh.rotationQuaternion){
                 if(!this.attachedMesh.rotationQuaternion){
@@ -345,6 +350,9 @@ module BABYLON {
                     }
                     }
                 }
                 }
             }
             }
+            if(this.attachedMesh){
+                this._existingMeshScale.copyFrom(this.attachedMesh.scaling);
+            }
         }
         }
 
 
         /**
         /**

+ 1 - 6
src/Gizmos/babylon.gizmoManager.ts

@@ -12,7 +12,6 @@ module BABYLON {
         private _pointerObserver:Nullable<Observer<PointerInfo>> = null;
         private _pointerObserver:Nullable<Observer<PointerInfo>> = null;
         private _attachedMesh:Nullable<AbstractMesh> = null;
         private _attachedMesh:Nullable<AbstractMesh> = null;
         private _boundingBoxColor = BABYLON.Color3.FromHexString("#0984e3");
         private _boundingBoxColor = BABYLON.Color3.FromHexString("#0984e3");
-        private _boundingBoxUtilLayer:Nullable<UtilityLayerRenderer> = null;
         private _dragBehavior = new BABYLON.SixDofDragBehavior();
         private _dragBehavior = new BABYLON.SixDofDragBehavior();
         /**
         /**
          * Array of meshes which will have the gizmo attached when a pointer selected them. If null, all meshes are attachable. (Default: null)
          * Array of meshes which will have the gizmo attached when a pointer selected them. If null, all meshes are attachable. (Default: null)
@@ -138,11 +137,7 @@ module BABYLON {
          */
          */
         public set boundingBoxGizmoEnabled(value:boolean){
         public set boundingBoxGizmoEnabled(value:boolean){
             if(value){
             if(value){
-                if(!this._boundingBoxUtilLayer){
-                    this._boundingBoxUtilLayer = new BABYLON.UtilityLayerRenderer(this.scene);
-                    this._boundingBoxUtilLayer.utilityLayerScene.autoClearDepthAndStencil = false;
-                }
-                this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new BoundingBoxGizmo(this._boundingBoxColor, this._boundingBoxUtilLayer);
+                this.gizmos.boundingBoxGizmo = this.gizmos.boundingBoxGizmo || new BoundingBoxGizmo(this._boundingBoxColor);
                 this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh;
                 this.gizmos.boundingBoxGizmo.attachedMesh = this._attachedMesh;
                 if(this._attachedMesh){
                 if(this._attachedMesh){
                     this._attachedMesh.removeBehavior(this._dragBehavior);
                     this._attachedMesh.removeBehavior(this._dragBehavior);

+ 86 - 0
src/Materials/Textures/Procedurals/babylon.noiseProceduralTexture.ts

@@ -0,0 +1,86 @@
+module BABYLON {
+    /**
+     * Class used to generate noise procedural textures
+     */
+    export class NoiseProceduralTexture extends ProceduralTexture {
+        private _time = new Vector2();
+
+        /** Gets or sets a value between 0 and 1 indicating the overall brightness of the texture (default is 0.2) */
+        public brightness = 0.2;
+
+        /** Defines the first octave to start from (default is 3) */
+        public firstOctave = 3;
+
+        /** Defines the number of octaves to process */
+        public octaves = 8;
+
+        /** Defines the level of persistence (0.8 by default) */
+        public persistence = 0.8;
+
+        /** Gets or sets animation speed factor for X axis (default is 1) */
+        public animationSpeedFactorX = 1;
+
+        /** Gets or sets animation speed factor for Y axis (default is 1) */
+        public animationSpeedFactorY = 1;
+
+        /**
+         * Creates a new NoiseProceduralTexture
+         * @param name defines the name fo the texture
+         * @param size defines the size of the texture (default is 256)
+         * @param scene defines the hosting scene
+         * @param fallbackTexture defines the texture to use if the NoiseProceduralTexture can't be created
+         * @param generateMipMaps defines if mipmaps must be generated (true by default)
+         */
+        constructor(name: string, size: number = 256, scene: Nullable<Scene> = Engine.LastCreatedScene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+            super(name, size, "noise", scene, fallbackTexture, generateMipMaps);
+            this._updateShaderUniforms();
+        }
+
+        private _updateShaderUniforms() {
+            let scene = this.getScene();
+
+            if (!scene) {
+                return;
+            }
+
+            this._time.x += scene.getAnimationRatio() * this.animationSpeedFactorX * 0.001;
+            this._time.y += scene.getAnimationRatio() * this.animationSpeedFactorY * 0.001;
+
+            this.setFloat("brightness", this.brightness);
+            this.setInt("firstOctave", this.firstOctave);
+            this.setInt("octaves", this.octaves);
+            this.setFloat("persistence", this.persistence);
+            this.setVector2("timeScale", this._time);
+        }
+
+        /** Generate the current state of the procedural texture */
+        public render(useCameraPostProcess?: boolean) {
+            this._updateShaderUniforms();
+            super.render(useCameraPostProcess);
+        }
+
+        /**
+         * Serializes this noise procedural texture
+         * @returns a serialized noise procedural texture object
+         */
+        public serialize(): any {
+            var serializationObject = SerializationHelper.Serialize(this, super.serialize());
+            serializationObject.customType = "BABYLON.NoiseProceduralTexture";
+
+            return serializationObject;
+        }
+
+        /**
+         * Creates a NoiseProceduralTexture from parsed noise procedural texture data
+         * @param parsedTexture defines parsed texture data
+         * @param scene defines the current scene
+         * @param rootUrl defines the root URL containing noise procedural texture information
+         * @returns a parsed NoiseProceduralTexture
+         */
+        public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): NoiseProceduralTexture {
+            var texture = SerializationHelper.Parse(() => new NoiseProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);
+
+            return texture;
+        }        
+    }
+}

+ 22 - 1
src/Materials/Textures/Procedurals/babylon.proceduralTexture.ts

@@ -23,6 +23,7 @@
 
 
         public _textures: {[key: string]: Texture} = {};
         public _textures: {[key: string]: Texture} = {};
         private _floats: {[key: string]: number} = {};
         private _floats: {[key: string]: number} = {};
+        private _ints: {[key: string]: number} = {};
         private _floatsArrays: {[key: string]: number[]} = {};
         private _floatsArrays: {[key: string]: number[]} = {};
         private _colors3: {[key: string]: Color3} = {};
         private _colors3: {[key: string]: Color3} = {};
         private _colors4: {[key: string]: Color4} = {};
         private _colors4: {[key: string]: Color4} = {};
@@ -35,9 +36,11 @@
         private _fallbackTextureUsed = false;
         private _fallbackTextureUsed = false;
         private _engine: Engine;
         private _engine: Engine;
 
 
-        constructor(name: string, size: any, fragment: any, scene: Scene, fallbackTexture: Nullable<Texture> = null, generateMipMaps = true, public isCube = false) {
+        constructor(name: string, size: any, fragment: any, scene: Nullable<Scene>, fallbackTexture: Nullable<Texture> = null, generateMipMaps = true, public isCube = false) {
             super(null, scene, !generateMipMaps);
             super(null, scene, !generateMipMaps);
 
 
+            scene = this.getScene()!;
+
             scene.proceduralTextures.push(this);
             scene.proceduralTextures.push(this);
 
 
             this._engine = scene.getEngine();
             this._engine = scene.getEngine();
@@ -232,6 +235,19 @@
             return this;
             return this;
         }
         }
 
 
+        /**
+         * Set the value of an uniform to an integer value
+         * @param name defines the name of the uniform
+         * @param value defines the value to set
+         * @returns the current procedural texture
+         */
+        public setInt(name: string, value: number): ProceduralTexture {
+            this._checkUniform(name);
+            this._ints[name] = value;
+
+            return this;
+        }
+
         public setFloats(name: string, value: number[]): ProceduralTexture {
         public setFloats(name: string, value: number[]): ProceduralTexture {
             this._checkUniform(name);
             this._checkUniform(name);
             this._floatsArrays[name] = value;
             this._floatsArrays[name] = value;
@@ -293,6 +309,11 @@
             }
             }
 
 
             // Float    
             // Float    
+            for (name in this._ints) {
+                this._effect.setInt(name, this._ints[name]);
+            }            
+
+            // Float    
             for (name in this._floats) {
             for (name in this._floats) {
                 this._effect.setFloat(name, this._floats[name]);
                 this._effect.setFloat(name, this._floats[name]);
             }
             }

+ 18 - 1
src/Rendering/babylon.utilityLayerRenderer.ts

@@ -6,15 +6,32 @@ module BABYLON {
         private _pointerCaptures: {[pointerId:number]: boolean} = {};
         private _pointerCaptures: {[pointerId:number]: boolean} = {};
         private _lastPointerEvents: {[pointerId:number]: number} = {};
         private _lastPointerEvents: {[pointerId:number]: number} = {};
         private static _DefaultUtilityLayer:Nullable<UtilityLayerRenderer> = null;
         private static _DefaultUtilityLayer:Nullable<UtilityLayerRenderer> = null;
+        private static _DefaultKeepDepthUtilityLayer:Nullable<UtilityLayerRenderer> = null;
+        /** 
+         * A shared utility layer that can be used to overlay objects into a scene (Depth map of the previous scene is cleared before drawing on top of it)
+         */ 
         public static get DefaultUtilityLayer():UtilityLayerRenderer{
         public static get DefaultUtilityLayer():UtilityLayerRenderer{
             if(UtilityLayerRenderer._DefaultUtilityLayer == null){
             if(UtilityLayerRenderer._DefaultUtilityLayer == null){
                 UtilityLayerRenderer._DefaultUtilityLayer = new UtilityLayerRenderer(BABYLON.Engine.LastCreatedScene!);
                 UtilityLayerRenderer._DefaultUtilityLayer = new UtilityLayerRenderer(BABYLON.Engine.LastCreatedScene!);
-                UtilityLayerRenderer._DefaultUtilityLayer.originalScene.onDisposeObservable.add(()=>{
+                UtilityLayerRenderer._DefaultUtilityLayer.originalScene.onDisposeObservable.addOnce(()=>{
                     UtilityLayerRenderer._DefaultUtilityLayer = null;
                     UtilityLayerRenderer._DefaultUtilityLayer = null;
                 });
                 });
             }
             }
             return UtilityLayerRenderer._DefaultUtilityLayer;
             return UtilityLayerRenderer._DefaultUtilityLayer;
         }
         }
+        /** 
+         * A shared utility layer that can be used to embed objects into a scene (Depth map of the previous scene is not cleared before drawing on top of it)
+         */ 
+        public static get DefaultKeepDepthUtilityLayer():UtilityLayerRenderer{
+            if(UtilityLayerRenderer._DefaultKeepDepthUtilityLayer == null){
+                UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = new UtilityLayerRenderer(BABYLON.Engine.LastCreatedScene!);
+                UtilityLayerRenderer._DefaultKeepDepthUtilityLayer.utilityLayerScene.autoClearDepthAndStencil = false;
+                UtilityLayerRenderer._DefaultKeepDepthUtilityLayer.originalScene.onDisposeObservable.addOnce(()=>{
+                    UtilityLayerRenderer._DefaultKeepDepthUtilityLayer = null;
+                });
+            }
+            return UtilityLayerRenderer._DefaultKeepDepthUtilityLayer;
+        }
 
 
         /** 
         /** 
          * The scene that is rendered on top of the original scene
          * The scene that is rendered on top of the original scene

+ 78 - 0
src/Shaders/noise.fragment.fx

@@ -0,0 +1,78 @@
+// Source: https://www.shadertoy.com/view/4lB3zz
+
+// Uniforms
+uniform float brightness;
+uniform int firstOctave;
+uniform int octaves;
+uniform float persistence;
+uniform vec2 timeScale;
+
+// Varyings
+varying vec2 vUV;
+
+// Functions
+float noise(int x,int y)
+{   
+    float fx = float(x);
+    float fy = float(y);
+    
+    return 2.0 * fract(sin(dot(vec2(fx, fy), vec2(12.9898, 78.233))) * 43758.5453) - 1.0;
+}
+
+float smoothNoise(int x,int y)
+{
+    return noise(x, y) / 4.0 + (noise(x + 1, y) + noise(x - 1,y) + 
+           noise(x, y + 1) + noise(x, y - 1)) / 8.0 + (noise(x + 1, y + 1) +
+           noise(x + 1,y - 1) + noise(x - 1, y + 1) + noise(x - 1,y - 1)) / 16.0;
+}
+
+float cosInterpolation(float x,float y,float n)
+{
+    float r = n * 3.1415926;
+    float f = (1.0 - cos(r)) * 0.5;
+    return x * (1.0 - f) + y * f;    
+}
+
+float interpolationNoise(float x, float y)
+{
+    int ix = int(x);
+    int iy = int(y);
+    float fracx = x - float(int(x));
+    float fracy = y - float(int(y));
+    
+    float v1 = smoothNoise(ix, iy);
+    float v2 = smoothNoise(ix + 1, iy);
+    float v3 = smoothNoise(ix, iy + 1);
+    float v4 = smoothNoise(ix + 1, iy + 1);
+    
+   	float i1 = cosInterpolation(v1, v2, fracx);
+    float i2 = cosInterpolation(v3, v4, fracx);
+    
+    return cosInterpolation(i1, i2, fracy);    
+}
+
+float perlinNoise2D(float x,float y)
+{
+    float sum = 0.0;
+    float frequency = 0.0;
+    float amplitude = 0.0;
+    for(int i = firstOctave; i < octaves + firstOctave; i++)
+    {
+        frequency = pow(2.0, float(i));
+        amplitude = pow(persistence, float(i));
+        sum = sum + interpolationNoise(x * frequency, y * frequency) * amplitude;
+    }
+    
+    return sum;
+}
+
+// Main
+void main(void)
+{
+    float x = abs(vUV.x + timeScale.x);
+    float y = abs(vUV.y + timeScale.y);
+
+    float noise = brightness + (1.0 - brightness) * perlinNoise2D(x,y);
+
+	gl_FragColor = vec4(noise, noise, noise, 1.0);
+}

+ 1 - 1
src/babylon.scene.ts

@@ -1513,7 +1513,7 @@
          * @returns a number
          * @returns a number
          */
          */
         public getAnimationRatio(): number {
         public getAnimationRatio(): number {
-            return this._animationRatio;
+            return this._animationRatio !== undefined ? this._animationRatio : 1;
         }
         }
 
 
         /** 
         /** 

BIN
tests/validation/ReferenceImages/Gizmos.png


+ 7 - 1
tests/validation/config.json

@@ -2,11 +2,17 @@
   "root": "https://rawgit.com/BabylonJS/Website/master",
   "root": "https://rawgit.com/BabylonJS/Website/master",
   "tests": [  
   "tests": [  
     {
     {
+      "title": "Gizmos",
+      "playgroundId": "#8GY6J8#48",
+      "renderCount": 50,
+      "referenceImage": "Gizmos.png"
+    }, 
+    {
       "title": "GUI3D SpherePanel",
       "title": "GUI3D SpherePanel",
       "playgroundId": "#HB4C01#9",
       "playgroundId": "#HB4C01#9",
       "renderCount": 50,
       "renderCount": 50,
       "referenceImage": "spherepanel.png"
       "referenceImage": "spherepanel.png"
-    },        
+    },     
     {
     {
       "title": "Particle Helper",
       "title": "Particle Helper",
       "playgroundId": "#1VGT5D#2",
       "playgroundId": "#1VGT5D#2",