Page 1 of 1

FFGL - How to get Texture info during creation of parameters

Posted: Thu Jul 11, 2019 03:38
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!

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

Posted: Thu Jul 11, 2019 09:33
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.

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

Posted: Thu Jul 11, 2019 13:49
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!

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

Posted: Thu Jul 11, 2019 17:00
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

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

Posted: Mon Jul 15, 2019 11:43
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.

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

Posted: Tue Nov 26, 2019 20:11
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

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

Posted: Thu Nov 28, 2019 18:58
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. :)