将数据从一个纹理复制到另一个纹理
我在SurfaceTexure
上在android中渲染我的相机预览。 这个SurfaceTexture
绑定目标GL_TEXTURE_EXTERNAL_OES
。 我想将这个SurfaceTexture
对象的纹理数据复制到绑定到GL_TEXTURE_2D
自定义OpenGL纹理上。
我的onFrameAvailable回调如下:
@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
}
});
}
我已经创建了自定义纹理对象。
任何人都可以帮我复制部分?
通常的做法是将颜色附件中的纹理绑定到FBO,选择该FBO作为活动并使用glCopyTexImage从FBO复制到目标纹理中。
链接地址: http://www.djcxy.com/p/33885.html