I'm experimenting with the Cocos2d HTML5 framework but believe this is a standard WebGL problem I cannot pinpoint as I don't have good knowledge on the topic. If I have a standard PNG image with semi-transparent pixels such as soft edges, and if the background (canvas or other element behind RenderTexture) is filled with a non-black color, the sprite when drawn to the RenderTexture ends up soaking in the background even when it shouldn't. For instance, if the graphic I'm drawing is red and I use a green background, the translucent pixels eventually morph to yellow. See these pictures for illustration:
Appearance when against a solid black background, this is what I desire
Appearance against a non-black background, with the bg bleeding through
Whatever is in the background will show through when I place any non-100% opaque image.
The full JavaScript-based RenderTexture class code can be seen on the cocos2d-html5 Github Repository under cocos2d/misc_nodes/CCRenderTexture.js. It is a conversion from Cocos2d-x C++ / Objective C (which do not exhibit this problem). There was a reported issue #937 on cocosd-iphone issue tracker describing the same problem for the non-HTML version several years ago. It was since resolved but I can't seem to determine what the resolution was or how it could be translated to the WebGL format. I'm sure it's a blend issue, but I have tried changing the blend modes (from GL_ONE, GL_ONE_MINUS_SRC_ALPHA to GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA and others) to no avail.
Any help from OpenGL / WebGL experts would be much appreciated. If I use the standard "sprites" in Cocos2d outside of this RenderTexture the problem does not exist. Also, the MotionStreak functionality seems to work without fault too, but I require RenderTexture to create dynamic textures for further use.