Jump to content
  • Advertisement
Sign in to follow this  

Duplicate a texture

This topic is 3405 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

I have a texture blurring class. What it does is it maintains an fbo that has two textures two do horizontal and vertical blur. To blur a texture, the input texture is put into a fullscreen quad, put through glsl on the framebuffer on texture 0. Then texture 0 is plugged back in, this time doing blur in the perpendicular direction. To return the newly blurred texture, I simply return the texture object from the fbo. However, I'd like to be able to blur multiple textures with the same blurrer object. This probably involves duplicating the fbo texture, because I'm pretty sure that if I try to do this, this will happen: 1) I blur a texture and store it in fbo (we'll call the fbo bob) 2) I blur a second texture and also store it in bob, in effect clearing the previously blurred texture. What I need to be able to do is create a texture object and then release it when I'm done with it. I don't want to have to have a seperate blurrer for every texture. Or is this impossible? (I'm trying to implement PSSM with VSM). EDIT: The only way I can think of is creating another fbo on the fly and deleting it along with the texture later. Maybe it just makes more sense to have a blurrer class for each seperate texture?

Share this post


Link to post
Share on other sites
Advertisement
But I'll have to create a seperate framebuffer object anyways.

I think its easier just to have multiple blurring objects.

Maybe I could disassociate the blurred texture from the frame buffer, and create new texture objects? Then delete the disassociated texture?

Because I don't really need to duplicate, I just need it not to overwrite.

Is it ok to do this every single frame though?

I think the best solution is probably just to use multiple blurring objects though.

I was just wondering if there was a simple operation that allowed one to copy VRAM texture data.

Share this post


Link to post
Share on other sites
Yes, you can attach any texture to the FBO you want but the previous one gets dettached automatically.

Quote:
Is it ok to do this every single frame though?

I don't think it is a problem if you are talking about 1 FBO.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!