I should have explained the problem a bit better 
So I’m developing a kind-of drawing app on the iPad. I have a class called Brush.h
, which I’m simplifying here but basically it contains an FBO that uses ofMesh and ofShader to make a drawing.
Every time a user touches the screen, a new instance of Brush is pushed_back into my vector which holds all the Brushes, while the user has their finger down they can manipulate, draw, etc and then they’re done. Next time they put their finger down a new Brush is instantiated and pushed back into the vector, etc.
And then of course in my ofApp I’m updating all my Brushes and drawing them. Some of the brush algorithms depending on type are dynamic and update over time, some of them don’t etc. It’s probably ok if I make them all static and once they’re done drawing, the mesh etc is frozen, ie, the FBO has all the info I need.
It all works find till I run into the limit of 34 Brushes/34 FBOs that are being drawn from the ofApp.
So I was wondering if there was a way to combine these FBOs as they’re being formed into a final FBO (this only works if all the FBOs are static, of course). I know I can do something like this:
//ofApp.cpp
void ofApp::update(){
finalFbo.begin();
if (bToClear) ofClear(255); //this is when the app starts, or if I'm clearing the screen otherwise stack on top.
lastBrush.draw();
finalFbo.end();
void ofApp::draw(){
finalFbo.draw(0, 0);
}
This is considering that there’s no vector<Brushes>
holding all my FBOs but I’m just stacking them up at every TouchUp()
event - but I was wondering if there were some other options to consider. If somehow I could keep the dynamic ones as is, that would be even better.
I think I cannot avoid FBOs altogether from the Brush class as they’re going through two shaders to do some shading and blurring etc which I’d be hard pressed to do without passing them through FBOs.