Hi all,
I’m using the incredible ofxBezierWarp to warp my videos. It works perfectly well until I use setAlphaMask() on my fbo. (I got masks to work as well as warping the video. Only using both together stops working and gives me no image at all.)
Setting of mask (works without warping)
mask.setImageType(OF_IMAGE_COLOR_ALPHA);
mask.getTexture().setSwizzle(GL_TEXTURE_SWIZZLE_A, GL_RED);
fbo.getTexture().setAlphaMask(mask.getTexture());
Warping video (works without mask)
if (bDoWarp) {
ofTranslate(x, y);
ofScale(w / fbo.getWidth(), h / fbo.getHeight());
ofTexture & fboTex = fbo.getTexture();
// upload the bezier control points to the map surface
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, numXPoints, 0, 1, numXPoints * 3, numYPoints, &(cntrlPoints[0]));
fboTex.bind();
glMatrixMode(GL_TEXTURE);
glPushMatrix();
glLoadIdentity();
glScalef(fboTex.getWidth(), fboTex.getHeight(), 1.0f);
glMatrixMode(GL_MODELVIEW);
glEvalMesh2(GL_FILL, 0, gridDivX, 0, gridDivY);
fboTex.unbind();
glMatrixMode(GL_TEXTURE);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
} else {
fbo.draw(x, y, w, h);
}
I also tried using setAlphaMask() on the ofTexture, before I I bind it - same result. I’d prefer to not use multiple fbos (which I did successfully before, but was not very efficient). If someone can help me to get transparency working in the GL stuff, I’d be happy…
thanks and have a great day!
oe