PDA

View Full Version : Performance on textures



vbovio
05-22-2007, 02:12 PM
Hi,

I'm writing an application where I display texts as textured quads, currently the user selects any number of items (for example points) and I create a texture for every item on the selection and display them each frame. The question is, could it be better if instead of creating a lot of small textures, create just a few big ones (perhaps with the max texture size value) and map each text to it's corresponding texture and it's rectangle bound coords ???..

I believe at least the creation time should be less, but is it worth it to change it ??.. I think I heard also that texture bind was somewhat expensive too..

Thanks.

Zengar
05-22-2007, 03:18 PM
Let me put it this way: using one large texture with all characters has great performance benetifts. You can draw all text you need using only one draw call and binding only one texture.
But if your application performs well on target hardware as it is, it isn't probably worth the time.

vbovio
05-22-2007, 03:38 PM
if the selection is less than 2,000 it is pretty fast, but as the number increases, so is the creation time and framerate, near 10,000 or more the creation time is very slow and so the framerate. The average texture size may be around 128x64 (actually is less but I enlarge the size so it is a power of 2).
The max texture size on my computer is 2048, so in a case where the user makes a selection of 10,000 textures (size 128x64), instead of creating those 10K I would only create like 20 of size 2048x2048.. I guess the gain is on large selections..

any tips/opinions ??

Thanks.