Developer Documentation

Post Processor Interface

The PostProcessor Interface can be used to add additional image post processing functions to OpenFlipper. For example you get the rendered image in the usual buffers. Afterwards you can add a post processor doing for example edge detection or taking the depth image from the buffer and render it to the main image.

Example Code for functions:

// fetch shader from cache:
// default screenquad vertex shader
// custom postprocessor fragment shader stored in "Shaders/MyPostProcessor/shader.glsl"
GLSL::Program* shader = ACG::ShaderCache::getInstance()->getProgram("ScreenQuad/screenquad.glsl", "MyPostProcessor/shader.glsl");
// bind color texture input to texture-unit 0
_input[0]->bindColorTex(0);
// bind output FBO
_output.bind();
// setup shader uniforms
shader->use();
shader->setUniform("param0", someValue);
shader->setUniform("texInput", 0); // color texture was bound to unit 0
// execute by drawing a screen quad covering the full viewport
ACG::ScreenQuad::draw(shader);

To use the PostProcessorInterface:

- include PostProcessorInterface.hh in your plugins header file
- derive your plugin from the class PostProcessorInterface
- add Q_INTERFACES(PostProcessorInterface) to your plugin class
- And add the signals or slots you want to use to your plugin class (You don't need to implement all of them)