I want implement off-screen Anti-aliasing.
First init Texture and FBO :
int[] textures = new int[1];
GLES31.glGenTextures(1,textures,0);
textureFBO.handle = textures[0];
GLES31.glActiveTexture(GLES31.GL_TEXTURE0);
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D_MULTISAMPLE,textures[0]);
GLES31.glTexStorage2DMultisample(GLES31.GL_TEXTURE_2D_MULTISAMPLE,4, GLES31.GL_RGBA8, frameWidth, frameHeight, false);
...
int[] frameBuffers = new int[1];
GLES31.glGenFramebuffers(1, frameBuffers,0);
GLES31.glFramebufferTexture2D(GLES30.GL_FRAMEBUFFER, GLES31.GL_COLOR_ATTACHMENT0,GLES31.GL_TEXTURE_2D_MULTISAMPLE, textureFBO.handle, 0);
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D_MULTISAMPLE, 0);
Then render to FBO :
GLES31.glBindFramebuffer(GLES31.GL_FRAMEBUFFER, frameBuffers[0]);
...
GLES31.glActiveTexture(GLES31.GL_TEXTURE0);
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D, glTextureOriginal.handle);
GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, 4);
Finally, sample multiTexture, render it to FBO0
GLES31.glBindFramebuffer(GLES31.GL_FRAMEBUFFER, 0);
...
GLES31.glActiveTexture(GLES31.GL_TEXTURE0);
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D_MULTISAMPLE, textureFBO.handle);
GLES31.glDrawArrays(GLES31.GL_TRIANGLE_STRIP, 0, 4);
But the render result is black.
If i replace glTexStorage2DMultisample() using glTexStorage2D(), it works fine.