How to get texture data using textureID's in o

2019-01-23 12:10发布

I'm writing some code where all I have access to is a textureID to get access to the required texture. Is there any way that I can get access to the RGB values of this texture so I can perform some computations on it?

EDIT: I am looking for the inverse of glTexSubImage2D. I want to get the texture data rather than replace it.

1条回答
ゆ 、 Hurt°
2楼-- · 2019-01-23 12:29

You are probably looking for glGetTexImage (see https://www.khronos.org/opengl/wiki/GLAPI/glGetTexImage for further information).

Before using glGetTexImage, don't forget to use glBindTexture (https://www.khronos.org/opengl/wiki/GLAPI/glBindTexture) with your texture ID.

查看更多
登录 后发表回答