Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  
db123

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

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

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

Share this post


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

Edited by Xycaleth

Share this post


Link to post
Share on other sites

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

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!