Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

Is there anyway to copy images from one 3D texture to another?

This topic is 3598 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
Advertisement
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!