0

Suppose I have two squares which have the same y value and which partially overlap in the xz plane. I want to use alpha blending,

    GLES20.glEnable(GLES20.GL_BLEND);
    GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);

so that parts of the textures mapped to the square geometry are transparent (depending on what the alpha values are)

However, because the y values are the some, when rendering there are strange visual effects (all I can describe the effect as is "shredded" looking or in some cases one texture obscures the other).

If I "separate" the two squares so that the y values are 0 and 0.1, this effect goes away. Is there anything I can do to stop this from happening without having to "separate" the squares?

Thanks in advance.

1

1 Answer 1

0

In case others are having the same problem, the following worked for me:

        GLES20.glDisable(GLES20.GL_DEPTH_TEST);
        // draw here...
        GLES20.glEnable(GLES20.GL_DEPTH_TEST);

Easy once you know.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.