Jump to content
  • Advertisement
Sign in to follow this  
dz4

FBO, textures and MRT

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

Hi,

I'm having several troubles with FBO use and textures attached to them.

1) I first have an FBO with two binded textures. After a draw into it, I'd want to use the same FBO but with only one texture bound. How can I unbound the second one ? Is it ok to just call
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, 0, 0)

I've tried this but it seems that the glClear() still affects the two textures.
(observed with REMEDY gDebugger)

2) I want to reuse the same FBO but with others textures attached. Is that enough to bound new textures using glFramebufferTexture2DEXT() or is there something to do to unbound previous textures properly ?
After a try it seems that the first textures memory is erased once new ones are bound (I observed that they turned to black on gDebugger, but maybe this is a bug or misunderstanding of the software).

Thanks a lot for help.

Share this post


Link to post
Share on other sites
Advertisement
You seem to have the right idea, I'm not sure why it's giving you problems. The red book has to say about glFramebufferTexture2D:


If texture is zero, indicating that any texture bound to attachment is released, and no subsequent bind to attachment is made. In this case, texturetarget, level, and layer are ignored.
[/quote]

I believe you can just call glFramebufferTexture2D to unattach or reattach a different texture. Perhaps your error is elsewhere.

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!