I have a FBO with one texture buffer attached. The idea is to have an atlas of billboards dynamically created and updated, as needed. When one of the sub images in the texture is going to be updated, I need to first clear the old content. What way is best to do that?
One way is to disable depth tests and overwrite with a “blank” bitmap. But it would be inefficient.
Another way would be to use glBlitFramebuffer(). Maybe it is possible to use with mask 0?
Or maybe there is a much better solution available? Obviously, I could have one separate texture for each billboard, but I just have the feeling it would be more efficient with a single atlas.
You can attach the texture to a framebuffer, set the scissor in a way that it only covers the area you want to clear using glScissor, then do glClear/glClearBuffer to clear the texture attached to the FBO.