gpt4 book ai didi

android - 将数据从一个纹理复制到另一个 - opengl

转载 作者:行者123 更新时间:2023-11-29 01:34:48 25 4
gpt4 key购买 nike

我在 SurfaceTexure 上用 android 渲染我的相机预览。此 SurfaceTexture 绑定(bind)到目标 GL_TEXTURE_EXTERNAL_OES。我想将此 SurfaceTexture 对象的纹理数据复制到绑定(bind)到 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
}
});
}

我已经创建了自定义纹理对象。

有人可以帮我复制吗?

最佳答案

通常的方法是将颜色附件处的纹理绑定(bind)到 FBO,选择该 FBO 为 Activity 并使用 glCopyTexImage 从 FBO 复制到目标纹理。

关于android - 将数据从一个纹理复制到另一个 - opengl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29012456/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com