Texture loading time

Hi,

In my 3d app, I need to be able to load lots of large textures (that’s about 150 textures, at 256x256). This loading (and unloading) has to happen very quickly (because I need to change the whole texture set fairly often – sometimes as often as once every 20-30 seconds).

I already have my app running in C++ using Direct3D & OpenGL. That’s lightning fast: loading all the textures takes less than 1 second.

However, doing a test program in Xith3D, I’ve noticed that the load time is too long – on the order of 20 seconds. In D3D, the textures are saved as DDS (i.e., compressed texture) files. This format is really fast to load. In my Xith3D, I used jpeg’s. Is there a way to use compressed texture files in Xith3D?

Or, is there anything else I can do to speed up the texture loading?

Thanks,
JT

We dont currently support a compressed texture format, but there is no reason except no one has implemented it yet. OpenGL supports compressed formats. In addition I suspect a bit of your time is spent calculating mipmaps. Opengl can calc mipmaps for you (i think) so there is another point where we can optimize.

As of compressed formats, I was playing around that, but AFAIK there is only S3TC compression available, and it results in visible quality degradation in MOST cases, so I stopped with that…

Yuri

Yeah, S3TC is what I’m thinking of when I say compressed texture format. (DDS is just S3TC format + a few bytes). There is a bit of degradation, but I can live with that. DDS (and I assume S3TC as well) can contain all pre-generated mipmaps in the file, so mipmap generation doesn’t worry me.

Yuri, are you saying you were loading S3TC textures in Xith3D?

Thanks,
JT

Yes, but this was a part of test branch and was not finalized. Anyway, we have to come back to this topic at least because of some other texture formats are not fupported correctly now - something like RGBA5551, etc.

As of S3TC, OpenGL requires that every mipmap level is compressed separately, and, AFAIK, DDS can act as a bundle for mip-mapped texture, so internally in Xith3D rendering subsystem we should deal with separate [optionally compressed] images for each mipmap level.

As of compression in general, I thought it should be interesting to make Compression flag in ImageComponent2D node, so Xith3D can compress texture loaded from JPEG on the fly (say, something like ALWAYS, IF_AVAILABLE, IF_ALREADY_COMPRESSED, NEVER).

On DDS, it would be great to have a Texture loader that can read mip-mapped and compressed texture directly from DDS.

Yuri