ofxFBOTexture/ofxShader updates +little multisample question

Hello OFs!

I’ve made some little changes to ofxFBOTexture and ofxShader. If someone is interested you can find the changes here…

It can be really useful if you are into shadows, depth of field, blurs or stuffs like that!

All the credits goes to the peoples who wrote this two addons first! Actually I just added a few lines and most of the time by copy and paste! So big thanks to Zach Gage, Theo Watson, Memo Akten, Josh Nimoy and the guys behind ofxShader!

So here’s the changes:

-Now you can manually attach how many textures (render targets) you want.
-You can also attach a depth texture.
-If you need it the stencil buffer can be enabled too.
-I added a statusCheck method wish add more error information if something is wrong!

The code is pretty straight forward:

    fbo.attachTexture(attachment1, GL_COLOR_ATTACHMENT1_EXT);  
    fbo.attachTexture(attachment2, GL_COLOR_ATTACHMENT2_EXT);  
    fbo.attachTexture(depthAttachment, GL_DEPTH_ATTACHMENT_EXT);  

There’s a little problem with multiple rendertargets and multisampling, and as we are using the blitting technic I’m not sure if there’s any solution for that! If you need multisampling and multiple rendertargets you will need to do the blitting on your own!

-I simplified some stuffs and added the geometry shaders
-You can specify the geometry inputs/outputs/maxvert parameters too (wish is more than important if you want you shader to work)
-If you work with multiple render targets you can bind the fragdata in the shader now.


shadowVolumesShader.loadShader("Shaders/ShadowVolumes", GL_TRIANGLES_ADJACENCY_EXT, GL_TRIANGLE_STRIP, 10);  

Feel free to ask some questions / use or merge the code!




It seems that I introduced a little error before uploading!
Sorry for those who already downloaded the fbo addon!

Here’s the corrected version:


I’m getting an error from this line (75 in the header)…

GLuint ofxFBOTexture;   // Our handle to the ofxFBOTexture  

…because the field name is the same as the class name. In Code::Blocks compiling with GNU GCC (MinGW).