Question

I faced a visual artifact, when launched my game on Kndle Fire (android 2.3.4): there are gray squares around my particles.
The code works well on iOS and Nexus!
Moreover, the screenshots look correct when taken by ddms (that's the only way to take screenshots from Kindle Fire)!!!

Here are both wrong and correct sreenshots:

enter image description here

Here is my GL setup code:

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

glLineWidth(1.5);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);

glDisable(GL_NORMALIZE);
glDisable(GL_CULL_FACE);
glShadeModel(GL_FLAT); 

float alpha_ref = 1 / 255.f;
glAlphaFunc(GL_GEQUAL, alpha_ref);

glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gFilter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gFilter);

glDisable(GL_TEXTURE_2D); // will be enabled later when texture set!

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

glFrontFace(GL_CW);
float fZero[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, fZero);
glColor4ub(255, 255, 255, 255);

I'll appreciate any suggestion!

Was it helpful?

Solution

Finally found the hint here: https://legacy.madewithmarmalade.com/ru/node/57184

So, the answer is to comment color depth requirements in GLES settings:

 const EGLint attribs[] = {
        EGL_SURFACE_TYPE, EGL_WINDOW_BIT, 
        /*EGL_BLUE_SIZE, 8,*/  
        /*EGL_GREEN_SIZE, 8,*/  
        /*EGL_RED_SIZE, 8,*/
        EGL_NONE
 };
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top