Wintermute Engine > Bug reports

FPS drops with text

(1/2) > >>

metamorphium:
Hello.

I have the following problem. I have lots of scenes where I use the dialogue logic (getting responses and such). The best illustration will be the two following images:



This is the desired window and it runs at 87 fps. You will probably agree it's not much of a text in here. Also the poly count is 262.



This is the window where I erased the top text. There's absolutely nothing else different. Everything is identical, just the upper part of the window has no text. There are no script transformation functions which would be handling the upper text, it's plainly setting the static control's text to a string.

Like this it runs at 652 frames.

This is constant behavior of WME for the whole JULIA, however for certain more complex scenes the drop is too painful. Also the fps is stable. Which means in this scene it always runs at 87 or 652 respectively (given 3 frames delta).

Any clue what should be done? Or do you need more info about it?

Thanks a lot!!!

metamorphium:
Also in case you are wondering about the font used, this is the definition file:


TTFONT
{

  SIZE = 12 
  FACE = "Tahoma"


  BOLD = TRUE
  ITALIC = FALSE
  UNDERLINE = FALSE
  STRIKE = FALSE

  CHARSET = 1

  COLOR { 255, 255, 255 }
  ALPHA = 255
 
 
  LAYER
  {
    OFFSET_X = 0
    OFFSET_Y = 0
    COLOR { 0, 0, 0 }
    ALPHA = 100
  }

  LAYER
  {
    OFFSET_X = 1
    OFFSET_Y = 1
    COLOR { 255, 255, 255 }
    ALPHA = 255
  }

}

Mnemonic:
Rendering the text to texture is relatively slow. That's why WME keeps cache of several previously rendered texts for each truetype font. The cache size is set to 30. So if there are more than 30 text elements simultaneously on screen (static controls, buttons etc.) using the same font, it will cause cache thrashing and reduced performance. Same thing will happen if some text is changing frequently (frequently, as in each frame, such as the timer display).

Other than that, no idea. Neither of these appear to be your case, but maybe there are some more static controls we can't see on the screenshots?

metamorphium:
There are cca. 5 statics on the screen. There are some windows in the memory, but not 30. I tried to run the game without debug mode. Game runs in 3000 fps (windowed). As soon as the text appears, it drops to 80.

On slower machines it sometimes drops to 7. :(

Just out of the curiosity, how difficult would be to raise the cache to let's say 150 items? This could prove the point.

Is it just the matter of setting  #define NUM_CACHED_TEXTS 30 in BFontTT.h?

Mnemonic:

--- Quote from: metamorphium on July 10, 2011, 12:36:08 PM ---Is it just the matter of setting  #define NUM_CACHED_TEXTS 30 in BFontTT.h?

--- End quote ---
Yes.
Well, you gotta finish the beta so that I can get my hands on it :) I can't think of any other reason why text should kill performance.

Navigation

[0] Message Index

[#] Next page

Go to full version