Code Monkey home page Code Monkey logo

ffgl's People

Contributors

auspuff avatar hautetechnique avatar jorisdejong avatar martijn-resolume avatar mennovink avatar natspir avatar rebbur avatar resolumemenno avatar sandercox avatar tobetchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffgl's Issues

Add support for value change events

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.

Enable showing/hiding of parameters driven by the plugin

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.

Add support for an init/deinit that's shared between plugin instances

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).

Support separators for option parameters

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.

FFGLPlugin - SetParamGroup unusable because it need a param index

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.

SDK platform defines

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.

more than 2 samplers makes crash

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...

cpu glubyte array to texture

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

Add support for parameter groups

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.

How to set input range?

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?

Add FFT Visualizer Demo

It'd be great if the repo included a simple eq visualizer demo that clearly demonstrates how to use the new fft input.

I imagine it could look like this (maybe even simpler).

image

Accessing the original movie texture

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.

Conflicting definitions of GLhandleARB in GLee.h and FFGLExtensions.h

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).

typedef int GLhandleARB;

typedef unsigned int GLhandleARB; /* shader object handle */

Add method for updating the parameters on-fly

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.

Access alpha

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.

Flipped effect Resolume 6.0

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();

And what happens...
screen shot 2018-12-07 at 17 37 17
screen shot 2018-12-07 at 17 39 26

Building a host

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

Implement log hook

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.

Add Workflow Tips to Readme?

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.

'Gradients' source plugin, and 'Add' mixer plugin, missing from repo?

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.

Put FFGL classes inside namespace

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.

test

wow copy paste an image!

Fix parameter ranges not working correctly

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.

FFGL Testbed - what is the viewport dimensions?

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?

glGetProgramInfoLog() incorrectly called to check shader compilation errors

When glCompileShader() fails, glGetProgramInfoLog() is being called to access the error message:

glGetProgramInfoLog(m_glFragmentShader, sizeof(log)-1, &returnedLength, log);

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:

glGetProgramInfoLog(m_glVertexShader, sizeof(log)-1, &returnedLength, log);

-subpixel

The sdk is not host agnostic anymore

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.

Finish or remove mipmap support from GLFBO

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.

Investigate CLAMP_TO_BORDER changes

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?

Can't build SDK with CMake on macOS

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):

CMakeLists.txt

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

How to build, run, and view in Resolume Avenue 6?

  • I downloaded the project, opened it in Visual Studio 2017 (it automatically updated the solution), and retargeted all four projects to my version of the Windows SDK (10.0.17134.0).
  • I built the solution successfully, and in Resolume Avenue Preferences->Video->FFGL Plugin Directories
  • I set the Releases folder containing the .dlls to be a directory where it looks for plugins. I closed Resolume and restarted it, and to my surprise none of the effects appeared.
  • I checked the Resolume Log file in 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.
  • Finally I deleted Resolume Avenue and reinstalled the latest version of Resoume 6 with the same result.

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.

Add explicit premultiplied / straight setting

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.

Default value for ParamRange is not used

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

FFGLGradients

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?

FFGLShader: inconsistent types for storing GL handles and link status (FFGL1.5)

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:

GLenum m_glProgram;

Usage:

glAttachShader(m_glProgram, m_glFragmentShader);

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.

GLuint m_linkStatus;

  GLint linkSuccess = 0;
  if (doLink)
  {
	  // Link The Program Object
	  glLinkProgram(m_glProgram);
	  glGetProgramiv(m_glProgram, GL_LINK_STATUS, &linkSuccess);
  }
  
  m_linkStatus = linkSuccess;

SetParamInfo() order

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:

  • 0: A
  • 1: B
  • 2: C

And I add a new parameter in between, because contextually I don't want it to be displayed at the bottom:

  • 0: A
  • 1: X
  • 2: B
  • 3: C

GL calls from SetFloatParameter() cause crash.

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.

Provide a way to get a gain value over the fft input, problem with resolume fft ?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.