OpenGLES mix and match blending options complicated question
Posted
by DevDevDev
on Stack Overflow
See other posts from Stack Overflow
or by DevDevDev
Published on 2010-03-24T21:05:52Z
Indexed on
2010/03/24
21:33 UTC
Read the original article
Hit count: 427
So I have a background line drawing, black and white. I want to be able to draw over this, keeping the black lines in there, and drawing only where it is white. I can do this by using
glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA);
And the black stays black and white gets whatever color I want. However in the white areas, I want to be able to draw some color, pick to another color and then blend. However this doesn't work because the blend function is messed up.
So what I was thinking is having a linedrawing framebuffer, and a user-drawing framebuffer. The user draws into the userdrawing framebuffer, with a different blending, and then I switch blending options and draw into the linedrawing framebuffer. But i don't know enough OpenGL to say whether or not this will work or is a stupid idea.
Thanks a lot
© Stack Overflow or respective owner