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

Thread: Combining Points into one VBO

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    11

    Combining Points into one VBO

    hi in my app, I've got many points. If I want to speedup rendering, the fastest way seems combining them together into one VBO (one vertex array for multiple points) and then draw them with one call. What is optimal size of that array, does have OpenGL problems with allocating too big arrays on GPU ?? I also really need to store those points in CPU.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    985
    You usually can assume that you can use an arbitrary large vertex buffer and it should be just fine. However, you should tell us how many points do you plan to have. Thousands? Millions? More?
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    11
    array od size 30k+ and not bigger than 500 000.

  4. #4
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264
    ------------------------------
    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);

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,129
    Quote Originally Posted by aqnuep
    You usually can assume that you can use an arbitrary large vertex buffer and it should be just fine.
    Incidentally, do you know if the proposed range of 1MB to 4MB still holds for buffers?

    Quote Originally Posted by phdr_hroch
    does have OpenGL problems with allocating too big arrays on GPU ??
    Yes and the GL will generate a GL_OUT_OF_MEMORY error if you try too allocate a buffer with an invalid size.

  6. #6
    Junior Member Newbie
    Join Date
    Jul 2012
    Posts
    11
    I can construct buffer anyway I want to.
    Thanks for answers

Tags for this Thread

Posting Permissions

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