Jump to content

Using Text with @4x halves the fps (SOLVED)


Ninjadoodle
 Share

Recommended Posts

Hi @enpu

I've noticed a major slowdown displaying text @4x. Normally everything is 60fps, but as soon as I add the text it goes down to 30fps.

@2x doesnt seem as taxing and still reaches 60fps - but I do feel like something is wrong (possibly the setting I've chosen in BmGlyph).

Anything I should be avoiding in regards to text?

Thank you!

Link to comment
Share on other sites

@Ninjadoodle

You got pretty huge canvas there (2503x1280). Does the fps drop down also if you run the game only in Panda 2 game window? You can detach it into it's own window and then maximize it so it then should be as big as the browser window you got there.

If you have your game running on external browser window, then you have it running in two browsers at the same time (Panda 2 game window is a browser too) which then takes twice as much cpu power.

Running two 2503x1280 canvases with 38 draw calls sounds really heavy.

 

Link to comment
Share on other sites

@enpu - Ok, I guess that makes sense. The main issue I have, is that it only happens on the main screen where   nothing else is happening.

When testing the levels with interaction / physics and animations, everything runs at 60fps - even with two canvases.

Only when text is on the screen does the framerate drop.

i guess text is just a lot ‘heavier’ than the rest.

Thank you for the explanation :)

Link to comment
Share on other sites

@Ninjadoodle

There is nothing special in text that should make it heavier, it is just a container with sprites (each character is one sprite).

Try to make empty project with size of 2503x1280, add 38 sprites which will generate 38 draw calls. Run it on the external browser, does the fps drop then?

(Send screenshot of it with the debug panel open again)

Link to comment
Share on other sites

Hi @enpu

I understand that this is not Panda 2 related - Panda 2 is an awesome engine!

I'm starting to wonder whether html5 game dev is for me lol.

I'm not really sure whether the tech is there yet for what I would like to do.

*** EDIT - Using WebGL, the game runs at 60fps, so yay for that :) *** 

Link to comment
Share on other sites

don't panic, every problem can be solved :D do you use canvas or webgl rendering in your game? if webgl, there will be option to drop drawcalls to few with sprite batching and texture atlases, i think enpu could make that optimisation as part of engine and then you will be happy with html5 again:D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...