i´ve been asking my self, supposed i have this :
ofClear(0, 0, 0, 0);
ofRect(0, 0, ofGetWidth(), ofGetHeight());
This all that it does is run a fragment shader
So,what would be more efficient? Run this code on the update or in the draw function?
i´ve seen some examples that runs it in the update and other in the draw.
you will probably have a hard time finding a measurable difference between update or draw
personally I use draw
I tend to use all calculations inside update and draw inside draw. In your case i would use your code inside update and fbo.draw() inside draw function.
and… what if the fbo must be updated (begin/end) on every frame? can be this situation when it’s the same to run in update/draw?
That’s why update() function is there just inside update() function use fbo.begin()/end() and inside draw() function use fbo.draw();
I guess it starts making a difference if the FBO is in update and vertical sync is switched off?
Ok , so I supposed there is no real consensus. I thought there was like a way that this was supposed to be implemented. I just keep it in the update function for now. It makes my code easyer to understand. haha