BabylonJS forum

http://www.html5gamedevs.com/topic/5641-different-fps-between-chrome-and-firefox/#entry33992

by MaxenceBrasselet

HTML

<script src="https://rawgit.com/BabylonJS/Babylon.js/master/babylon.1.10.0.js"></script>
<canvas id="renderCanvas"></canvas>
<div id="fps"></div>

CSS

html, body, div, canvas {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

html, body {
    position: relative;
}

#fps {
    position: absolute;
    top: 50px;
    right: 20px;
    width: 150px;
    text-align: right;
    height: 20px;
    color: white;
}

JavaScript

// Get the Canvas element from our HTML below
var canvas = document.getElementById("renderCanvas");
// Load BABYLON 3D engine and set the root directory
var engine = new BABYLON.Engine(canvas, true);

//Create a new scene with a camera (mandatory), a light (better) and a sphere (to see the origin)
var scene = new BABYLON.Scene(engine);
scene.ambientColor = new BABYLON.Color3(1, 1, 1);
this.scene = scene;

// Creating a camera looking to the zero point (0,0,0)
var camera = new BABYLON.ArcRotateCamera("MainCamera", 1, 0.8, 10, new BABYLON.Vector3(0, 0, 0), scene);
//var camera = new BABYLON.FreeCamera("MainCamera", new BABYLON.Vector3(0, 5, -20), scene);

// Creating a omnidirectional light
var light0 = new BABYLON.DirectionalLight("Omni", new BABYLON.Vector3(0, -1, 0), scene);

var material = new BABYLON.StandardMaterial("Mat1", scene);

var box = BABYLON.Mesh.CreateBox("origin", 1, scene);
//material.diffuseTexture = new BABYLON.Texture("Assets/texture/10points.png", scene);
material.emissiveColor = new BABYLON.Color3(1, 1, 1);
box.material = material;

// Attach the camera to the scene
scene.activeCamera.attachControl(canvas);

var objectCount = 0;
for (var i = 0; i < 30; i++) {
	for (var e = i; e < 30; e++) {
		var clone = box.clone();
		clone.position.x = (e - i * 0.5) * 1.01 + 7;
		clone.position.y = 0.5 + i * 1.0;
		clone.position.z = 3.0;
	}
}

// Once the scene is loaded, just register a render loop to render it
engine.runRenderLoop(function () {
	scene.render();

	document.getElementById('fps').innerHTML = BABYLON.Tools.GetFps().toFixed() + " fps , active=" + scene._activeMeshes.length;
});