3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
349 stars 30 forks source link

uniform arrays #146

Open claudeha opened 4 years ago

claudeha commented 4 years ago

Is your feature request related to a problem? Please describe.

Working on some 2D escape time hybrid code I have a lot of duplication of uniform variables for each of N formulas, which would be much cleaner if they were arrays.

Describe the solution you'd like

For uniform type var[N]; widget[spec] to replicate to N widgets in the user interface, all with the same widget spec.

Describe alternatives you've considered

Currently I have a bunch of variables named like Foo1 Foo2 etc, which is painfully repetitive.

Additional context

Another example is arrays of vec3 colours, to implement palettes.

3Dickulus commented 2 years ago

uniform int test[10]; seems to work. (not tested extensively)

also added max uniforms reporting and used uniforms reporting, shows in the log window like this on my NV GTX760...

Maximum number of uniforms: 65536
Number of uniforms in this script: 30

not sure how to add to the parser ? initialization ? altering during run ? easing curves ? uniform int test[10]; array[10,<data>] ???

not sure how to represent as a widget... pulldown list of editable items? static block of 10 widgets? simple enough for int or float but vec or mat types could be tricky.

not sure if it has an impact on available uniforms, does it count as 1 or 10 ? should be viable for all types int float vec234 etc...

WIP

3Dickulus commented 2 years ago

As of 2.5.6 FragM loads GIMP gradient .ggr files and turns them into GLSL palette code.