This only works when multisampling is disabled. the previous version of ofxFBOTexture I was working with it would work with or without multisampling. Also, the only major difference I can see is the use of GL_COLOR_ATTACHMENT0 (ofFbo) instead of GL_COLOR_ATTACHMENT0_EXT (ofxFBOTexture)
Anyone have an idea on how to change it to get it to save the multi-sampled pixels out?
Hey thats awesome that you got it working with multisampled textures!
With the new 007 we’re really trying to modularize all functionality, which is why ofFbo doesn’t have a getPixels(); Instead this will probably be a global function, or method of ofTexture, or method of ofPixels - since the act of reading from a texture into main memory isn’t really the responsibility of an fbo.
this was quick for the time being, but if i get a chance I’ll try to roll it into a function like you mention there and I"ll post it - I can see why that way is a lot more flexible.
Hi obviousjim, know this thread is kinda old but i think the functionality is still very useful. I have copy and pasted your getPixels() function into the ofFbo code but cant seem to get it to work.
Its complaining about pixels not being declared in the scope. Have you declared this in the ofFbo.h file. is it just an ofPixel? cheers, really would love this function to work. would save me some epic headaches.
Cool, yeah i dug in and looked into the glGetPixels call that is happening and realised that its going to eat a few frames per second each time this call is made. Was kinda dreaming hoping I could pass endless copies around with no performance hit. Thanks.
yeah there’s really no way around that, since the computation image is happening on the gpu.
In practice though I’d be curious to see how big of an FBO you can draw and read back from and still maintain a solid 30 or 60 fps, worth doing a small test