I am trying to create 2D android game using openGL ES 2. On most phones this works fine, but one older phone (Huawei P20 lite) shows black rectangles instead of textures. The problem seems to be with size of the texture atlas image. I tried to scale it step by step to see what is the maximum image size that can be loaded and it ended up being 2420x2420 px. Texture image smaller than this, everything loads OK and textures are shown as expected. With size greater, i see only black rectangles. When checking MAX_TEXTURE_SIZE with glGetIntegerv it says 8192. Also on other old phones it works fine with even 3000x3000 textures image.

code to load texture:

Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.carback4);
GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, b, 0);

You must log in to answer this question.

Browse other questions tagged .