Is better to run FBO in update OR draw?

So.

i´ve been asking my self, supposed i have this :

ofClear(0, 0, 0, 0);
	fbo.begin();
	sh.begin();
	ofRect(0, 0, ofGetWidth(), ofGetHeight());
	sh.end();
	fbo.end();

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 :slight_smile: 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?