Convolution shader on image


i’m newbie of OF.
I would like to write a shader for applying a motion blur and high contrast to a still image but I can’t find a tutorial or a working base program to start with.

can you help me please?

thank you


Hi kronikle,

OF comes with an example folder, which is often the best place to start. In the example folder you find a folder shader, holding 9 examples for different shaders.

hope this helps, have a great day!


thank you I found the examples and everything went well.
Anyway I found that the program loads the GL2 version of shaders even if I have a GTX1070 and OpenGL 4.4 v installed.


in the example, like 01_simpleColorQuad, in the ofApp.cpp there is a chunk of code like:


This is the part of code responsible for the loaded shaders. Try to figure out in which branch condition are you ending up.


no matter what hardware you have OF defaults to opengl 2.1 by now. If you want to use opengl 3 or later you need to explicitly specify it in main.cpp like:

#include "ofMain.h"
#include "ofApp.h"

int main(){
	  ofGLFWWindowSettings settings;
	  ofRunApp(new ofApp);


Perfect! thank you!