Page 1 of 2

FFGL Mixers in Resolume 6

Posted: Tue Apr 03, 2018 16:55
by dep
Hi,
has there been some change to how mixer effects are handled? As I remember from Resolume 3, I could make custom mixers by creating an effect with 2 input textures and a blend parameter. Have a look at the ColorWrap mixer I made as an example: https://app.assembla.com/spaces/ffgl/su ... rWrapMixer

Now, in R3, this showed up in the blend modes drop-down along with the other mixers. However, I've just now recompiled it and added it to the Resolume 6 vfx directory, but it does not appear in the drop-down (nor anywhere else I can find). What to do? I would like to develop a new kind of blend for Resolume, but I can not get my mixers to show in the R6 interface.

Re: FFGL Mixers in Resolume 6

Posted: Tue Apr 03, 2018 19:40
by edwin
It's probably because you compiled your plugin for 32 bits applications. You need to build it for 64 bits for it to work.
Check out our ffgl respository on github, we've made some changes to make sure you can build 64 bits ffgl plugins.
https://github.com/resolume/ffgl

Re: FFGL Mixers in Resolume 6

Posted: Mon Apr 09, 2018 16:46
by dep
Ok, well I forked your repository on Github and am now trying to add my ColorWrap project to it. I added the Visual Studio project and the source files to the solution, as you can see at https://github.com/matiasw/ffgl , but when compiling, I get the error "Error LNK2001 unresolved external symbol plugMain FFGLColorWrapMixer C:\work\code\resolume ffgl\build\windows\FFGLPlugins.def 1". Why? All the other projects build fine, and I do have FFGL.h included, plugMain being defined in FFGL.cpp.

How do I get Visual Studio to resolve plugMain correctly for this new project?

Re: FFGL Mixers in Resolume 6

Posted: Sat Apr 14, 2018 03:07
by dep
I fixed this problem by creating a new project for the mixer. It now works in Resolume 6.

Expect a couple of new blends from me in a few days!

Re: FFGL Mixers in Resolume 6

Posted: Sun Apr 15, 2018 00:17
by dep
Ok, I'm trying to create a mixer where I render the textures on individual quads. However, I can't quite seem to get it to work: only one source texture is shown.
Here is the source:
https://github.com/matiasw/ffgl/tree/ma ... s/FFGLDrip

If anyone has any insight, please let me know!

Re: FFGL Mixers in Resolume 6

Posted: Mon Apr 16, 2018 09:10
by Joris
I think you've switched up your tex and vert coordinates here:

Code: Select all

//upper right
		glTexCoord2f(1.0f, 1.0f+2.0-2.0*m_blend);
		glVertex2i(1, 1);

Re: FFGL Mixers in Resolume 6

Posted: Tue Apr 17, 2018 20:10
by dep
Oops!

Yes, that's right, but the main problem still remains. Even when I altered the code to draw the two textured quads side by side, like this:

Code: Select all

	//source A
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, TextureA.Handle);
	glBegin(GL_QUADS);
		//lower left
		glTexCoord2f(0, 0);
		glVertex2i(-1, -1);
		//upper left
		glTexCoord2f(0, 1.0f);
		glVertex2i(-1,1);
		//upper right
		glTexCoord2f(1.0f, 1.0f);
		glVertex2i(0,1);
		//lower right
		glTexCoord2f(1.0f, 0);
		glVertex2i(0, -1);
	glEnd();
	
	//source B
	glActiveTexture(GL_TEXTURE1);
	glBindTexture(GL_TEXTURE_2D, TextureB.Handle);
	glBegin(GL_QUADS);
		//lower left
		glTexCoord2f(0, 0);
		glVertex2i(0, -1+2.0-2.0*m_blend);
		//upper left
		glTexCoord2f(0, 1.0f);
		glVertex2i(0, 1+2.0-2.0*m_blend);
		//upper right
		glTexCoord2f(1.0f, 1.0f);
		glVertex2i(1, 1 + 2.0 - 2.0*m_blend);
		//lower right
		glTexCoord2f(1.0f, 0);
		glVertex2i(1, -1+2.0-2.0*m_blend);
	glEnd();
, I only get one full-screen quad. It seems like the blend is not processed at all.

In fact, I even added a constant-color fullscreen quad as the last item drawn, like so:

Code: Select all

	glBegin(GL_POLYGON);
		glColor3f(1.0f, 0.0f, 0.0f);
		glVertex2f(-1.0, -1.0);	// Bottom Left Of The Texture and Quad
		glVertex2f(1.0, -1.0);	// Bottom Right Of The Texture and Quad
		glVertex2f(1.0, 1.0);	// Top Right Of The Texture and Quad
		glVertex2f(-1.0, 1.0);	// Top Left Of The Texture and Quad
	glEnd();
and it's not displayed! If I solo the layer with this blend mode enabled, I get a black screen even with opacity at 100%.

What could be wrong, here?

Re: FFGL Mixers in Resolume 6

Posted: Wed Apr 18, 2018 03:15
by dep
Ok, well I "fixed" it by creating a new project. The same source now works.

This is why I dislike working with Visual C++/Visual Studio/Windows. Always some phantom bug haunting me.... :o

Re: FFGL Mixers in Resolume 6

Posted: Sat Apr 21, 2018 18:56
by dep
Well, I have the mixer done now, you can see it in the Github... but, there's one bug left to iron out: for some reason, the quad I'm rendering does not entirely fill the screen. I'm looking at the Gradients example from the Resolume Github repo, and the coordinates seem to be the same as what I'm using, so I don't really understand why this happens. Here's the code to draw the quad:

Code: Select all

	glBegin(GL_QUADS);
		//lower left
		glTexCoord2f(0, 0);
		glVertex2i(-1, -1);
		//upper left
		glTexCoord2f(0, 1.0f);
		glVertex2i(-1, 1);
		//upper right
		glTexCoord2f(1.0f, 1.0f);
		glVertex2i(1, 1);
		//lower right
		glTexCoord2f(1.0f, 0);
		glVertex2i(1, -1);
	glEnd();
And here's what it looks like:
resolume.png
I don't do any special setup of the viewport, so I think this -1..1 quad should fill the screen, no?

Re: FFGL Mixers in Resolume 6

Posted: Tue Apr 24, 2018 09:51
by Joris
The -1..1 quad fills the screen. If you clear to red, you'll see the whole viewport is black.

You're sampling from a 1920x1080 image on a (likely) 1920x1088 texture. You'll need to multiply your texture coordinates with the max texture coordinates. You can get those via GetMaxGLTexCoords.