Ninjadoodle Posted March 8, 2018 Share Posted March 8, 2018 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! Quote Link to comment Share on other sites More sharing options...
PsichiX Posted March 8, 2018 Share Posted March 8, 2018 hmm, providing some usecase info and possibly an example would help to investigate problem (what config you used, etc.). Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 8, 2018 Author Share Posted March 8, 2018 I think everything is pretty standard ... I have Scale Quality: High Format: Sparrow Texture is Ticked Coordinates is Ticked Redraw when downscaling is Unticked Quote Link to comment Share on other sites More sharing options...
enpu Posted March 8, 2018 Share Posted March 8, 2018 @Ninjadoodle Can you sent your font so i can take a look? Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 8, 2018 Author Share Posted March 8, 2018 Hi @enpu - Just sent it through. Please let me know if there is anything else you need me to do / test Thank you! Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 12, 2018 Author Share Posted March 12, 2018 Hi @enpu Just wondering of you might have an idea, on what's causing the fps drop? Thanks in advance Quote Link to comment Share on other sites More sharing options...
enpu Posted March 13, 2018 Share Posted March 13, 2018 @Ninjadoodle I did not notice any slowdown with your font, tried all three versions. Can you post screenshot of your debug panel when your fps is slow. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 13, 2018 Author Share Posted March 13, 2018 Hi @enpu Here is a screengrab, you can also notice the lag while the fps is low. This only happens while using text. Quote Link to comment Share on other sites More sharing options...
enpu Posted March 14, 2018 Share Posted March 14, 2018 @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. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 14, 2018 Author Share Posted March 14, 2018 @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 Quote Link to comment Share on other sites More sharing options...
enpu Posted March 14, 2018 Share Posted March 14, 2018 @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) Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 14, 2018 Author Share Posted March 14, 2018 Hi @enpu Why 38? Just wondering Quote Link to comment Share on other sites More sharing options...
enpu Posted March 14, 2018 Share Posted March 14, 2018 @Ninjadoodle Because your screenshot shows that you have 38 draw calls, one sprite is one draw call. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 16, 2018 Author Share Posted March 16, 2018 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. Quote Link to comment Share on other sites More sharing options...
enpu Posted March 16, 2018 Share Posted March 16, 2018 @Ninjadoodle That's what i was expecting, well good to hear that the issue was not in the text Seems like browsers can't really handle that big canvases yet (so this is not Panda related issue). Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 16, 2018 Author Share Posted March 16, 2018 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 *** Quote Link to comment Share on other sites More sharing options...
PsichiX Posted March 16, 2018 Share Posted March 16, 2018 don't panic, every problem can be solved 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 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted March 16, 2018 Author Share Posted March 16, 2018 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). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.