Watch your texture bindings when using FBO attachments

I finally tracked down why the second "shadow" demo had regressed for OpenGLContext on AMD cards.  Turns out that the order in which you bind/unbind textures and Frame Buffer Objects is very important.  If you have a texture bound as the current TEXTURE_2D at the same time as it is attached to an FBO attachment the results are undefined, where undefined means you get nasty moire-like patterns in your shadows.  Annoying this is that it's not enough to just disable TEXTURE_2D, you actually have to unbind the texture before you do the FBO bind.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.