View Single Post
06-28-13, 06:13 PM   #3
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
I ran into this in my map project when I tried to draw very large numbers of textures and font strings at once. Just having them on-screen caused a noticeable dip in the frame rate, but attempting to move the frame they were attached to practically froze the game.

I had created many font strings as labels for various POIs on the map..


And displaying them for the entire continent greatly impacted frame rates.


However, since you could both drag and zoom the map, it quickly became obvious that moving or scaling the frame caused exponentially more of a problem for FPS.

When I adjusted the script to hide the labels while dragging, and showing them when finished, it completely solved the problem. As long as the regions aren't visible while they're being repositioned they have almost no impact on the frame rate.

This leads me to believe that simply recalculating the positions of the regions isn't the problem, but redrawing them every time they move is. Therefor, if you can limit how often they're redrawn you should be able to limit the impact on frame rate.

This may not make any sense, but instead of anchoring your nameplates directly to the existing one, try attaching them to the WorldFrame and using an OnUpdate script to reposition them only once per frame.

The author of kui nameplates uses this method to keep their nameplates pixel perfect, although an unexpected side effect is higher frame rates.
  Reply With Quote