resolume / ffgl Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
The SDK and examples (branch 2.1) build find in XCode but I want to use CMake to build a plugin, which is more compatible with automating cross platform builds, and this doesn't work out of the box.
I made this CMakeLists.txt in the root of the FFGL repo (same level as build/source directories):
Then ran:
cd <SDK ROOT>
cmake .
make
It results in the following:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:30:
/Users/bigfug/dev/libs/ffgl20/source/lib/ffglquickstart/FFGLPlugin.cpp:240:10: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
return "";
^
/Users/bigfug/dev/libs/ffgl20/source/lib/ffglquickstart/FFGLPlugin.cpp:244:10: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
return "";
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:4:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/../include/gl_all.h:8:
/Users/bigfug/dev/libs/ffgl20/source/lib/ffgl/../glsdk_0_5_2/glload/include/_int_gl_type.h:13:2: error: Attempt to include auto-generated header after gltypes.h
#error Attempt to include auto-generated header after gltypes.h
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:4:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/../include/gl_all.h:9:
/Users/bigfug/dev/libs/ffgl20/source/lib/ffgl/../glsdk_0_5_2/glload/include/_int_gl_exts.h:736:9: warning: 'GL_DRAW_FRAMEBUFFER_BINDING' macro redefined [-Wmacro-redefined]
#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl3.h:1174:9: note: previous definition is here
#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:4:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/../include/gl_all.h:9:
/Users/bigfug/dev/libs/ffgl20/source/lib/ffgl/../glsdk_0_5_2/glload/include/_int_gl_exts.h:864:9: warning: 'GL_INVALID_INDEX' macro redefined [-Wmacro-redefined]
#define GL_INVALID_INDEX 0xFFFFFFFF
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl3.h:1315:9: note: previous definition is here
#define GL_INVALID_INDEX 0xFFFFFFFFu
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:4:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/../include/gl_all.h:9:
/Users/bigfug/dev/libs/ffgl20/source/lib/ffgl/../glsdk_0_5_2/glload/include/_int_gl_exts.h:969:9: warning: 'GL_TIMEOUT_IGNORED' macro redefined [-Wmacro-redefined]
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl3.h:1358:9: note: previous definition is here
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:4:
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/../include/gl_all.h:27:
/Users/bigfug/dev/libs/ffgl20/source/lib/ffgl/../glsdk_0_5_2/glload/include/_int_gl_3_0.h:26:9: warning: 'GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT' macro redefined [-Wmacro-redefined]
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl3.h:631:9: note: previous definition is here
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:17:13: warning: 'NSAddImage' is deprecated: first deprecated in macOS 10.5 - dlopen() [-Wdeprecated-declarations]
image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/mach-o/dyld.h:240:34: note: 'NSAddImage' has been explicitly marked deprecated here
extern const struct mach_header* NSAddImage(const char* image_name, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlopen()");
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:20:16: error: assigning to 'char *' from incompatible type 'void *'
symbolName = malloc(strlen((const char*)name) + 2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:26:20: warning: 'NSLookupSymbolInImage' is deprecated: first deprecated in macOS 10.5 - dlsym() [-Wdeprecated-declarations]
symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/mach-o/dyld.h:192:17: note: 'NSLookupSymbolInImage' has been explicitly marked deprecated
here
extern NSSymbol NSLookupSymbolInImage(const struct mach_header* image, const char* symbolName, uint32_t options) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED...
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:28:19: warning: 'NSAddressOfSymbol' is deprecated: first deprecated in macOS 10.5 - dlsym() [-Wdeprecated-declarations]
return symbol ? NSAddressOfSymbol(symbol) : NULL;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/mach-o/dyld.h:198:21: note: 'NSAddressOfSymbol' has been explicitly marked deprecated here
extern void * NSAddressOfSymbol(NSSymbol symbol) __API_UNAVAILABLE(ios, tvos, watchos) DYLD_DRIVERKIT_UNAVAILABLE __OSX_DEPRECATED(10.1, 10.5, "dlsym()");
^
In file included from /Users/bigfug/dev/libs/ffgl20/source/lib/FFGLSDK.cpp:35:
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:605:53: error: no matching function for call to 'AppleGLGetProcAddress'
_funcptr_glColorSubTable = (PFNGLCOLORSUBTABLEPROC)IntGetProcAddress("glColorSubTable");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:87:35: note: expanded from macro 'IntGetProcAddress'
#define IntGetProcAddress(name) AppleGLGetProcAddress(name)
^~~~~~~~~~~~~~~~~~~~~
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:10:14: note: candidate function not viable: no known conversion from 'const char [16]' to 'const GLubyte *'
(aka 'const unsigned char *') for 1st argument
static void* AppleGLGetProcAddress (const GLubyte *name)
^
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:607:47: error: no matching function for call to 'AppleGLGetProcAddress'
_funcptr_glColorTable = (PFNGLCOLORTABLEPROC)IntGetProcAddress("glColorTable");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:87:35: note: expanded from macro 'IntGetProcAddress'
#define IntGetProcAddress(name) AppleGLGetProcAddress(name)
^~~~~~~~~~~~~~~~~~~~~
/Users/bigfug/dev/libs/ffgl20/source/lib/glsdk_0_5_2/glload/source/gl_load.c:10:14: note: candidate function not viable: no known conversion from 'const char [13]' to 'const GLubyte *'
(aka 'const unsigned char *') for 1st argument
static void* AppleGLGetProcAddress (const GLubyte *name)
Running macOS 10.14.6 and using Homebrew cmake
SetParamInfof( 0, "SomeRange", FF_TYPE_STANDARD );
SetParamRange( 0, 0.0f, 10.0f );
Making these two calls in the plugin i expect a parameter in the range between 0 and 10. The actual parameter's value is still within the range between 0 and 1 though. This is quite confusing because a host may apply the range to the view, so then the gui will show value 10, but the actual value that the plugin will get is 1. Correcting this may also solve the issue where we require a GetRealValue function in the quickstart parameters as well.
Is there a built-in cross-platform way to get the host name (ex: Resolume, VDMX) and version (ex: 6.1.1)?
This issue can be easily reproduced from the included AddSubract project example.
Declare:
GLuint newVertexShader;
Add an event button:
#define FFPARAM_BUTTON (3) SetParamInfo(FFPARAM_BUTTON, "BUTTON", FF_TYPE_EVENT, 0.0f);
Call glCreateShader() from the SetFloatParameter function:
FFResult AddSubtract::SetFloatParameter(unsigned int dwIndex, float value){
switch (dwIndex){
case FFPARAM_BUTTON:
newVertexShader = glCreateShader(GL_VERTEX_SHADER);
break;
case FFPARAM_BrightnessR:
m_BrightnessR = value;
break;
case FFPARAM_BrightnessG:
m_BrightnessG = value;
break;
case FFPARAM_BrightnessB:
m_BrightnessB = value;
break;
default:
return FF_FAIL;
}
return FF_SUCCESS;
}
Run the plugin, click the button and boom! - the process dies... Any ideas?
I worked around this issue by setting bool flags that are checked during each ProcessOpenGL call. All the GL stuff appears to work fine from there... This issue did not exist with previous code in FFGL1.5 - any ideas?
Thanks and Fractal Blessings.
It would be nice to know the viewport dimensions that are used.
I saw that the default input png is 1280x720
but when checking what I get in FFGLViewportStruct* vp
that I get in InitGL()
it yields 512x512.
a) Could we see the viewport dimensions in the UI?
b) Is the 512x512 correct or it is just a stub?
The usage of platform specific defines throughout the 2.1 SDK is very erratic and partial relies on the build system defining TARGET_OS_WIN or TARGET_OS_MAC (not TARGET_OS_LINUX?) though also uses:
_WIN32
__linux__
WIN32
Defines vary by platform and compiler but effort should be taken to standardise their usage through the code.
should work in all other software as that's the point isn't it? ;/
With the introduction of visibility change events some care has already been taken to support other kinds of events. The most useful other event we could support is the value change event. This enables a plugin to change the value of one of it's parameter in response to the value of another parameter that was changed. This is useful when a plugin has some internal state it wants to keep consistent with it's parameter's values. For example take a plugin providing left, top, right, bottom parameters. Maybe the plugin wants to keep the size of the indicated area unchanged. When it receives a value change for the left parameter it could automatically adjust the right parameter and send a value change to the host. The host would pick up that the right parameter has changed and reflect this change in the ui.
When glCompileShader() fails, glGetProgramInfoLog() is being called to access the error message:
ffgl/source/lib/ffgl/FFGLShader.cpp
Line 120 in d7b1003
The returnedLength variable is uninitialised and the following log[returnedLength] = 0 can do something bad / throw an exception, in addition to the log message not being obtained.
Replaced with glGetShaderInfoLog() and successfully received error messages relating to my invalid fragment shader code.
Same deal for the vertex shader:
ffgl/source/lib/ffgl/FFGLShader.cpp
Line 161 in d7b1003
-subpixel
Can't paste from clipboard into Text parameter.
on OSX.
Hi there,
I've been looking through the Xcode project. It would seem that there were some originally some additional examples of FFGL plugins in this project - one called Gradients (a source plugin) and one called Add (a mixer plugin).
It would be great to see examples of how these plugins would be written for FFGL too.
This is a bug in Resolume actually not FFGL I think.
Some plugins may not always want all of their parameters to be visible. For example some could have a boolean parameter, which if enabled, causes another set of parameters to have effect.
To prevent confusing users of the plugin the plugin may want to hide the parameters that have no effect currently depending on it's current setup, and unhide them when they start affecting the plugin's behaviour.
There should be a setting where plugins can inform the host whether they work with premultiplied or with straight colors. Currently hosts are free to do as they please and plugins would need to know which host they're running in and what their behaviour is in order to function correctly.
For example when running in resolume as a source a plugin needs to output straight colors. When running as an effect or mixer however their inputs will be premultiplied and their output needs to be premultiplied as well.
If a plugin would have a STRAIGHT or PREMULTIPLIED setting the host can respect that and provide inputs and treat outputs as the plugin sais what it is. To prevent having to bump the major api version we could have a LEGACY setting which could be the default and which makes use of the host behaviour prior to incrementing the minor api version.
GL shader object handle parameters for functions such as glShaderSource() are declared as GLuint.
FFGLShader member variables used to store these handles are confusingly declared as GLenum.
Declaration:
ffgl/source/lib/ffgl/FFGLShader.h
Line 24 in 82d76cc
Usage:
ffgl/source/lib/ffgl/FFGLShader.cpp
Line 111 in 82d76cc
This is the case for m_glProgram, m_glVertexShader, m_glFragmentShader.
Similarly, m_linkSuccess is declared as GLuint, but is used to store a GLint value.
ffgl/source/lib/ffgl/FFGLShader.h
Line 27 in 82d76cc
GLint linkSuccess = 0;
if (doLink)
{
// Link The Program Object
glLinkProgram(m_glProgram);
glGetProgramiv(m_glProgram, GL_LINK_STATUS, &linkSuccess);
}
m_linkStatus = linkSuccess;
These handles are not used for math, so it shouldn't matter a lot, however there is potential for "overflow" if copying to/from some other variable type. Meanwhile, I have to change one of them to compile. Unsigned seems like the way to go!
Curiously, I noticed that the files FFGLExtensions.cpp and FFGLExtensions.h are not included in the Visual Studio projects I am working on, so searching the FFGL solution doesn't find the clashing reference, however the compiler sure notices when #include "FFGLExtensions.h" appears in a header file, in my case brought in from the FFGLGradients example project from the FFGL SDK v1.5 (not from the Resolume repository).
Line 765 in d7b1003
ffgl/source/lib/ffgl/FFGLExtensions.h
Line 302 in d7b1003
Hi, i am having issue feeding two textures sent to the shader.
It looks like a bug. I am running on macbook m1.
`#include "The2dMaskV2.hpp"
using namespace ffglex;
static CFFGLPluginInfo PluginInfo(
PluginFactory< The2dMaskV2 >,// Create method
"P032", // Plugin unique ID of maximum length 4.
"The2dMaskV2", // Plugin name
2, // API major version number
1, // API minor version number
1, // Plugin major version number
0, // Plugin minor version number
FF_EFFECT, // Plugin type
"Add and Subtract colours", // Plugin description
"Resolume FFGL Example" // About
);
static const char _vertexShaderCode[] = R"(#version 410 core
uniform vec2 MaxUV;
layout( location = 0 ) in vec4 vPosition;
layout( location = 1 ) in vec2 vUV;
out vec2 uv;
void main()
{
gl_Position = vPosition;
uv = vUV * MaxUV;
}
)";
static const char _fragmentShaderCode[] = R"(#version 410 core
uniform sampler2D InputTexture1;
uniform sampler2D InputTexture2;
uniform sampler2D InputTexture3;
in vec2 uv;
out vec4 fragColor;
void main()
{
vec4 color = texture( InputTexture1, uv );
vec4 color2 = texture( InputTexture2, uv );
vec4 color3 = texture( InputTexture3, uv );
fragColor = color + color2 + color3;
}
)";
The2dMaskV2::The2dMaskV2() {
SetMinInputs( 1 );
SetMaxInputs( 1 );
FFGLLog::LogToHost( "Created The2dMaskV2 effect" );
}
The2dMaskV2::~The2dMaskV2()
{
}
FFResult The2dMaskV2::InitGL( const FFGLViewportStruct* vp )
{
if( !shader.Compile( _vertexShaderCode, _fragmentShaderCode ) )
{
DeInitGL();
return FF_FAIL;
}
if( !quad.Initialise() )
{
DeInitGL();
return FF_FAIL;
}
glGenTextures( 1, &texture1ID );
if( texture1ID == 0 )
return false;
glGenTextures( 1, &texture2ID );
if( texture2ID == 0 )
return false;
//Use base-class init as success result so that it retains the viewport.
return CFFGLPlugin::InitGL( vp );
}
FFResult The2dMaskV2::ProcessOpenGL( ProcessOpenGLStruct* pGL )
{
if( pGL->numInputTextures < 1 )
return FF_FAIL;
if( pGL->inputTextures[ 0 ] == NULL )
return FF_FAIL;
ScopedShaderBinding shaderBinding( shader.GetGLID() );
ScopedSamplerActivation activateSampler( 0 );
Scoped2DTextureBinding textureBinding( pGL->inputTextures[ 0 ]->Handle );
ScopedSamplerActivation activateSampler2( 1 );
Scoped2DTextureBinding textureBinding2(texture1ID );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
uint8_t array[16] = {0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_BGR, GL_UNSIGNED_BYTE, array);
//////////////////////////////
/// this portion of code makes crash the plugin
/// Assertion failed (glInt[ 0 ] == 0), in ValidateContect function in the binding sampler for loop
ScopedSamplerActivation activateSampler3( 2 );
Scoped2DTextureBinding textureBinding3(texture2ID );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
uint8_t array2[16] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0x00,0xFF};
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 2, 2, 0, GL_BGR, GL_UNSIGNED_BYTE, array2);
//////////////////////////////
shader.Set( "InputTexture1", 0 );
shader.Set( "InputTexture2", 1 );
shader.Set( "InputTexture3", 2 );
FFGLTexCoords maxCoords = GetMaxGLTexCoords( *pGL->inputTextures[ 0 ] );
shader.Set( "MaxUV", maxCoords.s, maxCoords.t );
quad.Draw();
return FF_SUCCESS;
}
FFResult The2dMaskV2::DeInitGL()
{
glDeleteTextures( 1, &texture1ID );
texture1ID = 0;
glDeleteTextures( 1, &texture2ID );
texture2ID = 0;
shader.FreeGLResources();
quad.Release();
return FF_SUCCESS;
}
`
and the hpp is. :
`#pragma once
#include
#include <FFGLSDK.h>
class The2dMaskV2 : public CFFGLPlugin
{
public:
The2dMaskV2();
~The2dMaskV2();
//CFFGLPlugin
FFResult InitGL( const FFGLViewportStruct* vp ) override;
FFResult ProcessOpenGL( ProcessOpenGLStruct* pGL ) override;
FFResult DeInitGL() override;
private:
ffglex::FFGLShader shader; //!< Utility to help us compile and link some shaders into a program.
ffglex::FFGLScreenQuad quad;//!< Utility to help us render a full screen quad.
GLuint texture1ID;
GLuint texture2ID;
};
`
i guess i do something wrong ...
hope you can help...
This is a bug in Resolume actually not FFGL I think.
I had some issue with my animation and time, so I just tried to use https://en.cppreference.com/w/cpp/chrono/high_resolution_clock/now, and now all problems are gone ๐
Fix here : flyingrub/FFGL-plugin-quickstart@cb1fa2d
The FFGLPlugin
API for adding parameters (FFGLPlugin::AddParam
) does not provide the created param index.
And automatically uses the created param index as the param ID in the created ParamInfo
.
So, if I want to use the inherited CFFGLPluginManager::SetParamGroup
which expected a param ID, I can't, because I don't know the ID.
I can go through the params myself, find the param by name, and get it's index (thus it's ID).
So this is NOT a BLOCKER, but just an incomplete API.
The new FF_TYPE_x defines in freeframe.h added by Resolume...
// Added by Resolume for HSB colors
#define FF_TYPE_HUE 200
#define FF_TYPE_SATURATION 201
#define FF_TYPE_BRIGHTNESS 202
..can be used to make Resolume use the v6 colour widget, which is neat.
However, it doesn't seem possible to access the value of the alpha slider that appears in the colour widget, which is not so neat.
Can we get/use an additional define for the alpha slider?
#define FF_TYPE_ALPHA 203
I have made a plugin that uses alpha values, and the current kludge is to have the hue, saturation, brightness sliders which result in the displaying v6 colour widget, only the alpha sliders don't do anything, and having a separate FF_TYPE_STANDARD slider for the alpha value. It works, but is confusing and ugly, especially as I have three colours to choose for the one plugin.
It'd be great if the Readme included more information about an efficient pipeline for testing your plugins. For example, it's a paint to move generated .dll to the documents/extra effects folder, users can just add the release directory in the video>FreeFame (FFGL) Plugins Directory setting.
Also, in order for updates to appear in the .dll must one manually close Resolume, delete the .dll, build the plugin again again, then open Resolume again? This is also pretty inefficient.
Would appreciate the developer's or any community members thoughts/tips/tricks.
Currently it's not possible to hide non-relevant parameters or change "option"-parameter infos.
I would use this for creating drop-down dialogs that have dynamic options.
Is this even possible to implement in FFGL, or should it be done in Resolume?
I tried to modify FFGLPluginManager.cpp's params struct directly, but the changes won't propagate to UI.
wow copy paste an image!
Preferences->Video->FFGL Plugin Directories
Releases
folder containing the .dll
s to be a directory where it looks for plugins. I closed Resolume and restarted it, and to my surprise none of the effects appeared.Preferences->Feedback->View Log
and found that when it tried to load the plugins it gave the following error:INFO: Scanning directory for plugins: C:\Program Files\Resolume Avenue 6\plugins\vfx
ERROR: Failed loading plugin. Library could not be loaded. Error: 193
INFO: Scanning directory for plugins: C:\Users\Daniel\Documents\Resolume Avenue 6\Extra Effects
INFO: Scanning directory for plugins: C:\Users\Daniel\Documents\360-VJ\ffgl\binaries\x64\Release
ERROR: ra::FFGLPluginInstance::initPluginLibrary: plugin main function was unsuccessfull, init failed.
Can anyone give me feedback on what I might be doing wrong, or at very least details on how they got up and running? My first goal is just to make an effect changing the output pixel location, kind of like the slide effect, before moving back into working on my more sophisticated effects.
How do we set the range on an input? By default all of the inputs on the example are from 0 to 1. How do I switch them to a different range?
Hi! There's one problem I'm struggling with for quite some time now. Porting my plugin to FFGL2, I noticed it was flipped, so I just added a macro to unflip when building for FFGL2 (Resolume 6.1.2). Now testing the plugin on Resolume 5 and VDMX, I noticed they are flipped too. But actually, Resolume 6.0 is flipped, all the other ones are OK. Coordinates are supposed to start on bottom left (Resolume 5, 6.1.2, VDMX), not top-left (Resolume 6.0). This is on mac, haven't tried Windows yet.
Please, what's going on on Resolume 6?
Is there any GL setting that sets the default coordinate orientation?
To test, I just changed the Gradients example to render on the bottom left, with gradients going vertically. Running the exact same compiled plugin on Resolume 5 and Resolume 6 reproduce the flip. Here's what I changed on FFGLGradients.cpp...
glShadeModel(GL_SMOOTH);
glBegin(GL_POLYGON);
glColor3f( rgb1[0], rgb1[1], rgb1[2] );
glVertex2f(-1.0, -1.0); // Bottom Left Of The Texture and Quad
glColor3f( rgb1[0], rgb1[1], rgb1[2] );
glVertex2f( 0.0, -1.0); // Bottom Right Of The Texture and Quad
glColor3f( rgb2[0], rgb2[1], rgb2[2] );
glVertex2f( 0.0, 0.0); // Top Right Of The Texture and Quad
glColor3f( rgb2[0], rgb2[1], rgb2[2] );
glVertex2f(-1.0, 0.0); // Top Left Of The Texture and Quad
glEnd();
In Resolume 6 this function is not called ( I assume this has been introduced in 7 ).
With 7 the function is always called with : -107374176.
as bpm and barPhase.
When using the ffglquickstart functions to create a ParamRange, there are cases where the default value is not used.
AddParam( ParamRange::Create( "IWillNotBeSetTo30", 30.0f, { 1.0f, 60.0f } );
will result in a param with a default value of 1 and the correct range of 1 to 60
AddParam( ParamRange::Create("ButIWillBeSetTo0", 0.0f, { -1.0f, 1.0f } );
seems to work correctly and creates a param with a range of -1 to -1, and a default value of 0
When stepping through the code, it looks like the value is set correctly at the end of the constructor, but at the start of the first pass through ProcessOpenGL, it will be set to 1
Add the ability for hosts to install a logging function which can be called by plugins to log messages. The host could interleave the plugin's messages with it's own, allowing for users of plugins to just send in the host's logs to plugin developers, providing them all the information they need to find an issue.
The host (Resolume) renders a frame using the original movie texture then passes this frame to the FFGL plugin to work with. Is there any way to access or replace the input texture for the original movie texture?
Example: If I want to make an effect that is a "window" into a VR video. The source video is 4096x2048, and my composition is 1920x1080. The only way to access all the pixels from the movie is to stretch it to fill the composition, highly reducing reducing my original pixels from my VR video.
Another example: I have an 8K movie and a 1080 composition. I want to crop and zoom into the 8K movie. Having to stretch it to composition will completely ruin the original 8K resolution.
Trying out the FFGL Gradients example as a source in Layer 1 (Resolume 6 version 61.3. rev63441), it does only rarely update when chaning any parameter. Putting it in layer 2 and having something that is animated in layer 1 it updates when a new parameter is chosen as expected.
So my questions:
Is ProcessOpenGL not always called when a new parameter is set?
We should add support to the ffgl sdk to enable plugins to make use of a host's ability to support grouping several parameters into a more simple interface. For example Resolume allows grouping scaleX, scaleY, scaleZ and scaleALL parameters into a single group where a collapsed group would enable you to edit the scaleALL parameter directly but an uncollapsed group enables you to control each parameter individually.
Adding support for this in the ffgl sdk will enable plugins to create similar groupings with the result of easier to understand initial ui while still allowing in-depth control for the more advanced users of that plugin.
The first param is used as the transition phase, but when used on an effect, it's displayed next to the opacity slider.
The value of the opacity slider should be bound to the first param of the effect
In order to know what frequencies are actually represented in the each bin of the FFT buffer, we need a way to get the audio sample rate.
It's a shame there is not one single example which works in Resolume 6, Nobody can make plugins for it because the example SDK has been "upgraded" for a release which is years away.
This is really frustrating for people trying to start out making plugins.
Not really an issue, but where do I get information on what shader version is used?
Is there a way to use Geometry shader as well?
Hi it is not an issue. Just asking for an example how i can update the content of a texture from the cpu, in the processopengl method. I want to be able to load a picture in a texture, generate cpu side algorithm and other sort of cpu special code. Anybody could put an example ?
all the best
In the FFGL1.5 branch...
ffgl/source/lib/ffgl/FFGLShader.cpp
Line 185 in 82d76cc
glGetUniformLocation() return type is GLint, and returns -1 if the uniform is not found.
The wrapper function FFGLShader::FindUniform() return type is GLuint.
This makes a mess in calling code if you want to check that the uniform was found.
The FFGLFBO::BindAsRenderTarget function has some notion of mipmaps but it's always off internally and not configurable by users of the class. We should either remove the mipmapping code, or finish it's implementation.
If we want to support mipmaps we have to either generate the mipmaps after rendering to the fbo is done, or provide a way to make the fbo render to a certain miplevel of it's texture.
Right now, for a buffer size of 512, all the bin above index ~64 are at 0.0f
, this is actually fixed in Resolume by providing a gain knob, but ffgl currently has no way to increase the input gain. I think there is a problem with the way the the fft is calculated in resolume, because you normally don't need this kind of gain to get data for higher frequencies.
Sometimes plugin developers want to have option parameters containing several categories of options. With native ui they're used to adding separators in between those categories. We should add support for plugins to add options that have to be interpreted by the host as separators.
When we add a param using SetParamInfo(), what's used by the host as key to keep track of the param, the ID or the name? Will I have problems if I update an existing plugin, adding a new parameter in between existent params, when reading saved projects?
Example, I have a plugin with 3 params:
And I add a new parameter in between, because contextually I don't want it to be displayed at the bottom:
There's quite a bit of code in the sdk that mentions Resolume specifically. FFGL is an open standard that should not care about what software it's being hosted in. If there's any workarounds or implementation that have to be made specifically for Resolume those implementations should be expanded so that this is no longer needed. Neither the sdk nor the sdk's examples should have any host specific code in them.
Hi!
If want to build a host that supports my FFGL 2.1 plugns, is the host source code I need in this repository too? Is there any example?
Roger
Hi,
I am kind of new to C++ programming, but isn't the AddSubtract
example definition of the shader
and quad
member, shadows the Plugin
's (Base class) members with the same name?
Some plugins may require loading some OpenGL resources to implement their rendering with. Currently every plugin has to load the resource for itself in it's InitGL function. It would be more performant if we could have an InitGL that's called once when the plugin is loaded and an DeInitGL when the plugin is unloaded. This is especially noticable when plugins have to generate buffers/textures inside their InitGL call as generating these resources may take several milliseconds. For real-time hosts that have a constant stream of outputs going through the plugin and onto the screen this extra time spent introduces stutters or possibly even freezes in the output, depending on how long an InitGL takes.
Implementing this will put an additional requirement on the host where it requires all plugin instances to always be processed on the same context as where the entire plugin was initialized on (VAOs are never shared, so cannot be shared context).
Recent changes in the FFGL sdk changed some texture wrapmodes to be GL_CLAMP_TO_BORDER. Please investigate why these changes are made. eg:
FFGLFBO::BindAsRenderTarget: The fbo's texture is now set to border clamping instead of edge clamping. This will introduce black outlines as the default border color is black.
Plugin::sendParams: The current sampler's texture wrapmode is changed to border clamping. What about other samplers, sampler objects and resetting the state to what it was?
The classes inside the FFGL base sdk aren't part of a namespace. This causes issues when the plugins use those classes as well. For example if a plugin has a Color class this will conflict with ffgl's Color.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.