Textures for dummies

Hi,

I am a dummy. I have been through the NeHe lesson on texture mapping and got it to work through sheer luck and sweat off my brow.

How do you manage multiple textures? I mean, I assume you just can’t keep loading textures until you run out of memory on your card. Therefore I assume at some point you have to start unloading textures from GL memory. And keeping track of whats loaded, whats not, and what needs to be can be difficult.

Am I missing something that makes this easier?

If not, are there some common practices for managing textures?

Thanks for any help.

Regards,

Shep

Hi,

You make a loop to put the textures in memory.

I’ve done a loop and it works well !

Hi Leyder,

So your saying just loop through all the possible textures I will ever use and load them in to GL memory and GL knows how to deal with them all? I am talking thousands of textures and up here.

Thanks

Shep

That’s what I’ve always done - just loaded all the textures I’ve needed and let OpenGL handle it… but I don’t think I’ve ever exceeded my card’s 8mb limit.

Just curious, but what are you using thousands of textures for?

Hi,

I you want, I can post my source code for do this.

My code does :

Read in a file the path to load texture.
Loop to put in memory the textures.

Interested ? Send me a mail.

Okay modern cards have AGP. AGP is good for texture loading over the bus. Just put all your textures up as long as they don’t take 128 megs and be happy. The driver will have all not-in-card-memory-fitting textures in your main memory and will reload them if you need it. That’s another reason why sorting polys after texture is good.

I am planning to write an opengl ultima online client, actually I have already started. I am trying to write a texture cache object to handle loading textures into and dumping textures from GL/AGP Memory.

Leydar,

Yeah I would like that but the email button in the board doesn’t work.

Shep

Originally posted by Leyder Dylan:
[b]Hi,

I you want, I can post my source code for do this.

My code does :

Read in a file the path to load texture.
Loop to put in memory the textures.

Interested ? Send me a mail.[/b]