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

Thread: Picking objects without GL_ARB_framebuffer_object extension

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2013
    Posts
    6

    Picking objects without GL_ARB_framebuffer_object extension

    Hi,

    I have created a 3d viewer and i use color picking via FBO. Some computers fails to do the picking, with the error:

    "Unable to find an entry point named 'glGenRenderbuffers' in DLL 'opengl32.dll'."

    To get around this, i check if FBO (extension GL_ARB_framebuffer_object) is available. If not, I want to do picking another way...

    I have read that ray tracing is a viable way. However my objects in the scene can have MANY triangles, and doing a line-triangle hittest on many triangles will be slow at best.

    What are my options?

    Thanks

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    989
    You probably anyways have some space partitioning system setup (e.g. BVHs = Bounding Volume Hierarchies), if not, you probably need one anyways if you want your viewer to be scalable.
    You can use your space partitioning system as an acceleration structure for your ray casting code. This way the coarse tests will get rid of most of the triangles you have to test against.
    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
    Mar 2013
    Posts
    5
    this might be a silly suggestion but have you tried using glGenFramebuffers(1, &FBO); insted of glGenRenderbuffers?

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    894
    You could render the color picking image to the back buffer, but not swap buffers.

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2013
    Posts
    6
    Hi all, thanks for the replies.

    >>aqnuep

    All my objects are always within frustrum so BVHs does not help me render faster and i have therefore not implemented it. However, could be an idea for speeding up ray tracing. Nonetheless, I would prefer a simpler solution if one is available.

    >>earthbanana

    The extension is not available, so trying an overload will not help me :-(

    >>carsten neumann

    Is it possible to extract pixel information from the back buffer?



    What about pixel buffers, would that work in my situation?

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    894
    Is it possible to extract pixel information from the back buffer?
    Yes, glReadPixels() reads from the current read buffer, which can be GL_BACK. What are you using to get at the pixel information in the FBO attachment?

    With pixel buffers do you mean WGL_pbuffer? AFAIK those were the predecessor to FBOs, but less flexible. I don't know the differences/limitations in detail or if they matter for your use case, my completely gut based feeling would be that you probably can use pbuffers.

  7. #7
    Junior Member Newbie
    Join Date
    Jan 2013
    Posts
    6

    Made it work with backbuffer

    >>carsten neumann

    When getting the error i have not started to set pixel information. The error is when calling glGenRenderbuffers (error states that function it is not found in opengl32.dll).

    I made the backbuffer work on my local machine, thanks. I will let you know the outcome on my clients computer. Seems that using the backbuffer is more generic instead of FBO ...

Posting Permissions

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