views:

73

answers:

2

Hi,

I am using off screen rendering using opengl FBO and glut on a MAC OS X 10.6. The program involves movement of multiple 3D objects.

The program seems to be working fine except that I am required to include an option where the off screen buffer contents are not swapped to the on screen buffer. Hence you do not see anything on the screen. I want to know if the program is working as it should be in this mode when nothing is seen on screen - ie 3D movements etc work fine as usual. Is there a utility that can read offscreen buffer and display it onscreen while my process runs separately.

Alternatively, are there other ways to achieve this? That is to hide the onscreen window while rendering offscreen using FBO.

Appreciate any comments/suggestions. I hope I am clear in my question.

A: 

I would copy the offscreen buffer onto a shared memory. Then, an external application reads continuosly the shared memory contents, updates a texture and display it on the screen.

That's it.

I've used it a lot, even with off-screen rendering, but I have not a handy example. :(

I would advice to store additional information at the beginning of the shared memory (width, height, pixel type, incremental integer to know whether the image has changed from the last read...). After this header, store the pixel data generated by you application, which size depends actually by width, height and pixel size.

I would also advice to use glReadPixels to store pixel data, passing the mapped shared memory as parameter. Remote application can use that data to update a texture.

Luca
Great answer. Any examples you know which use this technique? Appreciate it.
John Qualis
Let me try this out. Thanks again.
John Qualis
are there any examples available for offscreen rendering using glut/freeglut. i saw one with openglut but prefer to use freeglut. Any ideas?
John Qualis
A: 

gDEBugger for Mac should be able to display the FBO content with no additional effort on your side, at least the Windows version does so just fine. A 7 days trial version is available.

Malte Clasen
are there any examples available for offscreen rendering using glut/freeglut. i saw one with openglut but prefer to use freeglut. Any ideas?
John Qualis
@John Qualis FBOs do not depend on your GUI toolkit. Just take any FBO tutorial of your choice and it will work.
Malte Clasen