View Full Version : Problem in blend texture to draw translucent line

12-25-2011, 11:09 PM
I am trying to develop an android drawing app.In this app I am using texture to draw.
I want to draw translucent texture one over another to get continuous translucent line but I am only able to get this https://lh5.googleusercontent.com/-zaWuS1yTIZo/TvgInuyWb_I/AAAAAAAADUw/ZOeIkwMmkCg/s640/Untitled.jpg
As you can see in part B circular translucent textures appear one over other. I want line to appear as in part A.
I am adding information of texture drawing like width,height,x&y coordinate in ArrayList spriteArray.
The blending function used is- gl.glBlendFunc(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);
To set opacity of texture-gl.glColor4f(1, 1, 1, opacityValue);

I have also used gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);it does not work either.

Any help to solve this problem will be appreciated.
If you need more information please tell me.

drawFrame code:

gl.glColor4f(1, 1, 1, opacityValue);
for (int x = 0; x < GLSurfaceView.mSpriteArray.size(); x++) {
mTextureName=GLSurfaceView.mSpriteArray.get(x).tex tureName;
gl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureName);

// Draw using the DrawTexture extension.
((GL11Ext) gl).glDrawTexfOES(x, y, 0, width, height);