if you add that line of code to the example project josh uploaded, then zoom in on your screen you can absolutely tell the difference between setting up with samples. The way its drawing is getting the pixels from the fbo then drawing them as glVerts, so the actual drawing to the screen is in the context of the main draw loop’s multisampled buffer…if you bind the fbo as a texture and draw that as well, you can see that the glVert method gives you slightly better AA, perhaps because of the rendering order you mentioned. However, comment out the multisampled glut display string and you can see both methods are significantly more jagged. Even when doing something like myOfImage.setFromPixels(fbo.getPixels()…), myOfImage.saveImage(“test.png”) you can see alpha edges when enabling the glut string and none without.
I think this is to be expected…as for workarounds, haven’t found one in particular yet…maybe blendFunc? maybe GL_ENABLE(GL_SAMPLE_ALPHA_TO_MASK_SGIS) or something like that? Will try some stuff out…
assumes GL_TEXTURE_2D, but in the bin in ofTexture it takes the texture target to bind (so the ARB stuff is ok). Seems like a bug? I got funky results using this, but good results with the ofTexture bind() that ofFBOTexture inherits since I was using an ARB texture.
this said, I agree Zach, there’s not much need for the bindAsTexture() f’n. In fact, that’s why we didn’t catch it when doing the initial fixes…I always just used fbo.bind(). Everyone kosher with removing it?
p.s. do we have any plans to get this up on github somewhere, or just continue with changes via forum?
Am I the only one with a strong dislike for texture coordinates that aren’t 0 -> 1?
Definitely agree, but I do have two issues with 0…1 UV’s:
Any shaders dealing with kernels (blur, erode, dilate etc) need to operate on a pixel basis, so you need to pass in the texture dimensions as a uniform (actually an opengl extension supports textureSize2D(), but I’m not sure how widespread that extension is)
I am getting the following undeclared error on iPhone with this function in getPixels() (probably because after searching I think this function doesn’t exist in GLES…)
I was gonna ignore this because FBO is a texture, and I need to copy it to either an ofImage or an ofTexture (that is not an FBO…) but whenever I try this, i get operator overload errors from OF…doesn’t seem to want me to do this, I think it doesn’t trust me to allocate properly
I’ve been trying to get ofxFBOTexture to work, but have been getting some pretty odd behavior. This is my result from a demo app I found on the boards here:
The top left view is from the camera, the bottom and right views are using ofxFBOTexture. So it looks like the ofxFBOTexture is loading, but just not rendering correctly.
I’m beginning to wonder if there is another option for me? My app needs to draw to off-screen buffers before adding them all together to make a composite image. Is there another option I should look into? In Processing, I used the PGraphics object to achieve this.
I’m running into the exact same thing. Anybody able to figure this out? It also looks like memo’s ofxFBOTexture addon is now incorporated into “core” (or so a build note says), but i can’t seem to find it.