PDA

View Full Version : [OpenGL] Texture memory need



Ñuño Martínez
18-06-2008, 09:56 AM
Hello everybody.

I'm making an engine using "plain OpenGL". I learned OpenGL with NeHe's tutorials some years ago, and I've downloaded the "Blue Book" and the "Red Book" but I'm too lazy and I didn't read them yet. :oops:

My question is about if I can upload all textures to the video memory. I think that 32Mb is enough for my current "standard" but I'm not sure. I mean, the textures uses mip-mapping and some of them also uses masks.

How can I calculate the minimal amount of video memory I need to store the textures for my map and models? How do I know that I've exceeded the video memory capacity?

I've find some games that use "disk cache" for textures. Is this an standard OpenGL extension? How does it work? It's easy to implement that? And how much efficient is it?

JSoftware
18-06-2008, 10:38 AM
Your OpenGL driver will automatically place texture and vertex data in system ram if it's not used or if the graphics card ram runs out of space. You can't really control this

So you don't need to worry about space at all

Ñuño Martínez
18-06-2008, 11:02 AM
I see. This will make things easer.

Thanks for the response.

User137
18-06-2008, 11:43 AM
However, depending on game you might want to load only the graphics needed on current "level" in game. glTexImage2D for example can be used to load and reload texture in its index as many times as needed. This kind of loading has to be self built but in best scenarios can reduce loading time frustration enormously.