Copying data from one texture to another
I'm rendering my camera preview in android on a SurfaceTexure . This SurfaceTexture is bound to target GL_TEXTURE_EXTERNAL_OES . I want to copy the texture data from this SurfaceTexture object to my custom OpenGL texture which is bound to GL_TEXTURE_2D .
My onFrameAvailable callback is as follows :
@Override
public void onFrameAvailable(final SurfaceTexture surfaceTexture) {
glView.queueEvent(new Runnable() {
@Override
public void run() {
surfaceTexture.updateTexImage();
//TODO: Copy this texture to the custom texture
}
});
}
I have the custom texture object created already.
Can anyone help me with the copying part ?
通常的做法是将颜色附件中的纹理绑定到FBO,选择该FBO作为活动并使用glCopyTexImage从FBO复制到目标纹理中。
链接地址: http://www.djcxy.com/p/33886.html上一篇: 在OpenGL中更改纹理不透明度
下一篇: 将数据从一个纹理复制到另一个纹理
