Split OpenGL buffer / rendering buffer between two applications

Let's say I have application A , the witch is responsible for drawing on the screen through the OpenGL library. For tight integration, I would like to let this application A do its job, but render it in FBO or directly in the rendering buffer and allow application B have read - only access to this buffer handles the display on the screen (basically it's like a 2D texture) .

It seems that FBOs refers to OpenGL contexts, and contexts are not shared between processes. I definitely understand that resolving multiple processes in which there is a mess with the same context is evil. But in my particular case, I find it reasonable to think that it can be pretty safe.

NOTE:

Appendix A is QApplication , and Appendix B is native win32 one

EDIT:

The rendering size is close to full-screen mode, I was thinking about the 2048x2048 32bits buffer (until I use the alpha channel, but why not the last one).

+8
c ++ windows qt opengl
source share
2 answers

Framebuffer objects cannot be shared between OpenGL contexts, whether they belong to the same process or not. But textures can be separated, and textures can be used as a color buffer binding to framebuffer objects.

Exchange OpenGL contexts between processes that are truly possible if the graphics system provides an API for this task. With X11 / GLX, indirect rendering contexts can be shared between multiple processes. This is possible on Windows using some really, really raw hacks. MacOS X, I don’t know how to do it.

So, what’s probably the easiest way is to use the Pixel Buffer object to gain access to the rendering. Then send it to another application via shared memory and load the texture into it (again through the pixel buffer object).

+3
source share

In my understanding, you cannot exchange objects between a process under Windows, unless it is an object of kernel mode. Even common textures and contexts can create performance images, and also provide additional responsibility for synchronizing SwapBuffer () calls. Especially within the Windows platform, the OpenGL implementation is well known.

In my opinion, you can relay interprocess communication mechanisms, such as Events, mutex, window messages, pipe to render synchronization. but just understand that there is a consideration for performance when approaching this path. Kernel mode objects are good, but switching to the kernel each time has a cost of 100 ms. It's damn expensive for a high performance application. In my opinion, you should review the design of the rendering of several processes.

0
source share

All Articles