Skip to content

Alias GLSL's mix function as lerp in p5.strands (#7875) #7887

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

Open
wants to merge 5 commits into
base: dev-2.0
Choose a base branch
from

Conversation

LalitNarayanYadav
Copy link
Contributor

Resolves #7875

Changes:

  • Introduced an alias for the GLSL mix function under the name lerp in p5.strands.
  • Ensures that lerp() within p5.strands maps to mix() when generating shader expressions.
  • Falls back to the original p5.js lerp() function outside of p5.strands.

Rationale:

This change bridges the gap between core p5.js and p5.strands by making lerp() work seamlessly within shader code. It increases accessibility by allowing familiar p5.js functions to be used in new contexts.

A short inline comment was also added for clarity:

PR Checklist

@LalitNarayanYadav
Copy link
Contributor Author

LalitNarayanYadav commented Jun 7, 2025

fixes #7875

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