Giter Site home page Giter Site logo

FFGL 2.0 about spout2 HOT 10 CLOSED

leadedge avatar leadedge commented on June 25, 2024
FFGL 2.0

from spout2.

Comments (10)

leadedge avatar leadedge commented on June 25, 2024 1

OK I understand what you want to do.

But do I understand the last part correctly? The plugin itself would be a source plugin and show up as a Spout source in Resolume. But it would receive only from Synesthesia, so the user doesn't need to worry about selecting it.

Or I am wondering if you have been using a Resolume Spout source from Synesthesia and your plugin as an effect on top of that which is just a pass-through.

Either way should work. But If you have an existing 1.6 plugin, maybe you could start by converting it to FFGL 2 with just the MIDI part. Once that's working, adding the Spout receiver part should be straightforward.

You should be able to use the 2.006 FFGL 1.6 code pretty much as-is. Once you have connected to the sender you could try to use "BindSharedTexture" and "UnBindSharedTexture" with a shader to draw it. Or if that doesn't work, receive to a texture within the plugin and draw that.

from spout2.

leadedge avatar leadedge commented on June 25, 2024 1

Let's close this here. But of course please get in touch if your project develops.

from spout2.

leadedge avatar leadedge commented on June 25, 2024

Conversion of the existing plugins is certainly possible. It just a matter of putting the time into it. They were not continued for Resolume because there seemed to be no purpose and so there is no specific template.

The only template I can suggest is for ShaderToy plugins. This is for FFGL 2.1 and would probably need to be revised for the most recent Resolume FGL SDK.

But looking at the Resolume example code I suspect that using "CFreeFrameGLPlugin" might allow a quicker conversion of existing 1.6 code than the quick-start methods using "ffglqs::Plugin". I would probably examine that to begin with and start afresh.

One problem that comes to mind is that the functions "DrawSharedTexture" and "DrawToSharedTexture" are based on old OpenGL code which is not compatible with Resolume any more.

"DrawToSharedTexture" was created because the used portion of the FreeframeGL texture does not necessarily fill the entire texture. The beta branch would be better to use because there is a new function "SendFbo" to replace it. "DrawSharedTexture" would probably be replaced using a shader. You should be able to use "BindSharedTexture" and "UnBindSharedTexture".

I am interested to know your use for these plugins. If you do put the time into this they could be a welcome addition.

As you progress, you can always contact me via email if there is anything I can help with.

.

from spout2.

headstash avatar headstash commented on June 25, 2024

This information is really helpful! I really appreciate it!

I have a habbit of doing pretty unorthodox things, for better or worse, haha.

I perform primarily with a program called Synesthesia and I'm looking to create an FFGL plugin that represents an instance of Synesthesia for the purpose of automation driven via Resolume. The plugin would need to use MIDI out to communicate with Synesthesia and then Spout to recieve the result. The Spout portion of the plugin was really a nice-to-have, as I could simply use a Spout 'Source" in Resolume and then my plugin could be an "Effect" and assume the user would rely on a Spout Source.

from spout2.

headstash avatar headstash commented on June 25, 2024

Almost! Synesthesia is the Spout sender, so the FFGL plugin would only be a reciever. If I can get Spout working, I'll make it a Source, otherwise an Effect and rely on the user using a Spout Source native in Resolume as you said.

This is a brand new plugin. I started with SpoutReceiverSDK3.cpp and then converted it to ffglqs::Plugin to the best of my ability. The only errors I get are from here SpoutReceiverSDK3::DrawReceivedTexture L:511 - 521 but it's possible I overlooked something in my conversion.
image

I am a beginner with OpenGL, so I've struggled to figure out how to use buffers/shared textures. It's # 1 on my things to figure out list. It would allow me to do multi-pass shaders in my FFGL plugins which I have yet to be able to do. I assumed this task would involve buffers so I was hoping this would be an opportunity to figure it out!

I found this Bloom.cpp example from the resolume/ffgl repo that I've tried to imitate, but I just couldn't get it working the last time I worked on it.

from spout2.

leadedge avatar leadedge commented on June 25, 2024

If you are receiving from the sender into "myTexture" then you are close.

I mentioned earlier that "DrawSharedTexture" won't work any more with Resolume and the same applies to the plugin code for "DrawReceivedTexture". But you have already a texture with an ID, so you can use a shader to render it.

I can't look at this for you right now, but I would suggest to look at the "Add" example. The shader used there takes two texture inputs, adds them and draws the result. You only need the shader to take one texture and simply draw it.

The shader uses "MaxUV" to take account of the part of the Freeframe texture that is used. Your texture is filled completely, so just set these to 1.0.
I can't say that this will work, but give it a try. The fragment shader code would probably be -

static const char _fragmentShaderCode[] = R"(#version 410 core
uniform sampler2D textureSrc;
in vec2 uvSrc;
out vec4 fragColor;

void main()
{
	vec4 colorSrc  = texture( textureSrc, uvSrc );
	fragColor = colorSrc;
}
)";

The plugin part would probably be -

	ScopedShaderBinding shaderBinding( shader.GetGLID() );
	ScopedSamplerActivation activateSampler0( 0 );
	Scoped2DTextureBinding textureBinding0( myTexture );
	shader.Set( "textureSrc", 0 );
	shader.Set( "MaxUVDest", 1.0, 1.0);
	quad.Draw();

As I say, that might not work, but it could be a start.

from spout2.

headstash avatar headstash commented on June 25, 2024

No worries! I really appreciate your time and you have been very helpful! I'll let you know how it goes!

If there's a place I can donate or throw you some dollars, let me know!

Also, I'd like to email you about another project I'm working on that I'd be willing to pay for your help. If you're too busy that's okay, but I feel like it would be really easy for the right person.

from spout2.

leadedge avatar leadedge commented on June 25, 2024

Well it's not working yet but this should be a start for you. I can only help in theory at the moment though.

Donations are always very welcome. Go to the Spout download page and scroll to the bottom. No worries for email. Initially use the GitHub email and I will respond.

from spout2.

headstash avatar headstash commented on June 25, 2024

Just an update! I believe your approach will work and I think I've got everything in place. I'm currently working through lifecycle issues higher up that I thought were already working. I will report back soon! If I get stuck what I'll do is create a fork/branch specifically for SpoutReceiverSDK3 and try to do a bare-bones working version and hopefully somebody can assist with whatever I'm missing. I'm hopeful that I can figure it out though!

from spout2.

leadedge avatar leadedge commented on June 25, 2024

OK. Bare bones is good to start with. It should be straightforward. If you get stuck I will have a look.

from spout2.

Related Issues (20)

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.