Darren Mothersele

Software Developer

Warning: You are viewing old, legacy content. Kept for posterity. Information is out of date. Code samples probably don't work. My opinions have probably changed. Browse at your own risk.

FFGL Plugins for Resolume

Sep 20, 2016


I recently spent some time learning how to build FFGL plugins.


I’ve put examples up on GitHub in the cyrilcode/ffglplugin-examples repository.

I’ve compiled and uploaded to the releases page but I only have builds for OSX.

Example FFGL Plugin


The website and the spec give the details. But I found the spec quite hard to digest. The only time I’d compiled dynamic plugins like this was to create PHP extensions. This is very different. I got the SDK examples to compile eventually. It wasn’t easy. I had to hack a couple of files due to changes in the OpenGL header files. I’m not sure if this is an OSX issue, or just that the SDK is really old.

There is an example in the resolume/ffgl GitHub repo that I found useful. I also found this ShaderMaker source code to be quite useful.

I ended up creating my own MyPlugin.h header file to abstract some of the boiler-plate work you have to do to create each plugin. Using this header, creating a plugin is a simple matter of converting the GLSL code you want to use. For example:


#include "MyPlugin.h"

class EmptyEffect {

    float redness = 0.5f;
    float greenness = 0.5f;
    float blueness = 0.5f;
    GLint colorLocation;

    PluginConfig getConfig();

    void init(FFGLShader &shader);
    void process(std::vector<float> &paramValues, FFGLExtensions &extensions);



#include "EmptyEffect.h"

FFGL_PLUGIN(EmptyEffect,"DZ00","RGB Source",FF_SOURCE,"Sample FFGL Plugin",
    "by Darren Mothersele - www.darrenmothersele.com")

std::string fragmentShaderCode = R"GLSL(
uniform vec3 color;
void main()
    gl_FragColor = vec4(color,1);

PluginConfig EmptyEffect::getConfig() {
    PluginConfig pluginConfig;
    pluginConfig.shaderCode = fragmentShaderCode;
    pluginConfig.params.push_back({"Red", FF_TYPE_STANDARD, 0.5f});
    pluginConfig.params.push_back({"Green", FF_TYPE_STANDARD, 0.5f});
    pluginConfig.params.push_back({"Blue", FF_TYPE_STANDARD, 0.5f});
    return pluginConfig;

void EmptyEffect::init(FFGLShader &shader) {
    colorLocation = shader.FindUniform("color");

void EmptyEffect::process(std::vector<float> &paramValues, FFGLExtensions &extensions)
    extensions.glUniform3fARB(colorLocation, paramValues[0], paramValues[1], paramValues[2]);


I found I needed to build in 32-bit mode for the plugins to work in Resolume.

See GitHub for more details.