Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uniform arrays #146

Open
claudeha opened this issue Jun 4, 2020 · 2 comments
Open

uniform arrays #146

claudeha opened this issue Jun 4, 2020 · 2 comments

Comments

@claudeha
Copy link
Contributor

claudeha commented Jun 4, 2020

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
Copy link
Owner

3Dickulus commented Dec 1, 2021

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants