i have the need to do the following thing. I am working with a 2D engine called cocos2D-x. This engine draws the sprite of the game as textured quads.
Texture have alpha component. Pixels with alpha=255 (or 1.0f) are totally opaque, while pixels with alpha=0 are totally transparent.
I would like to add the following functionality: when drawing a sprite, i want to be able to
detect pixels that are contour pixels. A contour pixel is a pixel that is totally opaque and that it is adjacent to at least a totally transparent pixel. Once detected, i want to change its color in some ways.
First question: can this be done with OpenGL ES?
Second question: can someone show me a simple way to do this? Even a starting point would be really useful.
What concerns me is the possibility to access adjacent pixels, that is, given pixel at coordinates (x,y), i need to check 4-neighboring or 8-neighboring. For example, for 4-neighboring that means checking the alpha of the following pixels:
Third question: is OpenGL ES 2.0 in wide use or should avoid it? At my company we are writing a simple game for iPhone/Android platforms. While iPhone support 2.0 ES, i am wondering if Android phones are already there and if supporting OpenGL ES 2.0 is not a premature thing to do.