I need some help figuring out what i do wrong when i try to create a framebuffer OES.
outTex = new int[1];
GLES20.glGenTextures(2, outTex, 0);
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, outTex[0]);
GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexImage2D(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
0,
GLES11Ext.GL_RGBA8_OES,
vp.width,
vp.height,
0,
GLES11Ext.GL_RGBA8_OES,
GLES20.GL_UNSIGNED_BYTE,
null);
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, 0);
fbo = new int[1];
GLES11Ext.glGenFramebuffersOES(1, fbo, 0);
GLES11Ext.glBindFramebufferOES(GLES11Ext.GL_FRAMEBUFFER_OES, fbo[0]);
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, outTex[0]);
GLES11Ext.glFramebufferTexture2DOES(
GLES11Ext.GL_FRAMEBUFFER_OES,
GLES11Ext.GL_COLOR_ATTACHMENT0_OES,
GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
outTex[0],
0
);
int status = GLES11Ext.glCheckFramebufferStatusOES(GLES11Ext.GL_FRAMEBUFFER_OES);
if (status != GLES11Ext.GL_FRAMEBUFFER_COMPLETE_OES) {
throw new RuntimeException("Framebuffer is not complete: " +
Integer.toHexString(status));
}
GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, 0);
GLES11Ext.glBindFramebufferOES(GLES11Ext.GL_FRAMEBUFFER_OES, 0);
The status i get is 36055 and i have no clue why it is incomplete. For more information, the thing i want to do looks like this:
I want to use an external OES texture (from media player), lets call it tex0, in the next pipeline: tex0 -> GPU process -> (using a framebuffer) results tex1. tex1 must be also GL_TEXTURE_EXTERNAL_OES.
I have tried and succeded to use a TEXTURE_2D binded to the framebuffer and everthing worked using normal a framebuffer.
So i need some help either with what i did wrong in my code or with finding another way (maybe using a normal framebuffer) to obtain a TEXTURE EXTERNAL OES from the GPU.
Thank you very much.