Very simple setup with one fbo called test:
//clear with a black color non transparent
test.begin(); ofClear(0,0,0,255); test.end();
I would expect a blue fbo with a yellow rectangle. However I end up with a yellow rectangle on a black background. Why? What am I missing? Drawing directly to screen instead of the Fbo works as expected.
Just noticed the thread as well which might be related: http://forum.openframeworks.cc/t/what-does-ofclear-do/10428/0
after line 09 try adding
ofSetColor(255, 255, 255, 255);
- but looking over this again it does seem a little strange.
going to test this.
ofSetColor(255, 255, 255);
This works for me.
So the reason you were getting black is that you were drawing the fbo with the current color being:
255,255,0 ( yellow )
The FBO background is blue ( 0, 0, 255 ), so when multiplied, the 0 in the blue channel of the yellow draw color, cancels out the blue in the background all together - leaving you with black.
As a general rule you should always do ofSetColor(255, 255, 255);
before drawing an FBO, unless your intentionally wishing to draw it with a tint.
Hope that helps!
Thanks for clearing that up, Theo!