I am programming a small drawing app on the iphone and ran into a problem. When i merge two fbos the color becomes white instead merging. Look at the picture:
http://dl.dropbox.com/u/2025544/help.png
Here the left is rendered as a normal mac program and the right is rendered on the iPhone platform with almost the same code except for using the eos version of the fbo.
Drawing multiple FBOs on top of each other creates the alpha blending i want:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
myTex.draw(0, 0);
for(int client = 0; client < 5;client++)
{
ofSetColor(
datas[client]->myColor.r,
datas[client]->myColor.g,
datas[client]->myColor.b,
datas[client]->myColor.a
);
datas[client]->myTex.draw(0,0);
}
Merging the two fbos gives med the wrong alpha:
myTex.begin();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
ofSetColor(
datas[tmpMessage->clientId]->myColor.r,
datas[tmpMessage->clientId]->myColor.g,
datas[tmpMessage->clientId]->myColor.b,
datas[tmpMessage->clientId]->myColor.a
);
datas[tmpMessage->clientId]->myTex.draw(0, 0);
myTex.end();
datas[tmpMessage->clientId]->myTex.clear(0, 0, 0, 0);
datas[tmpMessage->clientId]->touchDown = true;
Please help i am going crazy :-)