Share OpenGL frame buffer / render buffer between two applications?

Framebuffer Objects can not be shared between OpenGL contexts, be it that they belong to the same process or not. But textures can be shared and textures can be used as color buffer attachment to a framebuffer objects.

Framebuffer Objects can not be shared between OpenGL contexts, be it that they belong to the same process or not. But textures can be shared and textures can be used as color buffer attachment to a framebuffer objects. Sharing OpenGL contexts between processes it actually possible if the graphics system provides the API for this job.In the case of X11/GLX it is possible to share indirect rendering contexts between multiple processes.

It may be possible in Windows by emplyoing a few really, really crude hacks. MacOS X, no idea how to do this.So what's probably the easiest to do is using a Pixel Buffer Object to gain performant access to the rendered picture. Then send it over to the other application through shared memory and upload it into a texture there (again through pixel buffer object).

I tried that already, and I faced performance issue (A can provide near full screen texture ...). That's why I ask for in memory card memory sharing. – vrince Jun 17 at 14:36 1 Well, you'd have to share the OpenGL context across processes, which is actually possible if you lift some of the protections between the processes.

However may I ask how you upload your texture? GlTexImage2D or glTexSubImage2D? The later is faster by several orders of magnitude.

– datenwolf Jun 17 at 15:02 Really? I actually use glTexImage2D ... I will dig into this! – vrince Jun 17 at 15:23 +1 I've used shared memory in these cases, and it is very performant.At high rate it may be necessary a mutex for synchromization.

– Luca Piccioni Jun 17 at 15:35 I have to say it make a difference ... :) should be basic stuff for you but thanks for this tips! Sounds fair in my case to do it that way ... A little disappointed thought to have to go out of the memory card ... – vrince Jun 17 at 16:14.

In my understanding, you won't be able to share the objects between the process under Windows, unless it's a kernel mode object. Even the shared textures and contexts can create performance hits also it has give you the additional responsibility of syncing the SwapBuffer() calls. Especially under windows platform the OpenGL implementation is notorious.In my opinion, you can relay on inter-process communication mechanisms like Events, mutex, window messages, pipes to sync the rendering.

But just realize that there's a performance consideration on approaching in this way. Kernel mode objects are good but the transition to kernel each time has a cost of 100ms. Which is damns costly for a high performance rendering application.

In my opinion you have to reconsider the multi-process rendering design.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions