PDA

View Full Version : Picking objects without GL_ARB_framebuffer_object extension



lassesj
04-05-2013, 11:39 AM
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

aqnuep
04-05-2013, 02:25 PM
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.

earthbanana
04-07-2013, 09:09 AM
this might be a silly suggestion but have you tried using glGenFramebuffers(1, &FBO); insted of glGenRenderbuffers?

carsten neumann
04-07-2013, 11:04 AM
You could render the color picking image to the back buffer, but not swap buffers.

lassesj
04-08-2013, 02:40 PM
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?

carsten neumann
04-08-2013, 02:58 PM
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 (http://www.opengl.org/registry/specs/ARB/wgl_pbuffer.txt)? 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.

lassesj
04-09-2013, 01:11 PM
>>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 ...