More RAM than video card memory...

Well, i have a question about texture memory. When you load a texture (from the disk), you put it in the RAM, then you call
eventually gluBuild2DMipmaps(…), and glTexImage2D(…).
Then what do i have to do? Have i to free the memory in the RAM? But if i have more RAM-texture-memory than video-texture-memory, are my textures going to get lost?
Help me please!!!


You do not need to keep a copy of the image yourself. OpenGL automatically keeps a copy of the texture in system memory to re-upload to VRAM should it get shifted out.

You should free your image after you’ve created the texture with it, unless you need it for anything else.


You only have to upload the textures once using gluBuild2DMipmaps() or glTexImage2D().
After that you can delete the texture because OpenGL has a copy of it (in video/AGP memory, whatever ).

You’re textures are not going to be lost when there’s no memory left on the videocard, instead OpenGL keeps a copy in system memory.
When system memory is full, windoze is going to trash

In a game you shouldn’t upload all textures at once, you have to stream them into videomemory with glSubImage2D() (or something like that, don’t know for sure about the name).
This way, you can have way more textures :stuck_out_tongue:

Anyway, forget the last part of what I said for now, just delete that texture

You can use glDeleteTextures(…) for deleting the texture in videomemory.

Bah, I should get a faster connection… :stuck_out_tongue:


This streaming thing. Hows that work?
I assumed you just did everything using glBind, and provided you sort by texture you get maximum efficiency of system ram -> VRAM texture uploads per frame.

Does anyone do something different, to get better performance? If so, what, and why, and how much better is it. Come on we want to know…


When you’ve got large big worlds with many textures you can’t upload all textures of that world at once, so you have to upload them when you need them via glSubImage2D() and delete them when you don’t need them anymore…
That’s what I meant with streaming

OK, thanks guys!