Is there anyway to copy images from one 3D texture to another?
Is there anything like memcpy() for copying a 3D texture slice to another 3D texture slice?
What I have is a mapeditor that has a texture array that holds however many textures the user puts in the texture directory. Now I only want to access at the most 16 at a time. So I thought of creating a second 3D texture that holds only 16 textures and copying over the selected textures...
Hi MARS_999
I've been reading about 3D textures recently, they are quite cool indeed.
But for what you need I can only suggest that you keep a copy in system memory and update it accordingly (quicker than disk i/o for all slices) - then glDeleteTextures() and recreate again with glTexImage3D()
I guess you realize this will effect your current map edits :)
Then again, perhaps there is another way, similar to VBOs? In which case consider my reply as just a bump!
I've been reading about 3D textures recently, they are quite cool indeed.
But for what you need I can only suggest that you keep a copy in system memory and update it accordingly (quicker than disk i/o for all slices) - then glDeleteTextures() and recreate again with glTexImage3D()
I guess you realize this will effect your current map edits :)
Then again, perhaps there is another way, similar to VBOs? In which case consider my reply as just a bump!
Hey Jezham, been awhile! Yeah, I am not sure what I am going to do as of now. It's been put on the back burner for awhile as I work on a few other headaches first.
Yes, it should be possible with GL_EXT_framebuffer_blit and GL_EXT_framebuffer_object although I have never tried it.
You would bind one FBO with
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fboID1);
and another FBO with
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fboID2);
and then blit
glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1,
int dstX0, int dstY0, int dstX1, int dstY1,
bitfield mask, enum filter);
http://www.opengl.org/wiki/index.php/OpenGL_extensions#Framebuffer_related_extensions
You would bind one FBO with
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, fboID1);
and another FBO with
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, fboID2);
and then blit
glBlitFramebufferEXT(int srcX0, int srcY0, int srcX1, int srcY1,
int dstX0, int dstY0, int dstX1, int dstY1,
bitfield mask, enum filter);
http://www.opengl.org/wiki/index.php/OpenGL_extensions#Framebuffer_related_extensions
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement