Jump to content

Search the Community

Showing results for tags 'Frames Per Second'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hello friends! I don't understand how to use engine.beginFrame(). It says in the documentation that it should measure the Frames Per Second but i don't understand how it works. If anyone could show me a example that would have been awesome. I have tried to measure the FPS by my self and it looks something like this. var lastCalledTime;var fps;var stop = 0; var renderLoop = function () { // Start new frame if(!lastCalledTime) { lastCalledTime = new Date().getTime(); fps = 0; BABYLON.Tools.QueueNewFrame(renderLoop); return; } delta = (new Date().getTime() - lastCalledTime)/1000; lastCalledTime = new Date().getTime(); fps = 1/delta; // a stop variable since it hard to se the fps when it's displayed 60 times per //second, if(stop == 30){ // a div element to display the fps fpsDiv.innerHTML = parseInt(fps); stop = 0; } engine.beginFrame(); scene.render(); // Present engine.endFrame(); // Register new frame BABYLON.Tools.QueueNewFrame(renderLoop); stop++;};It shows a frame rate between 60 and 0 but it's usually quite low around 16 FPS. I have a piece of shit computer so that doesn't surprise me, but i want to be sure that i really measure the fps. Thanks!
×
×
  • Create New...