FFGL - How to get Texture info during creation of parameters

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
User avatar
AngeloDV
Is taking Resolume on a second date
Posts: 42
Joined: Sat Oct 22, 2016 08:19
Location: The Netherlands

FFGL - How to get Texture info during creation of parameters

Post by AngeloDV »

Hi,

Simple question, I am still trying to figure this one out. Is there a way to get the actual texture size in pixels during the creation of the parameters?

An example of this is the Crop effect that retrieves the canvas size during creation.

Also is there a way to display the +/- ui display like the crop, instead of the standard range slider?

Thanks!
Image

User avatar
flyingrub
Met Resolume in a bar the other day
Posts: 11
Joined: Thu Feb 21, 2019 10:24
Location: Out of space

Re: FFGL - How to get Texture info during creation of parameters

Post by flyingrub »

InitGL function : https://github.com/resolume/ffgl/blob/m ... nSDK.h#L59

Every plugin should have a variable named currentViewport that contains texture info after InitGL is called by the host. Even if you create your parameter in the constructor and you still don't have this data, you can set your parameter to it after.

If you use the latest FFGL available (2.0) you can create integer parameter thanks to https://github.com/resolume/ffgl/blob/m ... rams.h#L88

Here is an example on how to use it : https://github.com/flyingrub/ffgl/blob/ ... on.cpp#L53.

User avatar
AngeloDV
Is taking Resolume on a second date
Posts: 42
Joined: Sat Oct 22, 2016 08:19
Location: The Netherlands

Re: FFGL - How to get Texture info during creation of parameters

Post by AngeloDV »

Thanks for the quick reply flyingrub!

I am writing for FFGL2 and changed the param creation into :

Code: Select all

addParam( paramWidth= ParamRange::create( "Width", 0.0f, { 0.0f, (float)currentViewport.width } ) );
But the ints are not set yet at that moment of creation, am I missing something?

Also thanks for the integer type, overlooked that one! ..but, it is not giving me the proper range when I do this:

Code: Select all

addParam( xMove = ParamRange::createInteger("X Move", 0, {0.0f, 300.0f}));
I tried using int values in the range but it always limits me to 0->1. Am I doing something wrong?

Thanks for looking into it!
Image

User avatar
AngeloDV
Is taking Resolume on a second date
Posts: 42
Joined: Sat Oct 22, 2016 08:19
Location: The Netherlands

Re: FFGL - How to get Texture info during creation of parameters

Post by AngeloDV »

flyingrub wrote: Thu Jul 11, 2019 09:33 Even if you create your parameter in the constructor and you still don't have this data, you can set your parameter to it after.
How?

P.s. the integer type is working now, had a typo
Image

User avatar
flyingrub
Met Resolume in a bar the other day
Posts: 11
Joined: Thu Feb 21, 2019 10:24
Location: Out of space

Re: FFGL - How to get Texture info during creation of parameters

Post by flyingrub »

I thought you wanted to change the value of the parameter, not the range. :?

So, yeah, it is not really possible at the moment, as Arena add the parameter before calling initGL, and we don'thave a way to push parameter range change to the host right now.

Eledtech
Is taking Resolume on a second date
Posts: 20
Joined: Tue Apr 09, 2019 21:22

Re: FFGL - How to get Texture info during creation of parameters

Post by Eledtech »

It's a little off topic, but I would like to ask flyingrub about ffgl 2.1 and delta time uniform.

I converted a lot of shaders with your repo examples which use ffgl2 (polygonrepeat example)

I can't make it work in new ffgl21 sdk.

Then I got sdk from juice bar store, to change over my plugins. Mostly everything is working cool, but I can not figure out how to get access to time, delta time, bpm, phase.

In your examples everything was so easy accesable.

Maybe you can advice me anything about?

Thanks and best

Erik
Visual and led designer at eledtech and aseven night club/Berlin.

User avatar
flyingrub
Met Resolume in a bar the other day
Posts: 11
Joined: Thu Feb 21, 2019 10:24
Location: Out of space

Re: FFGL - How to get Texture info during creation of parameters

Post by flyingrub »

It has been a while that I did not touch this code since Menno started to work on this, but from what I see this part did not really change and should be the same as before. :)

Post Reply