Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Problem in blend texture to draw translucent line

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2011
    Posts
    1

    Problem in blend texture to draw translucent line

    I am trying to develop an 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 .
    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.glMatrixMode(GL10.GL_TEXTURE);
    gl.glEnable(GL10.GL_TEXTURE_2D);
    gl.glBlendFunc(GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA);
    gl.glColor4f(1, 1, 1, opacityValue);
    for (int x = 0; x < GLSurfaceView.mSpriteArray.size(); x++) {
    int
    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);
    }

    Thanks.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: Problem in blend texture to draw translucent line

    You can't. Well, not trivially, and not without some form of render to texture.

    First, you should probably say that you're using OpenGL ES 1.1 (which I assume because you are calling "glDrawTexfOES"). That pretty much limits your options to... I'm not sure what the options are for ES 1.1. This forum is primarily for desktop OpenGL; you may get better help on the Khronos OpenGL ES forums.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •