how to speed up texture loading?

Started by
23 comments, last by MasterWorks 18 years, 10 months ago
Hi Guimo!

Thanx a lot! It speeds program very much! Seems to be a problem with mip-maps...
Anyway I noticed some weeks ago a 'bug' when I load textures which are not pow^2. It'll be changed soon.
Strangely my hd->memory and memory->texture type routine is still a little bit faster than hd based dx routine (and dxload routine made a mess on screen when snow started to fall in game (snow texture 32x32)
Memory is fred off course :) I did't paste it in my post.
Anyway first loading is a little bit longer, and then every other start is about 3 sec. Not bad :)
And one more question: is there any performance drawbacks if I use textures in 256 colors instead of 32bit textures?
Advertisement
Hi Streamer,

YEs, there is a penalty. Current HW has dropped support for color textures. You still can use it for alpha or other small tricks but not for color. That means colors must be transformed into your final representation in memory. be it a 16 bit A1R5G5B5 or 32 bit A8R8G8B8 (or others). Thats extra loading time.

I'd suggest using TGA files while testing where alpha is encoded in the alpha channel. After that wou can process your alpha and transform them into one of the DXTn formats when releasing.

Luck!
Guimo

Thank you Guimo.

Then I'll stick myself to 32bit textures :)
I would recommend DXT-compressed textures, packed into one big resource file. DXT doesn't need to be uncompressed, since the graphics hardware can use the compressed form directly, often without any performance penalty.

DXT techniques are lossy though - if you want absolutely best image quality, then it is good to use PNG:s (or HDR:s) anyway.

Niko Suni

I used to have individual texture files for animation (say, 64 frames, 128x128 pixels) and after I consolidated each animation into a large (PNG) file, the game loads SO MUCH faster... the overhead for processing a file/texture is significant...

This topic is closed to new replies.

Advertisement