-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEmptyEffect.cpp
More file actions
37 lines (28 loc) · 973 Bytes
/
EmptyEffect.cpp
File metadata and controls
37 lines (28 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// Created by Darren Mothersele on 05/09/2016.
//
#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);
}
)GLSL";
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> ¶mValues, FFGLExtensions &extensions)
{
extensions.glUniform3fARB(colorLocation, paramValues[0], paramValues[1], paramValues[2]);
}