PDA

View Full Version : FBO's in Double Buffer for offscreen rendering?



wedge
01-15-2009, 07:16 AM
Is there a possibility to FBO's in Double Buffer modus for Off-Screen rendering or do I Have to implement it by myself?

I render a Texture in a 2nd Thread. The rendering my take longer so the Texture shows sometimes only a partly rendered Object. I dont't want to wait for this thread, so double Buffering.
The thread renders in “Back” Buffer and switches wen ready.

OK I know I can implemented by myself using 2 color attachments, changing drawbuffer end Texture by myself.
but than I have to use some sync and communication stuff :( ...

So is there a possibility to lat OpenGL FBO's the job?

Thx

Budric
01-15-2009, 11:07 AM
You have to call OpenGL commands from the thread that has initialized the context. Otherwise nothing openGL related will work. Unless you initialized 2 contexts somehow - I'd like to know how that's done as well in that case.

Chris Lux
01-19-2009, 05:37 AM
initialize two contexts to share resources (share lists). now you can render in two threads to two FBOs which after finishing the rendering can be used by the other thread. this works quite good here on nvidia hardware/drivers.

wedge
01-19-2009, 07:41 AM
You do not get the Point.

The 2 Threads are working nice.



now you can render in two threads to two FBOs which after finishing the rendering can be used by the other thread.

and this is the Point!
The seconds thread needs longer. So the FBO rendering is not Finished wen the main thread renders. I do _NOT_ want to wait with the main thread.
So is there any other usable and easier solution than using 2 FBOs and switching between them? Maybe with using only 1 FBO bat different color Buffers?