how to unbind a texture which is attach to framebuffer as a rendertarget.

Started by
1 comment, last by 3TATUK2 10 years, 1 month ago

huh.png

in directx, if i set a rendertarget which is still bind as a shader resource texture, it will cause a render error.

so, if we want to use that surface as a rendertarget, we must unbind this texture, like directx api:

DX9->SetTexture(i, NULL);

i want to know, is there any same question in opengl, if i create a texture2d and attach to a framebuffer, and then render something on it.

next step i use this texture as a normal texture, if it is still bind when the next frame, is it cause any errors? may be cause glClear failure by Invalid Operation?

wub.png

Advertisement

As long as you don't use the texture to render to the framebuffer it's attached to, then you won't get any problems.

Basically the same thing, call glBindTexture / glFramebufferTexture2D with texture id value NULL

This topic is closed to new replies.

Advertisement