Results 1 to 7 of 7

Thread: More RAM than video card memory...

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2001
    Posts
    16

    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!!!

    Number42

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    926

    Re: More RAM than video card memory...

    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.

    Nutty

  3. #3
    Senior Member Regular Contributor
    Join Date
    Oct 2000
    Posts
    440

    Re: More RAM than video card memory...

    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 :P

    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.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Oct 2000
    Posts
    440

    Re: More RAM than video card memory...

    Bah, I should get a faster connection... :P

  5. #5
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    926

    Re: More RAM than video card memory...

    hehehe..

    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..

    Nutty

  6. #6
    Senior Member Regular Contributor
    Join Date
    Oct 2000
    Posts
    440

    Re: More RAM than video card memory...

    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

  7. #7
    Junior Member Newbie
    Join Date
    Jan 2001
    Posts
    16

    Re: More RAM than video card memory...

    OK, thanks guys!

    TheDD

Similar Threads

  1. Video Card Memory Management
    By JRGlide in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 02-08-2010, 06:21 AM
  2. how to keep textures in video card's memory?
    By crankygoo in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 01-06-2010, 04:34 AM
  3. Clear Video Card Memory
    By ToddAtWSU in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 01-24-2007, 02:09 PM
  4. Video Card Memory Size
    By BD in forum OpenGL: User Software
    Replies: 3
    Last Post: 04-13-2004, 12:21 AM
  5. Query Video Card Info (Video Memory size?)
    By macbearchen in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-17-2003, 02:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean