I’ve been trying to use glBlitFramebuffer/glBlitFramebufferEXT to blend 2 PBOs, but I’m not having any luck. I get a complete overwrite of one on top of the other with no blending. Does glBlitFramebuffer alpha blend or am I flat-out using the wrong function?
My drawing to each of the individual PBO’s blends quite fine, so I’ve got blending enabled and the blend functions working (not exactly the way I want, but I can sort that out once I get something).
I’d really like not to have to use textures (although I will if that’s the only solution) as there seem to be way too many drivers requiring powers of two, and I’m at 2560x1600 which would require 4096x4096 textures of which most is wasted. Not to mention the strange issues with getting pixel accurate alignment.
No. It’s a copy operation, not a read/modify/write like blending.
Although I’m curious as to how you blit “PBOs,” since blitting requires framebuffers, not buffer objects.
I’d really like not to have to use textures (although I will if that’s the only solution) as there seem to be way too many drivers requiring powers of two
No (ATI or NVIDIA) desktop hardware (and therefore drivers written for them) made in the last half-decade requires POT textures. And if you’re really that concerned, use rectangle textures, which have been available for even longer than half a decade.
Well, that answers that. So, I really have to use textures? Really? There’s no way to pixelwise composite two FBO’s directly? Not even with a shader? Seems like a major oversight.
Okay, so if I have to use textures, what’s the best way to get a pixel accurate copy? Currently I use (yes, this is JOGL):
However, drawing a quad is not guaranteed to render some edge pixels (although I could probably live with that). I could be mistaken, but I seem to recall that you have to do something to offset the texture since it samples in the center of the pixel while rendering is at the corner of the pixel.
There’s no way to pixelwise composite two FBO’s directly? Not even with a shader? Seems like a major oversight.
Oversight? The object that stores pixel data which can be both rendered to by the system and read from by a shader has a specific name. It is called a texture. Indeed, the main reason FBOs exist at all is to allow you to render to textures.
I seem to recall that you have to do something to offset the texture since it samples in the center of the pixel while rendering is at the corner of the pixel.
If you want to be technical, you sample from wherever you want, since we have shaders now. However, if you have set up your matrices as you’ve shown, that should be sufficient to get you pixel-accurate results.
The only concern would be around the edges if you’re multisampling.