BЈовић
BЈовић

Reputation: 64273

Move texture data from one texture part into another part

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

I looked into opengl SDK, but haven't found anything that could do something like this.

Upvotes: 0

Views: 274

Answers (1)

kvark
kvark

Reputation: 5361

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

Upvotes: 2

Related Questions