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

Resolves #5481 Set uniform arrays bug #5483

Merged
merged 2 commits into from
Nov 30, 2021

Conversation

aferriss
Copy link
Contributor

This resolves #5481.

The existing check for uniform array types was implemented incorrectly and returning false when it shouldn't have. I've updated p5.Shader.js to properly detect arrays.

Once fixing this, I also discovered that it had the side of effect of breaking uniforms being set from regular javascript arrays, so I modified a line or two in setUniform to check for arrays being passed to setUniform and make a shallow copy if they're found.

PR Checklist

aferriss and others added 2 commits November 27, 2021 15:15
Arrays were not being properly detected based on uniform type information.

Once fixing this, I also had to detect if arrays were being passed to `setUniform` and make a shallow copy there to make sure we update cached uniforms correctly.
@stalgiag stalgiag merged commit 4c629fe into processing:main Nov 30, 2021
@stalgiag
Copy link
Contributor

Thank you!

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

Successfully merging this pull request may close these issues.

Sending number arrays as shader uniform doesn't behave properly
2 participants