Is it possible to render 2 different framebuffer objects from 2 different threads in opengl

opengl

Or put in other words: Are different framebuffer objects different opengl contexts?

If so, I could render the different FBO's in different threads and pass them once they are rendered off-screen to the main thread that will actually draw them in the screen context. Is it possible?

Thanks

Best Answer

You can, if the two FBO were created in 2 different context.

However, compositing them together on screen in one window will require passing them back to software and then back to hardware in the window's context. This will be slower than just rendering them both in the main context on one thread.

You're better off focusing on getting the rendering into a single thread if it's going to be in one window, and putting your focus on threading elsewhere. Culling and physics are great places to thread (if you have those), but for rendering, one thread per context is the basic rule of thumb (and each window will pretty much mean one context).

Related Topic