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 4 of 4

Thread: Loading image sequences in real time

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

    Loading image sequences in real time

    Hi!

    I'm trying to load a series of image sequences in my openGL program to do further calculations on them in my shader. these image sequences will produce an animation. My question is if it is even possible to load these images in real time or should I pre-load them and then render them?

    and how can I load these amount of images on my texture memory? If someone can give me an example It will be great!

    Thanks in advance.

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325
    That depends(TM).

    How large are the images and are they compressed? Maybe your HDD is too slow to begin with. Do they have to be uncompressed and maybe recompressed (JPEG -> RAW -> DXT)? Then the CPU could be the limiting factor. Or the CPU-GPU bandwidth if the images are too large uncompressed...
    In principal it is possible, but you should calculate your bandwidth requirements first and see what your minimal target machine is capable of. (If you want to pre load, check that the GPU has enough RAM).

  3. #3
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264
    Quote Originally Posted by saam_b View Post
    Hi!

    I'm trying to load a series of image sequences in my openGL program to do further calculations on them in my shader. these image sequences will produce an animation. My question is if it is even possible to load these images in real time or should I pre-load them and then render them?

    and how can I load these amount of images on my texture memory? If someone can give me an example It will be great!

    Thanks in advance.
    Just like menzel said, it depends if your image file is compressed or not, it depends on HDD and CPU performance.
    If you can preload them, sure go ahead.

    As for performance tips, here you go
    http://www.opengl.org/wiki/Common_Mi...d_formats_.233

    so try to use

    glTexImage2D​(GL_TEXTURE_2D​, 0, GL_RGBA8​, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE​, pixels);
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2012
    Posts
    19
    Thanks for your replies!

    Actually my image sequences are in EXR format and they're quite large without compression and I'm now looking for the best way to resize and filter it on GPU. So I have to both load these images and resize them in order to make them usable in my program.

Posting Permissions

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