GLSL actor not obeying min/max values for input parameters
-
Hello, Apologies if I missed a forum post or section in the tutorial related to this.
I've just started playing with the GLSL shader actor and I'm having some trouble with the input parameters. They don't seem to be consistently obeying the bounds that are configured in the input parameter definition. For example, I've set the max on two of my parameters as 40.0 and 10.0 but but they both only allow up to 5.0.
They also don't seem to allow for more than one decimal place in the floating point number (could be a limitation of glsl floats?)
I've attached my izz file. Any help is greatly appreciated.
Tom
-
Have you tried to change the value directly inside the code (without the isadora input) to see if it works ?
Concerning the definition of the decimal, I remember bumping into similar problem which caused by the way you define your float in the beginning. I don't remember exactly, but you define your float with its resolution
uniform float .001 speed; (<- not that but similar)
-
Hi Maxime,
Yes, I have used the min/max bound values directly in the code, that was how I determined the values I wanted to use. I didn't try assigning values to the variables before using them though(I was entering the value into the location where the variable is now) so I can try that.
It looks like the syntax for defining an initialization value is 'uniform float <name> = 1.0; so I'll give that a try. Good suggestion, thanks. Mostly I'm confused as to why different variables that are defined with the same syntax seem to be functioning different.
Thanks for your help.
Tom
-
Please go thru https://support.troikatronix.c...
There are very specific rules regarding how to declare variables for use.
I recommend locating your comments which define actor inputs at the top of the file ( as is done in the tutorial ).
-
@tadakan said:
I've just started playing with the GLSL shader actor and I'm having some trouble with the input parameters. They don't seem to be consistently obeying the bounds that are configured in the input parameter definition
Well, the problem here is that the
// ISADORA_FLOAT_PARAM(name, id, min, max, default, "help text");
statement will overwrite over what you've entered as scale min/scale max in the Inspector box. You can set the scale min/scale max, but each time it compiles the code it will reset those values.
It's a bit of a tough call on how to make this more transparent. I'l think about that. But in the mean time, follow @Maxime's advice and set the scale min/scale max in the statement shown above. If you really need to set those values externally, add a Limit Scale Value actor.
Best Wishes,
Mark -
Thanks Mark and DusX. I always really appreciate that you guys, as the developers, are so active on the forum.
I think I confused the issue when I described the input parameter. I was only trying to control the min/max values in code in the special isadora comments in code. I didn't even think about using the actor inspector to control them so I didn't intentionally set any min/max values external to the code (in the actor's GUI inspector box). I'll take a look and make sure that the inspector values match what I set in code. I was only knowing/expecting to set them in my variable definitions/comments.
I will make sure to move my variable declarations to the top of the code. I didn't think it would matter so long as they were before the first point in the code that they were used, but I admit that I was just skimming the tutorial.
I'll comment back once I've had a chance to try these things on Saturday. Thanks again.
Tom
-
i seem to have noticed that occasional <SPACE> characters that remain attached to a variable name after dbl-click select and copy, when pasted into the preprocessor code // ISADORA_FLOAT_PARAM(name, id, min, max, default, "help text"); do create the corresponding inputs , but they do not react unless you cancel the <SPACE> character in the preprocessor statement.
took me an hour to figure, one night.
the GLSL editor is kind of tricky, but i attribute this mainly to my italian keyboard. the character '[' freezes the editor until i re-compile.
the find and replace is not working as it should.
this on Win 10 with 2.60
wish to have more time for the forum.
cheers
hairi