#7 Big overhead in FTTextureFontImpl::Render

open
nobody
None
3
2010-06-28
2010-06-18
Anonymous
No

FTTextureFontImpl::RenderI() does a bunch of calls to back up the current blend settings and enable textures everytime it is called. These turn out to be a huge bottle neck when drawing a lot of text at once, and only need to be done once.

In my tests, by removing these calls and ensuring the correct blending and texture modes are set before batch calling FTGL, drawing 20,000 text strings goes from 300ms to 100ms.

Perhaps FTGL could include a stream-lined version of FTTextureFont?

Discussion

  • Patch disables state changes in FTTextureFontImpl::RenderI

     
    Attachments
  • Sean Morrison
    Sean Morrison
    2010-06-28

    Moving from the bug tracker to the feature request tracker as this is intentional behavior. It's not a bug.

     
  • Sean Morrison
    Sean Morrison
    2010-06-28

    The patch definitely cannot be applied as this breaks API backwards compatibility behavior aside from having other potentially undesirable side effects. Better would be a flag to avoid the state change but that will have to be scheduled for a future release unless it's instead implemented as a new call.

     
  • Sean Morrison
    Sean Morrison
    2010-06-28

    • priority: 5 --> 3