PDA

View Full Version : How can I copy a texture to another texture.



inlinevoid
11-06-2013, 12:01 PM
Google searches haven't given me much for what I'm trying to do, which I thought would be pretty basic.

I'm trying to copy various opengl textures into 1 larger opengl texture (to create an atlas). Assuming the source textures have the same format as the atlas itself, how would I copy them over?

This doesn't have to perform well as it's only done once at application startup, but I am restricted to OpenGL 4.0.

Dark Photon
11-06-2013, 05:17 PM
ARB_copy_image (https://www.opengl.org/registry/specs/ARB/copy_image.txt) / NV_copy_image (
http://developer.download.nvidia.com/opengl/specs/GL_NV_copy_image.txt). Or copy between textures with a PBO intermediary (see this (http://www.songho.ca/opengl/gl_pbo.html)). Or can bind to FBOs and use glBlitFramebuffer. And doubtless there are other ways.

inlinevoid
11-06-2013, 05:30 PM
Thanks, I'll look into those some more.