[T3D Beta 1.1 (beta 1) - slow performance in GuiBitmapCtrl::setBitmap
by Dusty Monk · in Torque Game Engine · 03/24/2010 (3:11 pm) · 4 replies
So after porting over from 1.0.1 alpha to 1.1 beta, something I've noticed is that all my UI refreshes are taking *much* longer. I've narrowed this down to the fact that I do a lot of setBitmap calls to UI elements for things like ability lists & inventory. Now allowing for the fact that many setBitmap calls on UI elements is probably not the most efficient way of doing things, nevertheless in T3D 1.0.1 alpha this was never a problem, and my UI updates were pretty spritely and quick.
Now though, my entire game pauses for close to a second whenever I bring up the inventory as the script runs through all the slots setting bitmaps according to what's in the inventory. I've perused the code in GuiBitmapButtonCtrl, and while the structure has changed somewhat, the underlying functionality is pretty much the same. Go through and create (or look up) the texture handle for each button variation of the button's bitmap (normal, depressed, inactive, highlighted). So given that *that* code hasn't changed much, I can only assume something has changed in the underlying texture management.
So, has anyone else experienced this when going to 1.1? Or can anyone make suggestions on making setBitmap faster? Would it help if my textures were all power of 2 dimensioned? Do I need to specifically create a material definition for each button texture? Is there some way in script I can preload the textures, and just assign the texture handles to the buttons?
Any thoughts, comments, or similar experiences would be greatly appreciated.
Now though, my entire game pauses for close to a second whenever I bring up the inventory as the script runs through all the slots setting bitmaps according to what's in the inventory. I've perused the code in GuiBitmapButtonCtrl, and while the structure has changed somewhat, the underlying functionality is pretty much the same. Go through and create (or look up) the texture handle for each button variation of the button's bitmap (normal, depressed, inactive, highlighted). So given that *that* code hasn't changed much, I can only assume something has changed in the underlying texture management.
So, has anyone else experienced this when going to 1.1? Or can anyone make suggestions on making setBitmap faster? Would it help if my textures were all power of 2 dimensioned? Do I need to specifically create a material definition for each button texture? Is there some way in script I can preload the textures, and just assign the texture handles to the buttons?
Any thoughts, comments, or similar experiences would be greatly appreciated.
About the author
Dusty Monk is founder and president of Windstorm Studios, an independant game studio. Formerly a sr. programmer at Ensemble Studios, Dusty has worked on AAA titles such as Age of Empires II & III, and Halo Wars.
Torque 3D Owner Ted Southard