As I work on developing a web browser game, I've noticed significant FPS drops during animations, especially draggable ones in Chrome. This was concerning to me, as it seemed like the game might become too heavy. However, when I tested the app in Firefox or IE11, it ran smoothly without any noticeable lags!
I'm surprised that Chrome is struggling with this type of rendering. Could there be something in the console settings causing Chrome to lag so severely? Perhaps some logging or other issues?
The application uses a lot of opacities, text, box shadows, and more.
Thanks
Fox
-- PROFILE UPDATE --
Here's what's happening:
When a user opens the inventory
_theatre('sub', '.character-panel', 1);
$('.character-panel').show()
_loadInventory();
_loadPlayerStats();
_loadEquipment();
I suspect the issue lies within the _theatre() function. It creates a full-page fixed div with 0.8 opacity.
function _theatre(t, e, a){
if(a == 1){
window.paused = 1;
$('html').css('overflow', 'hidden');
$(e).wrap('<div class="theatre-' + t + '"></div>');
}
else{
window.paused = 0;
$('html').css('overflow', 'auto');
$(e).unwrap('<div class="theatre-' + t + '"></div>');
}
}
Removing the _theatre() function significantly improves dragging performance. I even tried removing the opacity from the div, but saw no better results. What could be causing this issue?
div.theatre-sub {top:0; left:0; right:0; bottom:0; position:fixed; z-index:9996; background-color:rgba(0,0,0,0.8)}
div.theatre-dom {top:0; left:0; right:0; bottom:0; position:fixed; z-index:9998; background-color:rgba(0,0,0,0.8)}
Profiler data