Adding separate ofTextures into one?

Hey there! Long time lurker, first time poster :wink:
I’ve been messing around for quite some time with openFrameworks, but now I’ve run into something I don’t know how to solve…
I’ve got several ofTextures which I want to combine into one big texture but I’m at a loss.
I’ve got a number of camera’s hooked up which take pictures at intervals and the idea is to combine these pictures into a sort of collage on which I can then apply effects or use it as a texture on an object and whatnot.

I’ve been using ofPixels inside a separate thread to store the images from ofVideoGrabber. In my .cpp I load that into ofTextures like so: Tex0.loadData(thread.pixels0);

Is there a way to combine these ofTextures? Or do I need to use offbo and not oftexture? (I don’t see a way to do this loadData from ofPixels into ofFbo…?
(and I can’t use fbo inside the thread if I understand correctly since I should keep all openGL stuff in the main thread)

Looking forward to hear how you experts would handle it!


Yeah an fbo would be just the thing.

So you could allocate it to the size you want, then do:

Tex0.draw( upper left corner );
Tex1.draw( upper right corner );
etc, etc

Then you can draw the fbo, or grab it’s texture to pass along to a shader, etc etc.


Great stuff! I’ll try it out at once! Thanks. :smile: