FBO's in Double Buffer for offscreen rendering?

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 :frowning:

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

Thx

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.

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.

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?