Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: how to place objects into video card memory ?

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2004
    Posts
    19

    how to place objects into video card memory ?

    The problem I have is the following.
    I use glDrawPixel to draw a background but it is too slow because every time it has to transfer data from ram to video buffer.
    I search for a solution to place data into video card memory and use it from there.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Aug 2001
    Location
    Italy
    Posts
    628

    Re: how to place objects into video card memory ?

    Have you tried display lists?
    Historically, those things were used to store pixel data in fast server memory. Then texture objects went there anyway, that's my two cents.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,537

    Re: how to place objects into video card memory ?

    DrawPixel is slow as snails. It would be better to use texture mapping. Modern 3d cards are pretty darn good at that. Just draw a full screen quad with your background texture on it and you're set. Just set the appropriate filtering modes as needed on texture load.

    -SirKnight
    -SirKnight

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2004
    Posts
    7

    Re: how to place objects into video card memory ?

    You should search for information on vertex buffer objects.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: how to place objects into video card memory ?

    Vertex buffer objects don't help with the transfer rate of DrawPixels.

    To get DrawPixels as fast as it can be, you should make sure that your data is 4-byte aligned, and that it is in GL_BGRA format in memory, using unsigned bytes.

    However, some implmentations of DrawPixels are still slow, and you'll get better performance by uploading the data to a texture (each frame) and drawing a single quad with the texture on it, positioned correctly, using glOrtho() projection.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •