Why doesn't OpenGL mix work on HTC Desire?

Does anyone know how to enable blending in OpenGL (android) on HTC Desire. I am trying to draw colored triangles and use the alpha value of the color buffer to blend them with the background (or another triangle).

It works both on emulator (2.1) and on htc hero 2.1, but not on my desire since 2.2. Is there a difference in equipment between the hero and the desire that causes this?

The main material from the code (not in order):

gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

gl.glEnable(GL10.GL_BLEND);         
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);

private final static float[] colors = {
       1f, 0f, 0f, 0.5f, // point 0 red
       1f, 0f, 0f, 0.5f, // point 1 red
       1f, 0f, 0f, 0.5f, // point 2 red
       1f, 0f, 0f, 0.5f, // point 3 red

       1f, 0f, 0f, 0.5f, // point 4 red
       1f, 0f, 0f, 0.5f, // point 5 red
       1f, 0f, 0f, 0.5f, // point 6 red
       1f, 0f, 0f, 0.5f, // point 7 red
};

PS. I can provide more code if someone needs it ...

+5
source share
1 answer

, , , . OpenGL ES 1.1.12 The value of A produced by lighting is the alpha value associated with dcm, dcm - .

COLOR_MATERIAL, . , , .

COLROR_MATERIAL ( ), glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, ptrTo4Floats). , , .

+3

All Articles