Sign in to follow this  
Ninjadoodle

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

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!

Share this post


Link to post
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.

 

Share this post


Link to post
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 :)

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Hi @enpu

I've tried what you suggested, and you are right - I still get a fps drop when the same number of sprites  are on the screen (non-text).

I was really under the impression that today's hardware could handle this better.

Share this post


Link to post
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 :) *** 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Hi @PsichiX

Thanks for the reply :)

Currently it's Canvas, as I'm having an issue with WebGL in the latest version. Honestly, I'm not sure if I really understand about drawcalls and batching etc. (might have to do some research).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.