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

  1. #1
    Intern Contributor
    Join Date
    Jun 2001
    Posts
    76

    glSelectBuffer

    How can I determine the exact size of the selection buffer that I need to
    pass to the function glSelectBuffer?

    I've seen in many demos that people just pick an arbitrary number like 64,
    256, or 512. But this is prone to error, so I do not want to do it this way.

    I thought at first the size related to the number of names I assign with LoadNames,
    so if I want to select 5 objects, I would create a selection buffer that is
    5*sizeof(UINT). But this is not correct as the number of hits returned is
    always -1, indicating an overflow.

    So, how do I determine its correct size based on the geometry that I want to
    select?

  2. #2
    Intern Contributor
    Join Date
    Jun 2001
    Posts
    76

    Re: glSelectBuffer

    The reason why I am asking is that I have geometry that is changing
    (num_vertices, num_faces, etc..), so I would like to choose an
    appropriate selection buffer size every time it changes.

    Any thoughts?

  3. #3
    Intern Contributor
    Join Date
    Jun 2001
    Posts
    76

    Re: glSelectBuffer

    Is this possible? Nothing in the Red book, or any other OpenGL book I know of
    explains how this works in detail.

    All I can do right now is guess.

  4. #4
    Junior Member Regular Contributor
    Join Date
    Dec 2000
    Location
    Computer Graphics Group, RWTH Aachen, Germany
    Posts
    137

    Re: glSelectBuffer

    Hi
    It depends on your application. I for example use 64K ints buffer - quite big, but the user sometimes wants to select many objects ( 500-600 control points or triangles) at once. For normal scenes I think you need not more than 10K. So it is your decision. It also depends if you use hierachical or just simple selection.
    Hope this helps
    Martin
    (By the way - the memory today is cheap, and I think 64K system memory is nothing compared to the vertices and textures caches and so on... )

  5. #5
    Intern Contributor
    Join Date
    Jun 2001
    Posts
    76

    Re: glSelectBuffer

    So, regardless of your scene, you use a fixed-size buffer?

    Does using a huge buffer like 64k affect performance? Does OpenGL ever walk through
    the entire buffer memory (to clear it for example) or does it only access the buffer
    to write values to it? I would think the latter.

Posting Permissions

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