FBO, textures and MRT

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

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 on other sites
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 on other sites
When you changed the bound textures, did you also make sure to change glDrawBuffers()?

Share on other sites
glDrawBuffers determines what attachments will be bound for drawing.

1. 1
2. 2
Rutin
22
3. 3
4. 4
frob
17
5. 5

• 33
• 13
• 12
• 10
• 12
• Forum Statistics

• Total Topics
632575
• Total Posts
3007150

×