Skip to content

Fix p5.strands uniform calls, add instance mode construct #7961

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

Merged
merged 2 commits into from
Jul 10, 2025

Conversation

davepagurek
Copy link
Contributor

Resolves #7960

Changes

  • Allows uniformVector2(() => [a, b]) syntax to work again
  • Added support for instance mode in order to create tests
    • This involves adding the API shader.modify(() => { .... }, { a, b }) to let variables a and b work in the callback. To do this though, I've removed the options object that turns off rewriting. @lukeplowden do you think that's ok?
  • Updates shader.modify() docs:
    • they now mention p5.strands as the primary API
    • they mention how to pass in local variables, e.g. for instance mode
    • pure GLSL hooks are now shown only at the end
    • examples are interleaved with the reference now so that you see the p5.strands-only examples first, and the advance cases later
    • I'll maybe update the examples a bit more before merging; it's quite simple currently

Live: https://editor.p5js.org/davepagurek/sketches/3U6iPl83z

PR Checklist

@davepagurek davepagurek merged commit 746a481 into dev-2.0 Jul 10, 2025
5 checks passed
@davepagurek davepagurek deleted the fix/strands-uniforms-instance branch July 10, 2025 21:31
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

Successfully merging this pull request may close these issues.

1 participant