开发者

Move texture data from one texture part into another part

开发者 https://www.devze.com 2023-02-16 20:30 出处:网络
Is it possible to move part of the texture into another texture part without performance hits? I l开发者_Go百科ooked into opengl SDK, but haven\'t found anything that could do something like this.glC

Is it possible to move part of the texture into another texture part without performance hits?

I l开发者_Go百科ooked into opengl SDK, but haven't found anything that could do something like this.


glCopyPixels lets you to copy from one framebuffer area into another (I never used it).

glBlitFramebuffer lets you to copy pixels between framebuffers

glCopyTexImage lets you to copy pixels from framebuffer into a texture

Using these function you can accomplish the task by, for example, the following actions:

  1. create FBO, attach texture-1 into the first color channel
  2. bind fbo, set viewport to contain the source area
  3. call glCopyTexSubImage into the texture-2 to get the contents
0

精彩评论

暂无评论...
验证码 换一张
取 消