ExeEndine RenderTexture exception: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT

I developed an Android game that many people play. One user from 100-200 encounters an Exception, which I cannot understand.

I use RenderTexture , which throws the following Exception when trying to initialize it:

Fatal Exception: org.andengine.opengl.exception.RenderTextureInitializationException org.andengine.opengl.exception.GLFrameBufferException: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 

It works on 99% of all devices. The init method is as follows:

 public void init(final GLState pGLState) throws GLFrameBufferException, GLException { this.savePreviousFramebufferObjectID(pGLState); try { this.loadToHardware(pGLState); } catch (final IOException e) { /* Can not happen. */ } /* The texture to render to must not be bound. */ pGLState.bindTexture(0); /* Generate FBO. */ this.mFramebufferObjectID = pGLState.generateFramebuffer(); pGLState.bindFramebuffer(this.mFramebufferObjectID); /* Attach texture to FBO. */ GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, this.mHardwareTextureID, 0); try { pGLState.checkFramebufferStatus(); } catch (final GLException e) { this.destroy(pGLState); throw new RenderTextureInitializationException(e); } finally { this.restorePreviousFramebufferObjectID(pGLState); } this.mInitialized = true; } 

There seems to be something wrong with FrameBuffer-Status ...

Update

List of phones where the failure occurred:

 Sony - Sony Tablet S TCT - ALCATEL ONE TOUCH 5020A TCT - ALCATEL ONE TOUCH 6030N VNPT Technology - VNPT Technology Smart Box Q-Smart - S32 LGE - LG-E465g LGE - LG-D682TR LGE - LG-E451g LGE - LG-D686 LGE - LG-E470f HUAWEI - MediaPad 7 Youth unknown - Bliss Pad B9712KB samsung - GT-P5110 samsung - GT-I9505 samsung - Galaxy Nexus samsung - GT-P3110 samsung - GT-P5100 samsung - GT-P3100 samsung - GT-I9105P samsung - GT-I9082 samsung - GT-I9082L samsung - GT-I9152 samsung - GT-P3113 E1A - E1A LNV - LN1107 motorola - XT920 motorola - XT915 asus - ME172V 
+8
android opengl-es andengine
source share
1 answer

Based on the code you are attached to, it looks like you are trying to render an RGBA8888 texture. This is not always available on OpenGL ES 2.0 devices, as it refers to the time when most devices used 16-bit displays.

The only required formats in OpenGL ES 2.x are documented in the specification under the error code you get ...

RGBA8 targets are only available if this extension is open:

... therefore, I really like that some users use an older device with a GPU that does not expose this extension. To check if the extension is supported, use glGetString (see below) with GL_EXTENSIONS :

... and see if OES_rgb_rgba8 in this list. If this is not the case, then your only real option is to return to something else in the mandatory ES2.x format, such as RGB565 or RGB5_A1.

0
source share

All Articles