glBlend y efecto extraño para geometría superpuesta
Frecuentes
Visto 62 equipos
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?
Gracias de antemano.
1 Respuestas
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.
contestado el 28 de mayo de 14 a las 15:05
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas opengl-es or haz tu propia pregunta.
try disabling DepthTest - Abhishek Bansal